0

I am new to developing a user interfaces and iOS in general. One of my colleagues is using a navigation controller for a "create a profile" page where you enter in various pieces of information to create a profile. One of the issues we have is that there is no back button to tap if you make a mistake so that's what I am going to work on. However, using storyboards, I don't actually see any of these buttons and textfields that he has created so I don't know how to add a button to these pages. Is there a way to view specifically what the pages look like. Currently all I see is a gray storyboard that just says Navigation Controller.

Thanks for your help.

NewbsMcgee
  • 13
  • 3
  • Maybe he’s adding all views and setting up the ViewController programmatically. Take a look in the class of the view or navigation controller to get an idea about what he did and how you can alter it. Check viewDidLoad, viewWillAppear and viewDidAppear functions, this is what most people use setup the controller. – Saleh Altahini Feb 22 '19 at 18:07
  • Thanks! I am going to take a look right now. – NewbsMcgee Feb 22 '19 at 18:08
  • Thank you @SalehAltahini it does appear as that is what he did. Do you know of any tutorial or Xamarin help page that can guide me through the process of adding this back button on certain pages? – NewbsMcgee Feb 22 '19 at 18:10
  • I don’t know anything specific about Xamarin but there’s a lot of tutorials online. I found this question about adding buttons https://stackoverflow.com/questions/31175831/how-do-you-make-buttons-programmatically-using-xamarin You can also take a look at Swift tutorials, as I know Xamarin Swift is not so different than Xcode Swift except for some api names. – Saleh Altahini Feb 22 '19 at 18:38
  • This is fantastic, @SalehAltahini. If you want, you can answer this officially and I'll accept your answer. This has been very helpful. I wasn't sure how he was able to do any of this programmatically. – NewbsMcgee Feb 22 '19 at 18:47

1 Answers1

0

For anyone new to iOS development and is wondering how to setup a ViewController programmatically, you can use the functions viewDidLoad, viewWillAppear or viewDidAppear to do this. Check this answer here to learn the difference between them, it's better explained there than I can explain.

Here is an answer to how to programmatically add a button to a view controller in Xcode Swift. And this one is for Xamarin.

There are a lot of tutorials online for both and are relatively easy to learn. If you have any troubles understanding something you can always post your question here, Just remember to keep your question general so others can find it and benefit from it.

Saleh Altahini
  • 373
  • 2
  • 12