How can I set a Id to my textbox in Swift
You just need to give it an accessibility identifier.
You can add this as a user defined runtime attribute, do it in code or the easiest is to add it through the property inspector.
Code
titleLabel.accessibilityIdentifier = "titleLabel"
Property Inspector