Xcode 4: Iphone - Adding a table view to an existing project - xcode

I'm new to programming IOS and I'm creating a small App for our College. This app consists of a main view that has a couple of buttons to open different things (Map, Welcome message from the Dean, Intro video, etc...). One of these buttons will open a table view that will show our 5 campuses. When they select a campus it will open a UIWebView that shows the information about that campus.
My problem is that I was able to add a nib to my project and place a tableview object in that nib. It displays, but I,m not able to get the navigation bar or navigation button to show.
Would you have any site or suggestions?
Thanks
Ren

You should try using an Navigation Controller. When you connect the other views to it, it will automatically add the bar and the button.
Good luck!

Related

Where did tabbed controller views go in storyboard?

Forgive but I haven't coded in about a year or two, so I haven't been following the latest update in Xcode.
Anyways, I decided to go back and brush up on some skills and I noticed right off the bat that a lot has changed.
I created a new project using the tabbed view controller set up, usually it shows in storyboard immediately upon creating the project. Now there is nothing there. Where did it go and how do I bring it back?
I attached a screenshot so you can see the simulator running the tabbed apps but not showing in storyboard.
enter image description here
You opened the LaunchScreen.storyboard. This layout appears on the screen for a few moments while the app is launching.
https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/launch-screen
The storyboard that you are looking for is Main.storyboard
Notice, that there is no Main.storyboard if you start with SwiftUI
There are no specialized app templates any more. But there is still a tab view controller object in the storyboard editor's library, so just drag it into the canvas and use it. It gives you same two-child tab view controller as before.

In Xcode, how do I create an outlet for a button that is inside a container?

I'm a total newbie with xcode and swift, trying to wrap my head around ios programming.
I'm designing a storyboard for my app. The storyboard uses containers to keep track of the controls. In one of the containers resides a button. I want to create an outlet for it to add some code when it is clicked.
If the button would be on the base viewport of the storyboard, I would control-drag a blue line from the button to the source window with my UIViewController subclass file, and it would assist me in generating the code. But for some reason when the button is in a container, this just doesn't work.
When following the documentation, it says to open the assistant editor when the button is selected and it should open the relevant file. So it open an objective-c file, but when I try to control-drag into it, it informs me that I do not have write permissions. Also I feel like I should be doing it in a subclass instead.
I have searched online a lot and tried everything I can think about, but nothing has worked so far. How does this work? Can I do it programmatically or so perhaps? I hope someone can straighten out this question mark...
A container view is intended to represent an area that will host a view from a different view controller that becomes a child of the view controller that owns the container. Usually, you would create a second view controller, link your container view to it using an "embed" segue, and then put your buttons and such in the second controller's view. The code behind those would then go into the second controller.
If your purpose is simply to have superviews to control layout within a single view controller, use a UIView rather than a container and the problem goes away. That's what the Editor->Embed In->View menu item is for.

How do I add an "add" button to a tab in a uitableviewcontroller within a uitabbarcontroller?

xcode 4.6
using Storyboards
When I drag a Bar Button Item to the navigation bar at the top of one of the UITableViewControllers that are children of the UITabBarController xcode creates a new navigation bar at the bottom of the page instead of adding the button where I dropped it. I would be ok with this, but when I run the app the bottom navigation bar never shows up, so my button is never displayed.
If you need to visualize the app, picture the following: Root controller displays a list of accounts. When an account is clicked a tab controller lists tabs for opportunities and contacts. I need the ability to add opportunities and contacts from the relevant tab
Any help is greatly appreciated.
EDIT
I am not sure if this is the correct solution or not. I have embedded the uitableviewcontrollers in navigation controllers, which appears to have fixed the problem.
Follow-up question - Is this the correct way to handle this situation?
Yes, that is the correct way to handle this situation.
You should embed the view controller inside a navigation controller by clicking the view controller in your storyboard and using the Xcode menu "Editor" > "Embed In" > "Navigation Controller".

PopOver button disappears when I switch page on UISplitView application

I am trying to make a application that uses the standard Split View Application in Xcode, i want to be able to have multiple detail view controllers, this is all set up and it switches between the different detail view controllers fine, although when it switches it doesn't show the popup view controller button in the top left hand corner when i switch to a new page
Many Thanks for any Help
Thomas
I have fund that the reason that this may occur is because the default Xcode uiSplitView application template sets the detail view as the split view delegate so you need to either make the master view to be the delegate or make the new detail view as a delegate also.

Presenting multiple views sequentially - OS X

Following up on this question: Kiosk Applications - OS X programming - Multiple monitors
I'm an iPhone programmer just starting out with OS X programming, and I'd like to know how I can present multiple views sequentially.
What I basically need to do is - Have a welcome screen with a button called "Click here to continue". Once the user clicks that button, it needs to completely replace the view with another view presenting a table view of options that the user can choose from.
I actually need to create a couple more screens, but any help on how to get this basic setup can help me get started. The problem I'm having is almost all the mac application source code available on Apple's website seems to be oriented towards single window applications popping up multiple windows for any additional tasks.
Thanks,
Teja
I enjoyed using M3NavigationView from Martin Pilkington http://www.mcubedsw.com/dev
Basically it pushes and pops NSViewControllers on a stack and allows you to animate between them. I am doing this for a quick setup wizard on an app I am working on.
Make a tabless tab view, and put each of your views into one of the tab view items. In Interface Builder, each tab view item will have a view automatically, so you just need to put all of the subviews for that tab into that view.
You can then switch tabs from code—e.g., in response to the “Next” button.

Resources