Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tony Warner
1,631 PointsHow does one mix programmatically-created Views with Views made in the Interface Builder Xcode?
(iOS / Swift / Xcode) I am trying to figure out how this all works, and this question seems too uncommon for Google or Youtube to be able to answer. What my situation is, is this: I wrote an app by following a tutorial that didn't use a Storyboard, but instead was totally written programmatically (the Views, the Controllers, the Models). I like that, but when I went to build my own app, I used the Storyboarding of Xcode and wanted to integrate a lot of the code I had written on the previous, no-storyboard-app. The complication comes from this: Navigating programmatic views is DIFFERENT from navigating storyboard views. I understand how to integrate the specific programmatic functions into a storyboard-app, but I don't know how to do the Controllers, or Views, or Navigation. Here's a specific example: In the non-storyboard (NSB) app, there is a Navigation Bar with Nav Bar Item titled "Logout." The Logout item handles Logout. But in the storyboard app (SB), when I embed the view into a Navigation Controller, which adds the Navigation Bar, the only item is "Back," and that item only seems to do a Back function. How would I change the title and action of that Back button? How would I integrate parts that are programmatic into parts that are storyboard? I suspect I have to make a Navigation Controller class??? But I don't know enough about code-architecture to know what to do / why to do it / what I'm even saying.
Please help. This is one of those weird questions that would never get answered unless someone who knows a lot about code can answer it.