uistoryboard

Present View Controller in Storyboard with a Navigation Controller - Swift

旧城冷巷雨未停 提交于 2019-12-02 15:47:15
I am currently showing a viewController in my new storyboard below: var storyboard : UIStoryboard = UIStoryboard(name: AccountStoryboard, bundle: nil) var vc : WelcomeViewController = storyboard.instantiateViewControllerWithIdentifier("WelcomeID") as WelcomeViewController vc.teststring = "hello" self.presentViewController(vc, animated: true, completion: nil) However, this presents the viewcontroller without its embedded navigation controller. I tried changing "WelcomeID" to the navigation controller within the storyboard - however to no success. I got this working in Objective -C, however don

How to use Storyboard to lay out screen content that is taller than the screen on Xcode 7.2? [duplicate]

你说的曾经没有我的故事 提交于 2019-12-02 14:46:30
问题 This question already has answers here : How to add objects to a UIScrollView that extend beyond UIView from Storyboard? (3 answers) Closed 3 years ago . I use swift 2.0 for programming and I'm confused with adding more objects on view controller. For example, I need 14 buttons on my view controller with required constraints. But I'm able to add only 7 buttons one by one in my view controller on story board. Because no more place to add objects on view controller. So, How to add number of

How to embed a custom view xib in a storyboard scene?

泪湿孤枕 提交于 2019-12-02 14:03:20
I'm relatively new in the XCode/iOS world; I've done some decent sized storyboard based apps, but I didn't ever cut me teeth on the whole nib/xib thing. I want to use the same tools for scenes to design/layout a reusable view/control. So I created my first ever xib for my view subclass and painted it up: I have my outlets connected and constraints setup, just like I'm used to doing in the storyboard. I set the class of my File Owner to that of my custom UIView subclass. So I assume I can instantiate this view subclass with some API, and it will configured/connected as shown. Now back in my

Add space from the top for navigation title

别来无恙 提交于 2019-12-02 13:30:15
Want to give additional space from the top for navigation title shopping list. How can I do it? Dont see a option to do it in the properties of navigation item in the story board. Its close to the date, battery icon in the top of the app. Attached the screenshot. Tried the below code its not working using swift2 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. navigationController?.navigationBar.setTitleVerticalPositionAdjustment(15,forBarMetrics: UIBarMetrics.Default) // set any number you want between -20 to 15 } Try

How to change dynamically color used in UIStoryboard

隐身守侯 提交于 2019-12-02 12:29:25
问题 I wonder if it's possible to assign a "dynamic" color in storyboard. Since iOS7 you can use a tintColor and change it programmatically via the tintColor of the keyWindow. But I can't find a way to affect this tintColor to a button background for example. Which could allow me to easily have a way to theme my application. I thought of a crazy hack by using a category on UIColor and overloading the initializer to swap a specific color and use this color when ever I want a "dynamic color". Any

Update storyboard constraint using code

女生的网名这么多〃 提交于 2019-12-02 10:33:10
问题 I have a UIImage in code that I would like to enlarge vertically when a button is pressed. The UIImage is fully constrained in the storyboard and I would like to change its height when the button is pressed. I have linked the UIImage and its height constraint in the code: @IBOutlet weak var botBotCons: NSLayoutConstraint! @IBOutlet weak var botBot: UIImageView! Then @IBAction func testButton(sender: UIBarButtonItem) { println("testButton pressed") self.botBotCons.constant = 68 //or +=62 as

Why aren't my custom classes appearing in the dropdown in Interface Builder?

陌路散爱 提交于 2019-12-02 09:48:07
I am using Interface Builder and Storyboards to build my app. I am trying to connect my source code to my UIViewController in Storyboard, but none of my classes show up in the Custom Class dropdown menu. This is occurring in Xcode 11 beta 2 and Xcode 11 beta 4. I've tried some solutions in this Stack Overflow answer , but they are not working. I've already done all of the following: Relaunched Xcode Deleted derived data Reinstalled Xcode Tried a different Storyboard Recreated the UIViewController file Made a new project (the problem even occurred there) Typing the UIViewController name into

Why not just set initial view controller for login screen like this?

丶灬走出姿态 提交于 2019-12-02 09:00:58
I've already read this and this questions. But I didn't understand why the code below is not enough. This just works. Do I need an else statement to set rootViewController for LoginViewController ? Isn't it already set by Storyboard? func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { if Settings.loggedIn { let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) let mainViewController = mainStoryboard.instantiateViewControllerWithIdentifier("MainViewController") self.window?.rootViewController =

Can a viewcontroller access the identifier of an incoming segue?

梦想的初衷 提交于 2019-12-02 08:59:20
Can a viewcontroller access the identifier of the segue that was used to transition to it? For example, I transition from viewcontroller A to viewcontroller B using a segue with the identifier "mySegue". Is there anyway for viewcontroller B to get the segue's identifier? I don't believe there is such a property. This kind of thing should be handled via the calling VC's prepareForSegue:sender method (as said in the comments) and then assigning a custom property to denote where it came from, etc. 来源: https://stackoverflow.com/questions/10629399/can-a-viewcontroller-access-the-identifier-of-an

iOS - UIButton on UIPageControl not working

[亡魂溺海] 提交于 2019-12-02 08:38:18
I am using UIPageControl as indicator between different page (view controllers) of my application. In each of the view controllers, I need to have a different button on the left corner on the UIPageControl. If I place a UIButton at that position on each of the view controllers, I see it on the UIPageControl but the buttons do not respond to the touch event. Is there something I am missing? Or is there an alternative to do this? Thanks. I guess the page control and the view controller view are both subviews of the same view. In this case, the button is drawn outside of the view controllers view