uistoryboard

How unwindForSegue:towardsViewController: works?

♀尐吖头ヾ 提交于 2019-12-03 00:24:20
In my simple app, I have created some controllers with basic segues between them: Yellow controller -> BlueController -> GreenController -> OrangeController . Every of them has its own custom class. From OrangeController I created unwindSegue to my YellowController . It is ok. Within every class I put: override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) { print(unwindSegue) print(subsequentVC) } But it was not called at all. Why? What demo should I prepare to test this functionality? The same is with: func

How to embed a custom view xib in a storyboard scene?

落爺英雄遲暮 提交于 2019-12-03 00:20:30
问题 I'm relatively new in the XCode/iOS world; I've done some decent sized storyboard based apps, but I didn't ever cut me teeth on the whole nib/xib thing. I want to use the same tools for scenes to design/layout a reusable view/control. So I created my first ever xib for my view subclass and painted it up: I have my outlets connected and constraints setup, just like I'm used to doing in the storyboard. I set the class of my File Owner to that of my custom UIView subclass. So I assume I can

iOS: Make segue wait for login success

こ雲淡風輕ζ 提交于 2019-12-02 20:59:07
I am designing an iOS app using XCode 4.2's storyboard feature. The app has a login screen that takes a username and password and has a button to log in. Pushing the login button triggers a push seque to another view controller. However, I want the seque to wait until the login comes back successful before proceeding to the next view controller. I know about prepareForSegue:sender: but heres my issue: the login call is asynchronous. I therefore cannot perform the login there. Is there someway around this? Can I create a seque in the storyboard that is only triggered when I want it to be (as

Sharing the Same UIViewController as the rootViewController with Two UINavigationControllers

血红的双手。 提交于 2019-12-02 20:51:50
Update: I have decided to go a different route with my problem. Instead of trying to reuse the same UIViewController directly, I use two vanilla UIViewControllers that are set as rootViewControllers . In their loadView methods, they make a call to [storyboard instantiateViewControllerWithIdentifier:] to get the former UIViewController and set their views to the controller's view. This is probably the preferred approach anyway, since I need to set several variables and delegates. I have a UIStoryBoard with a UITabBarController as the entry point connected with two UINavigationControllers . Each

Why not just set initial view controller for login screen like this?

家住魔仙堡 提交于 2019-12-02 20:44:04
问题 I've already read this and this questions. But I didn't understand why the code below is not enough. This just works. Do I need an else statement to set rootViewController for LoginViewController ? Isn't it already set by Storyboard? func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { if Settings.loggedIn { let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) let mainViewController =

Storyboard Entry Point Missing

假如想象 提交于 2019-12-02 20:41:02
In xcode 7.2 there is no Storyboard Entry Point item in the Object List. I need to use Storyboard Entry Point , I couldn't find any similar problem by google searches so can anyone help me here. Click on Top of ViewController or Controller in Document Outline window (on left side) of the Controller you want to make Storyboard Entry Point. Click on Attribute inspector button (in right side). Enable "Is Initial View Controller". Storyboard Entry Point will reappear hopefully. There is a Is Initial Controller checkbox in the Attributes Inspector ( ⌥⌘4 ) of the window controller in Interface

TableView with multiple prototype cells

霸气de小男生 提交于 2019-12-02 19:20:35
I had a simple question regarding a table view with 3 different kinds of prototype cells. The first two occur just once while the third occurs 4 times. Now what I'm confused about is how to specify in my cellforRowatindexpath which cell prototype to use for which row. So, I want something like for row 0, use prototype 1, for row 1, use prototype 2, for rows 3,4,5 and 6 use prototype 3. What's the best way to do this? Do i give each prototype an identifier and then use dequeueReusableCellWithIdentifier:CellIdentifier ? Can you'll provide some sample code? EDIT: Still not working. This is the

How do I make a now playing bar like in media player apps in iOS with XCode?

旧时模样 提交于 2019-12-02 18:53:13
I am making a media player app. I have UITableViewControllers that are embedded in Navigation Controller. I would like to somehow make a view that would overlay potentially multiple (2?) of these tableviewcontrollers (one that shows the user's playlists, and the next would show the tracks in the playlist), but only at the bottom, like a now playing bar in (e.g.) Spotify's iOS app (as in the left bottom side of this or as in this I have tried to drag a Container View into my Navigation controller (in which my TableViewCell is embedded), but it won't let me drop it there. It looks like I can

Xcode 6 how to enable storyboard zoom?

本小妞迷上赌 提交于 2019-12-02 16:27:16
I've updated to Xcode 6 beta 3 and see that the [+ = -] buttons in the storyboard corner are gone. Is there a way for me to zoom in and out on view controllers within a storyboard in Xcode 6? joyeon You can zoom the storyboard by double-click canvas or using top-menu(Editor > Canvas > Zoom). Alternatively: Right click blank space on canvas and choose zoom level (allows to zoom out further than double click) If you have a magic trackpad (external or embedded in the macbook) you can also pinch to zoom... It sounds quite obvious, but I've just discovered it. double cick is best for zooming IN and

Closing a view displayed via a modal segue

℡╲_俬逩灬. 提交于 2019-12-02 16:08:51
I'm manually invoking a segue (set as modal) in order to display a login form in Xcode 4.2 using Storyboards with the following line of code: [self performSegueWithIdentifier:@"LoginSegue" sender:nil]; I'm probably missing something really simple, however I can't find a way to programmatically close the login view and return to the previous view. The view is part of a navigation view controller, so setting the segue type to "push" allows me to use the back button to send me back to my previous screen, but in "modal" mode, I'm not entirely sure how to achieve this (after button press, for