FAQ Database Discussion Community


Preview and Resizing in Xcode 6.3

ios,uistoryboard,preview,xcode6.3
I am using Xcode 6.3, but I am not able get preview and Resizing button. The resizing button should be present at last in the attached image. There is 4 buttons in this panel before xcode 6.3 I am not able to see the last button of the following image:...

click on UIImageView to change ViewController

ios,swift,parse.com,segue,uistoryboard
I have a custom image (profile picture) that I want to click and go to a profile view. I am registering the click, and I have the segue set up in storyboard, but when I click, nothing happens. The profile picture is part of a PFTableViewCell(using parse), which is part...

how to replace/customize back button image in storyboard navigationcontroller

ios,uinavigationcontroller,uistoryboard
I want to replace the text in the back button with a custom image. How can I do that in swift code? I don't want to replace the entire backbarbutton since I'd like to keep the default action behaviour of going back to the last view. I would also like...

UI elements on iPhone 6 Plus don't fill the whole screen horizontally

ios,iphone,uistoryboard,iphone-6-plus
When developing for iPhone 6 Plus (all others devices are unaffected). If you have a UI element that is suppose to fill the screen horizontally from one end to the other, the leading and trailing constraints are usually -16, since the 0 is assumed to be 16 points from the...

Navbar buttons not showing up in PFQueryTableViewController (parse + iOS)

ios,swift,parse.com,uistoryboard
I created a storyboard and added the navbar buttons I want to be displayed But when I simulate my app, this is what I get I have also tried to programatically add the button using navigationItem.setRightBarButtonItem(), but that doesn't show up either. However, when I try the same thing using...

make image view full screen in view controller/page view controller (swift)

ios,swift,uistoryboard,uipageviewcontroller,xcode-storyboard
I am using UIPageViewController to show images full screen. Issue is the images are not showing full screen. Instead there is a gap on the bottom between the image and the page control view dots and on the top. I have a UIViewController which is added to UIPageController as a...

How to set UITabBarController when setting initial view controller in app delegate

ios,xcode,swift,uitabbarcontroller,uistoryboard
I need to programatically set initial view controller (based on user login status). This is my initial code: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let storyboard = UIStoryboard(name: "Main", bundle: nil) let mainRootController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as UIViewController if self.window != nil { let navigationController:UINavigationController = storyboard.instantiateInitialViewController()...

Working with overlapping objects in storyboard

ios,uistoryboard
I'm working on an app where one of the screens will have a partially transparent overlay in some situations. I'm using a Visual Effect View for this. I now simply have this visual effect view on top of the other UI elements in my storyboard, but this means having to...

Find which StoryBoard has been initialised in ViewController? Xcode

ios,iphone,xcode,uiviewcontroller,uistoryboard
So I'm using Xcode to make an app... and instead of using size classes or auto layout to account for various iOS screen sizes, I do a screen height test in the AppDelegate.m and load a specific Storyboard based on what the screen height is returned as; that way, all...

what is the best way to transition from login screen to home screen, UI layout and code [closed]

ios,swift,uistoryboard
A newbie programmer here trying make my own app and I am having a difficult time finding the answer on the best way to switch from your login screen to the apps main view controller. I am using Parse login and sign up view controllers. Sorry for the newbie question,...

Swift: Force show Navigation Bar in Modal

swift,segue,uistoryboard,uistoryboardsegue
I have the following Storyboard Segue in my Swift project: The animation is correct, but there is no navigation bar in the destination view controller. I want to force the destination view controller to have a navigation bar. I tried in the destination view controller: override func viewWillAppear(animated: Bool) {...

XCode 7 error: “A launch storyboard or xib must be provided unless the app requires full screen”

ios,swift,uistoryboard,xcode7
I don't use a storyboard/xib for launch screen and get this error in XCode7 / Swift2.0.

Interface Builder is not letting me delete a button

ios,xcode,interface-builder,uistoryboard
To clarify: I have a view/vc which is designed as an orphaned scene in IB in the storyboard it is used within. This view has a button with an image, a height and width constraint, a left and top constraint. There is a table below it with top, left, bottom,...

Creation of ViewControllers by the storyboard vs. by alloc/init

objective-c,uiviewcontroller,ios8,uinavigationcontroller,uistoryboard
I'm using Xcode 6.3, Objective-C. In my storyboard, I create a UINavigationController. I then create a UIViewController and assign it as the root controller of the UINavigationController. I then create a second UIViewController, and connect it to the first UIViewController with a "manual show" segue. So my storyboard has a...

Share the same UI for two subclasses in Obj-C/Storyboard

objective-c,xcode,uistoryboard
I have a ViewControllerA, and its UI layout is designed in the Interface Builder (storyboard). ViewControllerA has two concrete subclasses, ViewControllerB1 and ViewControllerB2; they have the same UI with its superclass ViewControllerA, but run with different logic. How can I create two different concrete classes but they share the same...

How To Make Last Visited Viewcontroller The RootViewController?

objective-c,uiviewcontroller,nsuserdefaults,uistoryboard,appdelegate
I figured it out. Thanks shim for the info!: UIViewController* vc = (UIViewController*)[[UIStoryboard storyboardWithName:@"iPhone4" bundle:nil] instantiateViewControllerWithIdentifier:@"MyViewControllerIdentifier"]; if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"currentViewController"] isEqualToString:@"iPhone4Level1"]) { [self.window setRootViewController: vc]; } ...

