uistoryboard

segue transition with condition storyboard

a 夏天 提交于 2019-12-01 01:57:09
I am new to storyboard and xcode (using 4.4) I would like to implement a login condition, that if accomplished - the segue would work. Otherwise, the user should stay on the same view. I created 2 UIView: ViewController and Bar Controller. I also created a segue from ViewController to Bar Controller and set its identifier to loginSegue as modal. In LoginViewController.m I added the following: - (IBAction)login:(id)sender { self.email = self.emailText.text; self.password = self.passwordText.text; if ([self.email isEqualToString:@"O"] && [self.password isEqualToString:@"O"]) [self

Some sort of “global” for IBDesignables?

烈酒焚心 提交于 2019-12-01 01:41:44
问题 In storyboard have a UIView, with a constraint for example "0.1" proportional height. Imagine you have a similar constraint "0.1", on views in many different scenes. Say you want to change the value 0.1 to 0.975. You have to change it individually everywhere. Is there some way to make a sort of "global value" , using @IBInspectable and/or constraints? So that you can change them all at once , and see the results all at once in storyboard . (Of course, at run-time you could propagate these in

How to make textFields stay in place when keyboard moves up? Swift

Deadly 提交于 2019-12-01 01:31:22
I have created a form with 4 fields and one button. The view hierarchy looks like this: Main UIVIew, View (renamed contentView), on top of contentView I have 4 fields and 1 programmatically created button. When viewDidLoad is triggered, the button is not scrolled up so it can be visible in contentView. When starting to type in textFields, the textFields are scrolled up, outside of the viewable area. When firstResponder resigns (keyboard hidden) I cannot scroll the contentView. I will list the pictures screenshots in the order specified above. Prior to this attempt, I pined the button on the

Xcode 4.5 storyboard crashing

╄→гoц情女王★ 提交于 2019-12-01 01:11:12
Very often when I try to edit UILabels in storyboard, Xcode is crashing. Any ideas what could be causing this? It looks like it has something to do with one of the autolayout constraints. Here's the error report: Process: Xcode [43938] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 4.5 (1839) Build Info: IDEApplication-1839000000000000~3 App Item ID: 497799835 App External ID: 10747437 Code Type: X86-64 (Native) Parent Process: launchd [43283] Date/Time: 2012-10-01 09:43:36.443 -0400 OS Version: Mac OS X 10.7.4 (11E53) Report Version: 9 Sleep/Wake

OS X storyboard: how to show a window programmatically?

邮差的信 提交于 2019-11-30 21:34:42
I am creating an OS X status bar application. I am trying to achieve the following: app starts invisible, with menu bar item click on menu bar item shows the main window on deactivate, the window is hidden So I am trying to programmatically show the main window when the menu item is clicked, but with no success. My main window has "Hide on deactivate" checked. Once hidden, I cannot make it visible again using code. Here is the code I have for now, but it doesn't work: @IBAction func menuClick(sender: AnyObject) { var mainWindow = NSStoryboard(name: "Main", bundle: nil)?

UIStoryboard how to replace constraints programmatically?

北慕城南 提交于 2019-11-30 21:27:50
I have a view controller laid out in a storyboard with autolayout enabled and am looking for a way to change constraints to allow for my view to rotate into landscape and rearrange buttons on the screen. When I try the code below, I get about two dozen "unable to satisfy constraints, breaking constraint..." messages that I cannot really decode. Is there a way to dynamically replace constraints from a storyboard with constraints that I specify programmatically? I want to completely override the layout of the buttons that I defined in a storyboard. -(void)updateViewConstraints { [super

Display ABPeoplePickerNavigationController using storyboard segue

北城余情 提交于 2019-11-30 20:16:12
I have a new project where I want to display a People Picker, when a button is touched. So I have a UIButton that segues to a generic UIViewController with the identifier showContacts . I set the class of this ViewController to ABPeoplePickerNavigationController . Now in my root ViewController I have this code to initialize my picker: #pragma mark - Segues -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if([segue.identifier isEqualToString:@"showContacts"]){ ABPeoplePickerNavigationController *ppnc = segue.destinationViewController; ppnc.peoplePickerDelegate = self; ppnc

UIStoryboard Couldn't find view controller with identifier

自作多情 提交于 2019-11-30 19:30:25
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 crashes: ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (

XCode custom segue class stuck

你说的曾经没有我的故事 提交于 2019-11-30 18:18:11
this question might seem a little weird, but I can't wrap my head around why this is happening. What I did was I renamed a custom segue class, and reflected it in the storyboard under 'custom class', but it still tries to call the old one. I have cleaned the build folder and searched the project for the old custom class name and it does not find anything in xcode at least. I look inside the storyboard file, it's not there either. Even if I delete the custom segue all toghether I get: 'Could not find a segue class named 'xxxxxxxxx'' The thing is I cannot understand from where it gets 'xxxxxxxxx

How to share one storyboard scene between multiple UIViewControllers

女生的网名这么多〃 提交于 2019-11-30 16:47:03
问题 I'm completely re-formulating this question having learned that I was originally off track but that having me no closer to solving the problem. With reference to this image... I am wanting to either create or manipulate the segue (highlighted in yellow) in code such that the Master view is any one of a number of subclasses of MFMasterViewController (highlighted in red). When doing this using Nibs I could create a Nib, SharedNib.xib & set the class as MFMasterViewController , then create my