Reputation: 1209
I've seen that in many apps but I can't find an useful tutorial online. How can I realize something like that in Swift?
Upvotes: 0
Views: 740
Reputation: 2643
Okay, So you need to add a UITextField
to your NavigationBar. Here's the code that should help you :
var textField=UITextField()
//Configure the size and other properties..
self.navigationItem.titleView = textField
And for the button on the right, you should do this :
var button = UIBarButtonItem(title: "FOO", style: UIBarButtonItemStyle.Plain, target: self, action: "FOO")
self.navigationItem.rightBarButtonItem = button
That's all done there, but I strongly think that you shouldn't add a login form to your navigation bar, it's very impractical.
Upvotes: 1