uistoryboard

UIStoryboard Couldn't find view controller with identifier

南楼画角 提交于 2019-11-29 19:14:10
问题 I have an ios application using storyboards with a bunch of view controllers. After Adding a new ViewController, and configured the identify (Storyboard ID) I try to instantiate the new ViewController with the following code: SurveyNewViewController *newSurvey = [[self storyboard] instantiateViewControllerWithIdentifier:@"newSurveyView"]; [self presentViewController:newSurvey animated:YES completion:nil]; Everything seems to be right, but when running the application on the simulator it

Multiple views in Xcode storyboard view controller, one of them won't appear in storyboard editor

做~自己de王妃 提交于 2019-11-29 17:13:07
问题 I'm having trouble updating a project someone else created in Xcode. This is an app built in storyboard and in one case, there is a scene with a view controller that has multiple views underneath it in the document outline palette of the storyboard editor (shown in included image). The first view is the one that becomes highlighted in the storyboard editor when it is clicked on, and as you change the design or the objects in the view that view is updated. There is a second view (the one

Get reference to NSLayoutConstraint using Identifier set in storyboard

早过忘川 提交于 2019-11-29 17:09:49
问题 I was setting the constraints of a button using a storyboard. I saw an option, "Identifier" in the constraint's properties. I want to make a reference to this constraint, to change its value in code, to move an object. How can I get a reference to this NSLayoutContraint from this Identifier. I read the documentation, it was written like this @interface NSLayoutConstraint (NSIdentifier) /* For ease in debugging, name a constraint by setting its identifier, which will be printed in the

iOS: Best practices for a “one-way” navigation controller?

我是研究僧i 提交于 2019-11-29 16:00:18
I'm developing an app which is essentially a sequence of many different tests (for simplicity, think about an SAT test or a Mensa test). Each test is implemented in a different View+View Controller. Initially I wanted to use Storyboards and UINavigationControllers for managing the sequence of the tests and the transitions between them, but now I'm questioning the validity of this approach. A UINavigationController is a stack while my navigation is one-way only (once you've completed a test you can't go back). Is there a better way to implement the app? Can I still leverage Storyboards somehow?

load view form StoryBoard that does not have a Segue

☆樱花仙子☆ 提交于 2019-11-29 12:41:07
问题 I am really liking having all of my view's laid out in the Storyboard but there are times when I will have a view that is shown based on a button that is generated by code so there will be no Segue reference - it will be totally disconnected in the Storyboard. I would still like to design it in the storyboard though so I can have a nice overview of all my screens. Is it possible for me to load the XIB (or whatever it is in a storyboard) designed in the storyboard when a UIViewControler is

Swift TableViewCell xib doesn't have constraints

拜拜、爱过 提交于 2019-11-29 12:06:15
I have two TableView s, when I designed the original I designed it using the prototype cell in the storyboard, to make it reusable I tried to pull it out into a .xib and load that instead. When it is loaded from cellID.xib however it loses all the constraints at runtime, and everything is layered on top of each other. TableViewController let cellIdentifier = "cellID" override func viewDidLoad() { super.viewDidLoad() tableView.register(UINib(nibName: cellIdentifier, bundle: nil), forCellReuseIdentifier: cellIdentifier) tableView.rowHeight = UITableViewAutomaticDimension tableView

Corner radius not showing on button in storyboard with @IBDesigable/@IBInspectable

那年仲夏 提交于 2019-11-29 11:35:46
I have this custom class for a button. import UIKit @IBDesignable class CustomButton: UIButton { @IBInspectable var cornerRadiusValue: CGFloat = 10.0 { didSet { setUpView() } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.layer.cornerRadius = 10.0 } override func awakeFromNib() { setUpView() } override func prepareForInterfaceBuilder() { super.prepareForInterfaceBuilder() setUpView() } func setUpView() { self.layer.cornerRadius = 10.0 } } But the corner radius is not showing on the button in the storyboard. I understand @IBInspectable just allows you to change the

How do I set selected tab in UITabBarController using StoryBoard?

*爱你&永不变心* 提交于 2019-11-29 11:03:22
问题 How can I switch to some tab in UITabBarController using StoryBoard? I have tried the code below but without success (the tab is not selected): self.tabBar.selectedIndex = 3; Honestly I used nib files without StoryBoard and this code above worked fine in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions :(NSDictionary *)launchOptions but now I can't set the tab programatically. Maybe there is another problem that is not connected to selecting the tab. How can I

How to incorporate storyboards into a cocos2d 2.0 project?

浪尽此生 提交于 2019-11-29 10:43:11
问题 I have made a project in cocos2d 2.0 and would like to incorporate a main menu using storyboards. I have tried Jerrod Putnam's tutorial here on tinytimgames.com (I can't provide the link because new users are allowed only 2 links per post, but if you google "cocos2d storyboard" it is the first link) but it did not work for me. I followed it exactly (I think). I opened my cocos2d project and imported the files from his github, the CCViewController.m and .h and then created a new storyboard

How within a tab bar controller do I segue from one view controller to another and retain the tab bar?

主宰稳场 提交于 2019-11-29 09:56:55
问题 I have an application with several view controllers controlled from a tab bar controller. From one of these view controllers I want to (on clicking a button) segue to another view controller and retain the tab bar at the bottom of the segued to view. I've used -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.identifier isEqualToString:@"newView"]){ UIViewController *controller =segue.destinationViewController; controller.modalTransitionStyle =