uistoryboard

Prepare for Segue in Swift

梦想的初衷 提交于 2019-11-26 17:35:39
I'm facing the error message: "UIStoryboardSegue does not have a member named 'identifier'" Here's the code causing the error if (segue.identifier == "Load View") { // pass data to next view } On Obj-C it's fine using like this: if ([segue.identifier isEqualToString:@"Load View"]) { // pass data to next view } What am I doing wrong? This seems to be due to a problem in the UITableViewController subclass template. It comes with a version of the prepareForSegue method that would require you to unwrap the segue. Replace your current prepareForSegue function with: override func prepareForSegue

UIPageViewController and storyboard

风格不统一 提交于 2019-11-26 17:09:42
I'm trying to configure a UIPageViewController SPECIFICALLY from storyboard: TutorialPageViewController.h #import <UIKit/UIKit.h> @interface TutorialPageViewController : UIPageViewController <UIPageViewControllerDelegate, UIPageViewControllerDataSource> @end TutorialPageViewController.m #import "TutorialPageViewController.h" @interface TutorialPageViewController () @property (assign, nonatomic) NSInteger index; @end @implementation TutorialPageViewController { NSArray *myViewControllers; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super

Does storyboard eliminate the need for .nib

ε祈祈猫儿з 提交于 2019-11-26 16:25:05
问题 With the introduction of storyboard, I wouldn't select to create a .xib/.nib when I create a subclass of UIViewController, because I can just drag out a viewcontroller in interface builder and assign it to the new class. So, with storyboard, when would i need to use the .xib/.nib file? Thank you. 回答1: I guess, storyboard contains the .xib/.nib files for all your views. It present relationships between them and helps you to avoid confusion if you have a LOT of views. Also it saves your time

How to call a View Controller programmatically?

情到浓时终转凉″ 提交于 2019-11-26 15:17:28
问题 I have looked at all the tutorials I can find on this one, and I still don't have the answer. I need to call another view from the code. I am using UIStoryboards . I have changed the view many times by control-dragging from UIButtons , but now it must be from the code. I am trying to call the info page from the main menu if it is the first time the user has opened the app. I cannot seem to find a way to change the views from the code, however. All my views are controlled by the same files (

Does anyone know what the new Exit icon is used for when editing storyboards using Xcode 4.5?

拥有回忆 提交于 2019-11-26 15:12:50
问题 Right-clicking the Exit icon yields an empty window. Can't Ctrl-drag a connection to any IB elements or corresponding source files. Docs give no love. Doesn't appear in nib files, only storyboards. My assumption is that it's a corollary to segues, but I don't see any new methods to back it up. Anyone? 回答1: There's a lot of information in the WWDC video "Session 407 - Adopting Storyboards in your App." Say you have two view controllers linked by a segue. Implement the following exit action on

How to implement tab bar controller with navigation controller in right way

爱⌒轻易说出口 提交于 2019-11-26 15:09:11
I am using Storyboard and Xcode 6. I have next controllers and scenes in my Storyboard: UINavigationController that has HomeViewController as a root. HomeViewController has a button that Show (e.g. Push) UITabBarController . UITabBarController has 4 UIViewControllers . But my problem that after I Show UITabBarController there are no Navigation Bars in 4 UIViewControllers . But I supposed that if I Show (e.g. Push) UITabBarController then it should has embedded navigation controller that is initial controller in storyboard. Am I right? And if so how can I setup then navigation bar in Storyboard

When to use Storyboard and when to use XIBs

ⅰ亾dé卋堺 提交于 2019-11-26 14:48:12
Are there any guidelines on when to use storyboards in an iOS project and when to use XIBs? what are the pros and cons of each and what situations do they each suit? Near as I can tell it's not that clean to use storyboard segues when you have view controllers being pushed by dynamic UI elements (Like map pins). henning77 I have used XIBs extensively and completed two projects using Storyboards. My learnings are: Storyboards are nice for apps with a small to medium number of screens and relatively straightforward navigation between views. If you have lots of views and lots of cross-navigation

How to Implement Custom Table View Section Headers and Footers with Storyboard

天大地大妈咪最大 提交于 2019-11-26 13:58:15
Without using a storyboard we could simply drag a UIView onto the canvas, lay it out and then set it in the tableView:viewForHeaderInSection or tableView:viewForFooterInSection delegate methods. How do we accomplish this with a StoryBoard where we cannot drag a UIView onto the canvas I know this question was for iOS 5, but for the benefit of future readers, note that effective iOS 6 we can now use dequeueReusableHeaderFooterViewWithIdentifier instead of dequeueReusableCellWithIdentifier . So in viewDidLoad , call either registerNib:forHeaderFooterViewReuseIdentifier: or registerClass

Dynamic height for static table cells with wrapping labels?

时光毁灭记忆、已成空白 提交于 2019-11-26 13:54:21
问题 My text is two lines long in portrait mode. When I switch to landscape mode, it fits into a single line. I'm using static tableview cells via a storyboard; how can I resize the row to fit snugly? The screen is a signin screen. The first cell contains some explanation text The second is a text field for entering the account name The third is a secure text field for entering the password The fourth (and last) cell contains the signin button. The return key on the keyboard submits the form or

Storyboard View Elements Greyed Out

淺唱寂寞╮ 提交于 2019-11-26 12:26:54
问题 I\'m currently trying to edit a storyboard file, in Xcode 6 (not sure if this is an Xcode bug, or if i\'ve just done something), and when I go to the view i want to edit this is what the scene shows me : Is this something I\'ve enabled accidentally? or if it\'s an Xcode problem. It first did this after I enabled source control for the project. Anyone have an idea on how to fix? 回答1: The problem is probably related to Size Classes. If you have the option enabled make sure that the views were