UIBarButtonItem backButtonBackgroundImage: gets stretched

ios,objective-c,uistoryboard,uibarbuttonitem,uiappearance
I am using UIAppearance to set a custom backButtonBackgroundImage as well as hide the back button title: // Back Button Image [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"ZSSBackArrow"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -100) forBarMetrics:UIBarMetricsDefault]; This works really well, but the problem is that my arrow image get really stretched horizontally: It should...

Horizontal Center in Container bug in Storyboard of Xcode 6?

ios,xcode6,autolayout,uistoryboard
I was trying to put two buttons right next to each other, one taking up the left half of the screen, and the other taking up the right half of the screen. I found it perplexing that when I set Horizontal Center In Container for both of them that the...

Re-enable “Update Constraint” option

ios,autolayout,constraints,uistoryboard
I'm working on an app which having AutoLayout enabled. I'm new in it and trying to set out the views based on my experiments. Before when I have made a change in frame of any UI control, in storyboard I could see a yellow pointer (next to my view controller)...

UITableView: how implement only one row different from the others

ios,xcode,uitableview,uistoryboard
in Storyboard (in Xcode 6) i want design a view like this user profile view The rows are dynamic because the content is get from a web services. How can i implement this view? I have tried with an image view (the upper image with user name and pic) with...

How to check existence of the controller in the storyboard before to instantiate it?

