uistoryboard

Can I create a WatchKit app without a storyboard (entirely in code)?

蹲街弑〆低调 提交于 2019-11-29 09:15:21
My team is currently working on an iOS application in which we don't use storyboards at all. We create the UI in code instead. So for consistency's sake it would be great if we could create a Watch App target entirely in code. However, both the "Getting started with WatchKit" video and WatchKit Framework Reference mention that you need a storyboard for the Watch App target. Furthermore, in WKInterfaceObject.h the init method is marked as unavailable: - (instancetype)init NS_UNAVAILABLE; So is it really impossible to create a Watch App without using storyboards? If so, what are the reasons

How to Segue Randomly to ViewControllers in Swift? [closed]

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 08:55:40
For my Swift app, I'm trying to make it so that a button will lead to a random page in my Main.storyboard but I'm not sure if such a method exists. Is there a way for me to do this? Here is how you can segue to a random ViewController . For my example, I chose to use a UINavigation Controller and push segues, but you could do this just as easily with other segue types. I created this Storyboard by: Starting with the Single View Application template. Selecting the ViewController in the Storyboard and then Editor->Embed In->Navigation Controller from the Menu. I added 3 more ViewController s and

Xcode 4.2 iOS 5 : Multiple segues from a UITableView

拜拜、爱过 提交于 2019-11-29 08:32:22
问题 I'm starting now with Xcode on 4.2 for iOS5 and there are a few changes and I'm now crossing a problem that I can't figure out a way to solve it. I'm doing an example with a UITablwView that is populated programmatically with 2 Sections, 1st section with only 1 Row, and 2nd Section with 3 Rows. My aim is to select a row from the table, and based on that row, the user will be redirected to different Views. For example: selecting section 0 row 0, app pushes to view 1 - name setting // selecting

Using a storyboard reference to a storyboard in a different project/bundle appears broken

北战南征 提交于 2019-11-29 06:35:39
Now, I have a workspace which have two project inside, one is call "ProjectOne" and the other is "ProjectTwo" as follow: They have a storyboard respectively and now I want to connect two storyboard by pressing the "To Project Two" as follow: but when I click the button, it show "Terminating app due to uncaught exception 'NSInvalidArgumentException', >reason: 'Could not find a storyboard named 'two' in bundle NSBundle 8C6A5FDC9E06/ProjectOne.app> (loaded)'" Is it possible to do that? I seeking the method for a few days but also no idea... You need to use the complete names of the storyboard you

How to know the current storyboard name?

心已入冬 提交于 2019-11-29 05:51:36
I want to know what is the current loaded storyboard,I used the below code but it is still get me the Main storyboard not the current. //This get me the Main storyboard [[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"]; If you are working in a UIViewController class that is instantied or segues through the storyboard the most simple way is : UIStoryboard *storyBoard = self.storyboard; If you are in a UIView class that is in a UIViewController UIResponder *responder = self; while (![responder isKindOfClass:[UIViewController class]]) { responder = [responder

How do I connect a IBOutlet to a UIView?

99封情书 提交于 2019-11-29 05:07:33
I'm trying to switch views after an animation as seen: [UIView beginAnimations: @"Fade Out" context:nil]; [UIView setAnimationDelay:1.0]; [UIView setAnimationDuration:0.25]; splash.alpha = 0.0; [UIView commitAnimations]; [self.view addSubview : view]; At the [self.view addSubview : view]; I have to add a name for the view for it to add, so I made an IBOutlet like so: (on the first view controller's .h file) IBOutlet UIView *main; But when I try to connect the *main UIView to the view on the storyboard, it wont let me... Thanks so much guys. Your point of confusion is between creating UI

how can I make the uiviewcontroller visible only once during first run of the app (e.g. tutorial)?

这一生的挚爱 提交于 2019-11-29 04:04:41
问题 I'm creating an iOS swift app and I want to show tutorial screen when user runs the app for the very first time. Later on, with each run of the app the tutorial should be hidden and another view controller should be visible as a starting point. So far my storyboard looks like this: It contains two screens of tutorial (1st and last) and tab bar (which is a main window of my app). As for now, in storyboard I chose the tab bar to be an initial view controller: And with that approach the tutorial

awakeFromNib, outlets and storyboards: is the documentation wrong?

风格不统一 提交于 2019-11-29 02:58:58
According to the NSObject UIKit Additions Reference , outlet variables should be set by the time awakeFromNib is called (emphasis all mine): The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized. When an object receives an awakeFromNib message, it is guaranteed to have all its outlet and action connections already established. ... Important: Because the order in which objects are instantiated from an archive is not guaranteed, your initialization methods should not

Pros and cons of using storyboards

无人久伴 提交于 2019-11-29 02:52:45
问题 I am planning to learn to develop applications using Story Boards. Can anyone please post some advantages and disadvantages while using StoryBoards? 回答1: When to use Storyboard and when to use XIBs What are the benefits of using Storyboards instead of xib files in iOS programming? iphone-sdk-development I think these links are helpful and related to your question. Personally, I believe storyboards are better then nibs because they eliminate the need to code your transitions between views

UItabbar item not showing storyboard reference

怎甘沉沦 提交于 2019-11-29 01:39:01
问题 I'm trying to use the new storyboard references in a tabbar. When I use the storyboard reference, the UITabBarItem (with customized image & text set), isn't showing anything. See setup: storyboard setup tabbaritem setup I fixed it for now by setting the images & title in the initWithCoder function for the initial viewcontroller in the referenced storyboards like so: static NSString *const ContactsViewControllerTabContactImageName = @"tab-contact"; static NSString *const