uistoryboard

Swift - How to override an init function? (Was a category in Objective-C)

半城伤御伤魂 提交于 2019-12-13 05:16:25
问题 I have an Objective-C category used to customise UIStoryboard's '+ (UIStoryboard *)storyboardWithName:(NSString *)name'. It is used to determine which storyboard file to call when dealing with multiple devices. Now I need to change it to Swift. It seems that I need to create a " Swift Extension ", but am having issues getting it to work. Here is what I have: extension UIStoryboard { convenience init(name: String, storyboardBundleOrNil: NSBundle?) { var storyboard: UIStoryboard? var

Unwind segue not being triggered

白昼怎懂夜的黑 提交于 2019-12-13 04:29:40
问题 I have a storyboard that has a starting view controller that presents other modal view controllers. Say view controller A is the startingViewController, and view controller B is the modally presented view controller. How can I trigger the unwind segue from B back to A, from ViewController A ( not just from a button located on ViewController B)? The button works to perform the unwind segue , but when I try to perform it programmatically using [self performSegueWithIdentifier:@"ReturnToStart"

IOS: Load a View Controller When App is Launched from Browser using url schemes?

烈酒焚心 提交于 2019-12-13 01:26:58
问题 I am new to iPhone developing , My app is based on video conferencing, I have a task where an app should launch from browser using URL schemes. I have done it but problem is when app launched from browser it should load particular view controller. I am using Storyboard. Here is the code which I tried. - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { if (!url) { return NO; } NSString *URLString = [url absoluteString]; [[NSUserDefaults standardUserDefaults]

Several widgets using XCode Storyboard (or “doing it wrong”)?

别来无恙 提交于 2019-12-13 00:38:15
问题 I have started a new Storyboard (iPad) based XCode project that should have a UI basically like this: One screen displays results coming in from the network fullscreen with a navigation bar at the top. The end-user can switch to another screen with nav controller from (1) to a screen that should contain a table listing a few actors + some additional widgets. The networking code already works fine, but I'm having problems interacting with the data. I have created the following UI in XCode: I

Go from third of forth view controller to root view controller swift

寵の児 提交于 2019-12-12 15:40:48
问题 I have 3 view controllers, presented modally, how do I dismiss the view controllers and go directly from the third right back to the first (root) view controller. Basically, when I call dismissViewControllerAnimated from the third I want it to also dismiss the underlying second view controller and return straight to the first view, releasing the others from memory. EDIT Simply, want to go from the third view on the right, back to the first without having to go through and dismiss the middle

Use Prototype Cell From Another View Controller

心不动则不痛 提交于 2019-12-12 10:37:56
问题 I want to use the same table view cell layout in several storyboard scenes. Can I design the prototype cell in one of the scenes and somehow access it (i.e. dequeueReusableCellWithIdentifier) in another table view controller? 回答1: This is not possible, but you can copy the prototype cell from source table view to destination one inside storyboard and you can easily reuse it. 回答2: You can design your prototype cell in a .xib file and import that into multiple UITableViewController subclasses.

Can I use segues with designated initializers of view controllers?

旧街凉风 提交于 2019-12-12 10:32:57
问题 I am new to storyboards and I have set up a segue from a button to a view controller. This view controller is of a custom subclass SFListViewController , which has a designated initializer initWithList: . Using the designated initializer is the only way to correctly initialize the view controller. However, when using segues the designated initializer won't be called (obviously). - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"Show

SplitViewController with a Login View Controller as the root

末鹿安然 提交于 2019-12-12 09:25:40
问题 So I've been researching on how to make a login view controller as the initial view controller instead of the splitview. Some of the answers I've seen would recommend a modal view to be loaded? I'm not sure how that is set up. eg. How to add a login view before a UISplitViewController iPad and How to implement SplitViewController on second level.? So do I add those on the loginviewcontroller class? Or where? Any advice is welcome. Thanks!! 回答1: I've done this by creating two storyboards: one

How to change speed of segue between ViewControllers

╄→尐↘猪︶ㄣ 提交于 2019-12-12 08:57:00
问题 Is it possible to control segue speed? I have checked the documentation but there is no given method by Apple. But I am more looking for ideas to hack in and change lower level code to make segueing in slow motion . 回答1: Below code is of custom segue, and you can set duration of transition in code. - (void)perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.destinationViewController; [UIView transitionFromView:src

Programmatically call storyboard in delegate

被刻印的时光 ゝ 提交于 2019-12-12 07:59:21
问题 I'm trying to programmatically call my storyboard. My storyboard consists of the following: [Navigation Controller] -> [MainMenuView] -> [DetailsView] The "MainMenu" identifier was placed in the [MainMenuView] The problem i'm having is the screen showing blank. What do i need to do? Thanks. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];