Group Group Group Group Group Group Group Group Group

Secure field show "Strong password"

in the book page 254 about SecureField

@State var password = “”

SecureField.init(“Password”, text: $password)

why I run the iPhone8 similator ,focus on it with softkeyboard,
then the background of secure field become yellow, at righthand side of secure field show “Strong password”

if not using soft keyboard, using mac keyboard for simulator input, just show dot . which is different to what soft keyboard input.

if run in the real device if input also show dot.
any idea why it show Strong password"?

below is another post, is not my post, but it is the same look,
show Strong password, and yellow background .

the way to reproduce open 07-controls-and-user-input/final project in Register view file .
@State var password = “”
SecureField(“Password”, text: $password)

below is full code in registerview file. then run in simulator , got the issue.

and I found , if delete
TextField(“Type your name…”, text: $
from below code, then securefield will behavor back to normal, using softkeyboard in the simulator, show dot.

import SwiftUI

struct RegisterView: View {
@EnvironmentObject var userManager: UserManager
@ObservedObject var keyboardHandler: KeyboardFollower

init(keyboardHandler: KeyboardFollower) {
self.keyboardHandler = keyboardHandler
@State var password = “”
var body: some View {
VStack {


  TextField("Type your name...", text: $
    SecureField("Password", text: $password)
  HStack {
      .foregroundColor(userManager.isUserNameValid() ? .green : .red)

  HStack {
    Toggle(isOn: $userManager.settings.rememberUser) {
      Text("Remember me")

  Button(action: self.registerUser) {
    HStack {
      Image(systemName: "checkmark")
        .frame(width: 16, height: 16, alignment: .center)


  .padding(.bottom, keyboardHandler.keyboardHeight)
  .edgesIgnoringSafeArea(keyboardHandler.isVisible ? .bottom : [])


// MARK: - Event Handlers
extension RegisterView {
func registerUser() {
if userManager.settings.rememberUser {
} else {



struct RegisterView_Previews: PreviewProvider {
static let user = UserManager(name: “Ray”)

static var previews: some View {
RegisterView(keyboardHandler: KeyboardFollower())

I found interest thing is just in simulator

if there is a textfield on top of SecureField, will have this issue.

but if move this textfield under SecureField, this issue will gone.

SecureField(“Password”, text: $password)
TextField(“Type your name…”, text: $

Good one, so your issue is resolved?

no, still dont know why cause this issue. and how can run in simulator without issue.