ios,objective-c,storyboard,uistoryboard
When working with storoboard through code we can instantiate controllers via identifier, but if the controller with this identifier is not found will be crash. How I can avoid crashes and/or check existence of the controller in advance? Controller instantiate example: UIViewController *controller = [[UIStoryboard storyboardWithName:@"Settings" bundle:nil] instantiateViewControllerWithIdentifier:model.identifier]; [self.navigationController pushViewController:controller...

How to set a max limit for an IBInspectable Int

ios,swift,uistoryboard,ibinspectable
I am using an IBInspectable Int in Swift to choose between 4 four shapes (0-3), however it is possible in the storyboard editor to set a value greater than 3 and less than 0, which stops the IBDesignable system working. Is it possible to set a min and max limit...

Creating an iPhone- and iPad-compatible app with a storyboard

ios,uistoryboard,ios-universal-app
I am trying to create an iPhone and iPad compatible app. Is there any good tutorial and example I can follow? Can I create one view or storyboard for each view and use it for iPhone and iPad? If I use a storyboard, can I do something like this: If...

Add UIViewController from another Storyboard

ios,objective-c,uiviewcontroller,uistoryboard
To get more structure in my project I started to use multiple storyboards. Now I want to push a ViewController from another Storyboard. This works as aspected with no warnings. Unless I open the ViewController for a second time. The push produces this error message: "nested push animation can result...

ios - implementing interface for right handed and for left handed

ios,ios8,uistoryboard
In my app i need separate UI for left-handed users and for right-handed users. The difference is basically that the buttons are on the right side of the screen or the left side of the screen. What is the way to build the UI to support this kind of requirement?...

How can I enforce an UILabel to be wider than it should be, by 5 points?

ios,objective-c,uilabel,uistoryboard,nslayoutconstraint
I have an UILabel, it has background color as green. But It wraps the text very closely. I need the green background to be little wider than the text, approx 5 points. How can I achieve this? Details Label is created in storyboard and has horizontal spacing constraints. You can...

swift - Proper way to place UITextView with button below UITableView

ios,xcode,swift,uistoryboard
I'm very new to Xcode so please excuse my ignorance. I'm creating a view controller that contains a table view, a text view, and a button. The table view rows will contain comments from users. I want to place a text view and button at the bottom of the screen...

Custom header of table view with IB

ios,uitableview,swift,ios8,uistoryboard
I would like to create a custom header for a table view section with interface builder. I cannot use the method titleForHeaderInSection because i need to display two labels. I used this instructions: Customizing Header and Footer of TableView in iOS8 but it does not work. What I have done...

UIStoryboard Show (e.g. push) simple inverse action to go back

ios,segue,uistoryboard,xcode-storyboard,xcode6.1
In storyboard we have great feature that allow us to make Show (e.g. push). So seems the logic is next: If we don't have navigation controller then view controller will use present modal logic. My question is there any inverse action that I can use with Show? I have a...

Instantiate view controller from Storyboard with a descendant class

ios,objective-c,uistoryboard
I have a generic view controller in my Storyboard, let's say it's class set to MyController class. I also have a view controller class (MySubControllerA) which inherits from MyController: @interface MySubControllerA <MyController> ... @end The descendant class is used to overwrite some functions in the parent class. I can instantiate...

UIButton different alignment for title and image

ios,objective-c,uibutton,uistoryboard,title
Hello I am creating UIButton which is displaying image and title at the same time. I want title and image to be both centred, button to be above image. Problem is that because of localisation of string from button, string length is changing, and alignment from UIStoryboard combined with edge...

Is it necessary to create all views in storyboard in the beginning?

ios,swift,uistoryboard
I am new to iOS and have recently finished some classes. Now, I'm onto my first app with Swift. I wanted to know: Is it necessary to define all views/screens in the storyboard right in the beginning, with proper navigation controllers? What is better, define all in the beginning or...

Custom UITableViewController inside Container View

ios,objective-c,uitableview,uistoryboard,uicontainerview
I am trying to insert a custom UITableViewController inside a Container View. The Container View is placed inside a cell of a static UITableView as shown in the figure below. http://i.stack.imgur.com/A762B.png I simply want a method to combine static with dynamic cells in the same screen. In the Identity Inspector...

What is a good approach to pass data through containment view controllers

ios,objective-c,swift,uistoryboard
I am trying to pass instance of object from "initial" view controller to "item1" and "item2". I would like to avoid subclassing UITabBarController as it would make containment view controller know "too much". Is there any good approach to do that using storyboards or code besides subclassing UITabBarController?...

Landing on a “ViewController” on a non-storyboard app on Cocoa

xcode,osx,cocoa,uistoryboard
I am new to cocoa development. When I create a new project on Xcode using storyboards it uses the iOS model, that I like more, of having a viewController and a delegate by those being separate files. Then I start my project using the viewController and adding stuff to its...

How to initialise and create object of UITableViewController?

ios,uitableview,uistoryboard,viewcontroller
I want to create object of UITableViewController and want to pass values from ViewController to UITableViewController. But It gives error like "UITableViewController is not key-value coding-compliant for the key superclass." I tried this but won't help: [[MytableViewController alloc] initWithNibName:[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"MytableViewController_identifier"] bundle:[NSBundle mainBundle]]; ...

Scaling everything up and down for different devices in UIStoryboard

ios,uistoryboard
Is it possible to have the storyboard scale everything up or down depending on the screen size or do I have to do it programmatically? For example the UI on iPhone 6 plus would look exactly like the one on iPhone 5 but just larger.

iOS 8 UITableView Faded out Checkmarks when not selected

ios,uitableview,swift,uistoryboard
Is there anyway to give the Checkmarks an alpha or color for when the UITableViewCell is not selected? By default, iOS just doesn't have a checkmark for when a row is not selected. Changing the color of the checkmark is straightforward, but I'm not sure if iOS supports functionality for...

Display an object programmatically placed behind an object placed by storyboard in Objective-C

ios,objective-c,uistoryboard
How can I display an object that I have programmatically placed behind an object that has been placed on the stroyboard? The default is for objects that are programmatically placed to be on top, but was curious on how to change that.

How should i handle Alamofire response in shouldPerformSegueWithIdentifier?

swift,segue,uistoryboard,uistoryboardsegue,alamofire
I am trying to learn Swift and what i am trying to do is to create simple login page. Whenever user click on login button, i make a request to my web service in shouldPerformSegueWithIdentifier in order to check if username and password is correct. I dont want to use...

How can I create this Switch behavior?

ios,uibutton,uistoryboard,uiswitch
I want to create the following selection button to pick from the two options "Salary" and "Hourly Wage". I have images for when either (left or right) option are selected. What UI element in iOS can I use to create this? Looked into a Switch but did not see an...

Set UIImage height based on a ratio of the width using Autolayout

ios,autolayout,uistoryboard
I am trying to figure out how to set the height of a UIimage on the storyboard based on the width? I need it to be a ratio based on the width. So the image is full width. Currently I am using the universal storyboard and want the image to...

Is this code correctly translated from objective-c to swift?

ios,objective-c,swift,uistoryboard
Hi i am trying to convert this code from Objective-c to Swift. Can anyone please confirm if this is correct or if anything needs changing. - (UIStoryboard *)grabStoryboard { UIStoryboard *storyboard; // detect the height of our screen int height = [UIScreen mainScreen].bounds.size.height; if (height == 480) { storyboard =...

Label on UIButton not laid out correctly with autolayout

ios8,uibutton,autolayout,uikit,uistoryboard
I have an app which I'm updating to auto layout and size classes and I'm getting some weird behaviour with the label on a button. The button should be a circle and have a label in the centre. I'm implementing my own subclass so I can reuse it. Here's the...

Swift add line above to control

ios,swift,uistoryboard
In the below screen, I want to add horizontal line above to "Item" label and after "Add" button (below to the add button, I have dynamic table). UIGraphicsGetCurrentContext() doesn't work here. Can someone help me how to do this? ...

Display both alertTitle and AlertBody on a custom WatchKit notification

xcode,notifications,uistoryboard,watchkit,apple-watch
When I send a local notification to the Apple Watch with both an alertTitle and an alertBody, both fields get displayed on the long look notification. But when I customize this with a Static Notification Controller Interface Scene, the default storyboard in XCode only has one field, which gets populated...

reloadRootControllersWithNames hides title and status bar, watchkit

ios,uistoryboard,watchkit
When trying to user reloadRootControllersWithNames, after my views all load their titles disappear along with the rest of the statusbar. Is there something that specifies showing and hiding the status bar and title in Watchkit? Code: [WKInterfaceController reloadRootControllersWithNames:@[ @"SystolicEntryController", @"DiastolicEntryController" ] contexts:nil]; ...

Xcode Storyboard - Items not appearing

ios,objective-c,xcode,uistoryboard,uisplitviewcontroller
I have aUIView in a Detail Scene in my storyboard and the strangest thing happens. When I try to add a simpleUILabel and then run my app, it does not appear. Soooo weird. Here is a screenshot of my entire split view controller with the detail scene: Here is my...

Set up side drawer controller

ios,objective-c,navigation-drawer,uistoryboard
basically i use MMDrawerviewController for side drawer and my setup for storyboard prototype is like below and my code is as successful login is UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MenuVC *menuViewController = [storyboard instantiateViewControllerWithIdentifier:@"MenuVC"]; UIViewController *centerViewController = [storyboard instantiateViewControllerWithIdentifier:@"VC1"]; MMDrawerController *drawer = [[MMDrawerController alloc] initWithCenterViewController:centerViewController...

Navigate to another view via Storyboard using show - Beginner

ios,objective-c,uistoryboard
It says that Push is deprecated. So i used Show. When the user clicks on the button, they directly navigate to the next view. What i require is to execute some business logic and then based on that result to Navigate to a view. How can i do this ?...

Multiple Storyboards in WatchKit App

swift,uistoryboard,watchkit
Is there any way to use multiple storyboards inside a WatchKit app? From what I can tell, you can only use a single one which makes it difficult when working in a large team. The APIs available on UIStoryboard are as follows: func instantiateInitialViewController() -> AnyObject func instantiateViewControllerWithIdentifier(_ identifier: String)...

Xcode 6.1.1 Storyboard changes layout when I re-open the project

ios8,xcode6,uistoryboard,xcode-storyboard
When I open xcode and create layout everything looks pretty much like it should (meaning that the storyboard view controller looks pretty much like the preview) But when I close out of xcode and re-open it... the view looks like this. This is concerning not just because its difficult to...

Setting the keyWindow rootViewController not working in iOS8

ios,objective-c,ios8,uistoryboard,uiapplication
In my app I need the user to login and logout. When I want the user to logout, I delete their credentials and then: ZSSLogin *login = [self.storyboard instantiateViewControllerWithIdentifier:@"ZSSLogin"]; [[UIApplication sharedApplication].keyWindow setRootViewController:[[UINavigationController alloc] initWithRootViewController:login]]; Which is suppose to replace the current rootViewController (tabBarController) with the login viewController. On iOS7 this...

ios adaptive layout / size classes to target specific phone size?

ios,uistoryboard,adaptive-ui
I've lost what's left of my mind messing with adaptive layout and size classes. Not that I was a genius to begin with, but now I'm bald. Say I have a very simple layout that I want to make sure looks perfect ( and by perfect I mean all my...

Why subviews in UIViewController going with offset using autolayout

ios,uiviewcontroller,autolayout,uistoryboard
Cant understand why in new Xcode there is 16.0f offset from left and right, when i add 0 leading/trailing constraints from subview to controller.view ...

iOS - Wrong size on iPhone 6 simulator

ios,objective-c,xcode,constraints,uistoryboard
I have inserted a UILabel in the UIStoryBoard centered horizontally. But when I run it on iPhone 6 it's not in the center. Why that happening and how I can prevent for facing the same problems on the future? On other simulators like iPhone 5 that is working just fine....

iOS - best architecture for localizing a storyboard Scene/ViewController

ios,objective-c,uiviewcontroller,uistoryboard
I have inherited an existing storyboard which has a viewController called loginScreen. It looks like something similar to this: and this exists in the main.storyboard We have created another target for a new product we are launching. This product is extremely similiar to the inital one i inherited so the...

Storyboards and subclasses

ios,uitableview,uistoryboard
I've been working in iOS for a bit but have mostly worked on a project that never used storyboards. Everything is in code, and I'm not too experienced with Storyboards. I'm trying to understand how to implement a BaseTableViewController and have all my table view controllers subclass that. I want...

TableView Header AutoLayout

ios,uitableview,autolayout,uistoryboard
Trying to get my Table View header to resize dynamically based off of three labels, one of which has dynamic content. Seems quite simple enough, but not having much luck. Any suggestions greatly appreciated! Following this post here, have setup my constraints as such: And my code is quite simple....

Seperation between navigation bar and table view disappear

ios,uitableview,interface-builder,uinavigationbar,uistoryboard
I am creating an app with a navigation bar and a table view. For some reason, the navigation bar lacks its separator between it and the table view. In the Interface builder, it looks like it does have it. However, when I run my app in the simulator (or on...

iOS UIButton title keeps reverting in UITableViewCell

ios,uitableview,uibutton,interface-builder,uistoryboard
I am trying to set up a fairly simple Storyboard/Interface builder app with aUITableViewController, with two prototype cells. The first prototype cell displays information on the main UILabel and the second prototype cell contains aUIButton. I have connected the button'stouchUpInside action to some piece of code where I want to...

UISplitViewController and UINavigationController doesn't work properly with multiple storyboards

ios,uinavigationcontroller,uistoryboard,uisplitviewcontroller
I'm trying (for experiment) to work with multiple storyboards. The first storyboard (starts at startup) contains only one view controller that executes some code and download json data from a website. When finish the download task, the view controller (of first storyboard) set the entry Point of Second storyboard as...

UILabel Line Spacing

ios,objective-c,xcode,swift,uistoryboard
I am trying to set the line spacing in a UILabel as specified by Mike Slutsky here. It works correctly for the text I specify from the Storyboard. When I try to set the UILabel.text in code, it reverts back to the default line spacing. Can someone help me understand...

xcode: can't see in storyboard a navigation item

ios,xcode,uistoryboard
I have added to my tableView with navigationController a bar button with text "Start!". But I can not see it anymore in the storyboard. In my build I can see it: I think this is also the reason for this error log message: pushViewController:animated: called on while an existing transition...

Warning when presenting UIActivityViewController

ios,swift,xcode6,uistoryboard
When i present an UIActivityController using the code below i get, it is presented but the console shows "Warning: Attempt to present <UIActivityViewController: 0x7f8788e7aed0> on <MyApp.CustomTableViewController: 0x7f8788e3db60> which is already presenting (null)". @IBAction func shareImage(sender: AnyObject) { let images: [UIImage] = [image.image!] let activityViewController = UIActivityViewController(activityItems: images, applicationActivities: nil) self.presentViewController(activityViewController,...

Is there a reason for the huge Navigation Controller icons in Storyboard?

ios,xcode,uinavigationcontroller,uistoryboard
I've got six VCs at this point in my app. Is there some reason I also need six huge Navigation Controllers? I've never used them (the NC icons) in my development schemes to this point. Here's what my storyboard looks like: I'd much prefer to have all that wasted real...

How to get a button to stay on the right in a cell for all sizes?

ios,uitableview,swift,interface-builder,uistoryboard
I am trying to add a custom checkbox button (http://codereview.stackexchange.com/questions/69123/ibdesignable-uicheckbox) to my Prototype Table View Cell in my Storyboard. Here is an album ending starting with how it looks on all 3 iPhone sizes and ending with a picture of my Interface Builder: http://imgur.com/d6ejxEL,9NpqcnA,4gdLnMT,g24FYID#0 How would I get the Checkbox...

Swift - Grouped Style tableview design

ios,uitableview,swift,uistoryboard
I am trying to design the grouped style tableview in Xcode 6.3. I don't get rectangle box covering the table like the second image i have attached below. Can you please tell how to build a screen like the second one? ...