Create textfield with border in swiftUI || textfield corner swiftUI

Solution:

Use the below code to create  textfield with border in swiftUI.

struct textField: View {

    @State var textValue:String = ""

    

    var body: some View {

        let tField = TextField("", text: $textValue)

            .background(Color.black)

            .cornerRadius(10.0)

            .border(Color.gray, width: 1)

        

        return tField

    }

}

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift