uistoryboard

Invoking push segue programmatically and prepareforsegue method

风流意气都作罢 提交于 2019-12-06 01:04:28
问题 I'm invoking push segue programmatically as below UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc = [mainStoryBoard instantiateViewControllerWithIdentifier:@"addToCartViewContollerForItem"]; [self.navigationController pushViewController: vc animated:YES]; but my problem is I want to send some info with this segue to the destination viewcontroller. But the method - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender is

Getting Initial View Controller from Storyboard inside the App Delegate

淺唱寂寞╮ 提交于 2019-12-06 01:04:11
问题 I am trying to access the initial viewcontroller of my storyboard. It is a navigation controller which is wired up to a second viewcontroller via a seque. So after my application did finish launching I want to directly show the viewController that is connected through the segue. I tried it out with code like this but it doesn't work ... UINavigationController *navController = (UINavigationController*)self.window.rootViewController; [navController.topViewController performSegueWithIdentifier:@

How to link Table dataSource and delegate outlets to UITableViewController?

╄→гoц情女王★ 提交于 2019-12-06 00:36:44
问题 I'm new to Swift/iOS development. I have a UITableView in my storyboard that I want to populate with some data. In my attempt to do so, I created a class that inherits from UITableViewController . The implementation is not yet complete, but my understanding is that by inheriting from this class I can provide an IBOutlet to both dataSource and delegate . When I try to drag the outlet into the source file, I don't get the insertion point that I got when I tested this before. See image below:

Push View Controllers from Modal View in Storyboard

本小妞迷上赌 提交于 2019-12-05 19:10:35
I am using storyboard and have a screen which is presented modally, which I then need to push other view controllers from so that I can select items for the modal view (similar to adding an entry on the iPhone Calendar app). So I am going from: Navigation Controller > VC > Modal View Controller > ??? Here I want to push a VC so that I can select an item to return to the modal view. How can I make this possible as I'm currently getting an error "Push segues can only be used when the source controller is managed by an instance of UINavigationController." Ah ok, so I now have it setup like you

How can I set the size of a UIView init with storyboard?

怎甘沉沦 提交于 2019-12-05 18:41:55
I am currently using iOS 6.0. I have a custom UIView that needs to have a certain size. If I programmatically init the view and add it it's fine. However, I can't find a place where I can set the size of the view in the storyboard. Setting its size in the storyboard doesn't work because the storyboard thinks it's empty and set it's size to zero. Setting its size in viewDidLoad or viewDidAppear doesn't work because later on the size will be overwritten by _applyISEngineLayoutValue . You can do that in your Interface Builder. Open the storyboard where you have your view and open the utilities

How to add storyboard reference in another storyboard

心已入冬 提交于 2019-12-05 18:24:57
问题 I have 2 storyboard - mainStoryBoard1 and mainStoryBoard2 . I need to perform a segue from ViewController of mainStoryBoard1 to ViewController of mainStoryBoard2. Anyone has idea how to do this? 回答1: Interface Builder in Xcode 7 has "Storyboard Reference" object in the "Object library": Just drag that onto your storyboard. You can then select that storyboard reference and specify the storyboard to which it refers in the attributes inspector: Then you can now add segue to this reference and

How to manually set which storyboard view to show in app delegate

ⅰ亾dé卋堺 提交于 2019-12-05 17:59:12
I have an app that wants to log out user whenever application is inactive for a set period of time. It's multiple different views in the app, and i want the app delegate to set loginview as current view whenever this method fires: - (void)applicationDidBecomeActive:(UIApplication *)application How to manually set loginViewController as current showing view in the storyboard in this method? UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]; LoginViewController *loginViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@

What is the relationship between Storyboard form factor & Active Scheme in Xcode using Autolayout?

白昼怎懂夜的黑 提交于 2019-12-05 17:32:59
I have a project in Xcode 5.0.1 targeting iOS7. I'm designing the app with a Storyboard, and I'm using Autolayout. When I build and run the app, I'm using the iOS Simulator to test it. I switch between the 3.5" and 4" retina schemes to view the app on different screen sizes. For the most part, everything works fine and Autolayout seems to work great. However, on one screen, there is a problem with the layout, but only under the following conditions: I set the scheme to "iPhone Retina (4-inch)" under iOS Simulator On the Storyboard, the form factor is set to "Retina 3.5-inch" In this case,

iOS 7 status and navigation bar different height in storyboard than in app

寵の児 提交于 2019-12-05 16:51:04
This is a view controller than is modally presented and therefore full screen. In the storyboard, the "top layout guide" is at y:64 . That is what I would expect when the status bar is height:20 and navigation bar is height:44 . However, when the app runs, the "top layout guide" is y:52 . I have no idea how or why it's losing 12 points. zinc1oxide When you use Apple's Navigation controller which inserts a navigation bar, it will have different heights based on your orientation. For example, the navigation bar is 44 points in portrait and 32 points in landscape. In your case, I'm guessing when

How to honor Dynamic Type Accessibility Sizes with a custom font in an iOS storyboard

南楼画角 提交于 2019-12-05 16:27:05
问题 How can I use the dynamic type text style "Title 1" and set the font face to the built-in font Chalkboard SE for a UILabel in a storyboard? I need to honor the Dynamic Type size in iOS (Apple has been encouraging this since iOS 7?) I also need to use the built-in font Chalkboard SE, which is not used by default for the "text styles" fonts. I am currently using a custom font as shown in the image, but need the font to change size in accordance with the user's Dynamic Type / Accessibility Sizes