I am fairly new to the OSX development and I am finding difficulty on getting some helpful material on the oSX development.
I want to slide from one view controller to another. How do I do that?
I know how to get from one view controller to another. When a button is pressed on the controller another view controller pops up. I dont want that. I want to slide from one view controller to another. Is there a way to do that?
Any help is appreciated
Navigation controller does exactly what you want(it is its default animation), create storyboard file, drop navigation controller in there, set it as initial view controller and there you have it.
Here is a very useful tutorial for storyboards and navigations: http://www.raywenderlich.com/81879/storyboards-tutorial-swift-part-1
Related
I am working in Xcode 13.1 and I have a small version of my view controller hovering above the view controller I am working on. It appears to be a way to auto-focus my actual view controller window on a specific portion of the view controller, but in actuality it is just in my way. Is there a way to toggle off this feature? I can't figure out what it's called, but here is a picture.
enter image description here
This is called mini map. You can disable the mini map by clicking the storyboard options.
I'm sure I'm asking a simple question but I've only just started coding... so take pity on me!
I'm trying to figure out how to connect buttons (actions) to the viewController.swift from a modal/popover segue (I think the solution is the class but whenever I change it I get an error).
Eg.
In the storyboard, on the viewController interface, I have a button for sharing files. When I click it, a popover segue appears with two buttons on it, one for Fb one for Twitter, but I can't connect any actions from them to the viewController.swift
In another project I made a Google+ login and connected it to a modal segue but I couldn't make that work either.
Is segue the wrong thing to use?
Thanks for your help!
Marie
Your question would be easier to answer if you'd provide the actual error you're getting when you try to change the class.
It sounds like you're trying to connect the popover's buttons to actions in the presenting view controller (that is, the view controller that presented the popover), rather than the view controller of the popover itself. If that's the case, then that's the problem. You can only connect your buttons directly to actions available in the current scene.
This means you need a custom class for the presenting view controller (the one with the button that segues to the popover controller) and one for your popover. Set each scene view controller's classes to the appropriate custom classes you created (which must be a subclass of NSViewController or one of its subclasses or you won't be able to set the class name in IB) and you should be able to drag connections.
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.
I've been messing around with the new iOS7 SDK and I want to make a back button like there is in most of the other OS apps. Heres a screen shot of what I'm trying to do:
But I can't figure out how. I've never really messed with interface builder because I usually code with opengl apps, so any solutions would be much appreciated. Thanks.
That is is standard "back" button. You get this when you use a navigation controller and show one view controller then push a second. The "<" means "go back". The "September" part is the title of the previous view controller. You don't need to create one of these. Just make proper use of a navigation controller and a couple of view controllers and it will appear automatically.
Am working with my first storyboard application and am having a problem. When I drag a navigation controller to my layout, the root controller always ends up as a table view controller, when all I want is just a basic view controller.
How do I keep the navigation controller from setting up the root view controller as a root table view controller?
Thank you.
This has changed sometime between Xcode 4.2 and 4.3.3. I had Xcode 4.2 on another computer running Snow Leopard, and adding a navigation controller sets up a regular view controller as the root view controller, but Xcode 4.3.3 on my main development machine running Lion behaves as you described--it adds a table view controller.
I'm not aware of any way to change this (maybe Xcode ninjas could hack some templates?), but of course you can just delete the table view controller and add a new regular view controller, and set its custom class. Then you Control-drag from the navigation controller to your new view controller, and select "Relationship - Root View Controller" from the pop-up menu (this used to say "... - rootViewController" in Xcode 4.2).
Erica Sadun's "The iOS 5 Developer's Cookbook" relies on the old Xcode 4.2 behavior in Chapter 4's storyboard walkthrough, but I managed to complete it with no issues using the workaround I described above, which you probably have found already. But if not, hope this helps.
Just simple add navigation controller to the storyboard
after that delete link shown between viewcontroller and navigation controller
then add tableview controller to the story board
control click on the navigation view and realease on the tableview controller
in the apperaing menu select relationship segue as rootviewcontroller