FAQ Database Discussion Community


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) {...

Segue must be modal with page navigation

storyboard,segue,watchkit,uistoryboardsegue,apple-watch
I'm developing an app for Apple Watch that there is a scene with a table. When I select a row it pushes another scene perfectly. However when I added another scene and created the relationship of next scene with the first one the rows stopped working.I had to change the...

How do I set the size of UITableView as a subview in a Container View with Auto-layout

ios,uitableview,uiview,autolayout,uistoryboardsegue
I currently have a UIViewController which contains a menu bar and container UIView. On main view load the container has an embed segue with a separate main content UIViewController. When I click a button in the menu bar I have a custom segue set up to load a UITableViewController into...

Segues vs. UIViewControllerAnimatedTransitioning

ios,ios8,uistoryboardsegue,uiviewanimationtransition
While searching how to perform custom animations when transitioning from one controller to another I found some info about UIViewControllerAnimatedTransitioning. So the question is: why do we even need this if we have custom segues? Are they interchangeable or not? If yes, why does Apple provide two ways of doing...

segueForUnwindingToViewController causing “Warning: Attempt to present <…> on <…> which is already presenting <…>”

ios,swift,segue,uistoryboardsegue,unwind-segue
I am building an app and recently discovered a huge memory leak caused by traditional segues. Therefore I learned about unwind segue. Everything works just fine if I simply use: @IBAction func prepareForUnwindToMainFromFriends(segue: UIStoryboardSegue) { } Memory leak is solved and 'everything is awesome'. But this solution looks ugly on...

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 to use SWRevealVC with didSelectRowAtIndexPath and prepareForSegue?

ios,uitableview,uistoryboardsegue,didselectrowatindexpath,swrevealviewcontroller
I have a problem with using SWRevealViewController. How to call prepare for segue in didSelectRowAtIndexPath? It is necessary because in tableView I have name of categories and some of this categories have its own subcategories. For example my list: - category1 - category2 + category3 - category4 So, when I...

How to dismiss segue ios8

objective-c,ios8,uistoryboardsegue
I am not much familiar with segue. I have used it for very first time. [self performSegueWithIdentifier:@"LoginSegue" sender:nil]; - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { id destinationViewController = segue.destinationViewController; if ([destinationViewController isKindOfClass:[MFSideMenuContainerViewController class]]) { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:Main bundle:[NSBundle mainBundle]]; UINavigationController *navigationController = [storyboard...

Unbalanced calls to begin/end appearance transitions with custom segue

ios,swift,uistoryboardsegue
In implementing the following cross-dissolve custom segue on a button press (learned at https://www.youtube.com/watch?v=xq9ZVsLNcWw): override func perform() { var src:UIViewController = self.sourceViewController as! UIViewController var dstn:UIViewController = self.destinationViewController as! UIViewController src.view.addSubview(dstn.view) dstn.view.alpha = 0 UIView.animateWithDuration(0.75 , delay: 0.1, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { () -> Void in dstn.view.alpha = 1 })...

Xcode pass data from a viewcontroller to another viewcontroller in a different storyboard

ios,objective-c,xcode,uiviewcontroller,uistoryboardsegue
I have two storyboards that contain one view controller each. storyboard1 --------> viewcontrollerA storyboard2 --------> viewcontrollerB How do I pass a string from viewcontrollerA to viewcontrollerB? Example: [email protected]"The transfer of data worked!"; So far, I know how to transfer views, but I don't know how to transfer data. This is...

Image and text field boarders doesn't load fast

ios,swift,storyboard,segue,uistoryboardsegue
I have a problem with a view controller that contains a login form and an image (UIImageView) created using a storyboard. I have created a segue that transition from view 1 (initial View) to login screen. View 1 is the initial View Controller on viewDidAppear() of view 1 I have...

Passing data between several view controllers [duplicate]

ios,objective-c,uiviewcontroller,singleton,uistoryboardsegue
This question already has an answer here: Passing Data between View Controllers 29 answers I've created 7 view controllers and I've got several textfields in each one. I need to collect data from all view controllers and make API request in the last one. Whats the best pattern of...

unwind inside containerViewController has no animation

ios,uistoryboardsegue,uianimation,uicontainerview,unwind-segue
I have a containerViewController with a navigationViewController inside. In viewController_1 in the navigation, I call viewController_2 with segue: [self performSegueWithIdentifier:@"VIPColorSegue" sender:nil]; viewController_2 is pushed with animation. When I want to go back to viewController_1, no animation appears, and viewController_2 disappears with no transition. I tried: [self.navigationController popToRootViewControllerAnimated:YES]; and also unwinding...

SWIFT pass value to another existed ViewController

ios,uitableview,swift,uiviewcontroller,uistoryboardsegue
I have 2 ViewControllers. First one connected with second with 'Show'. When I click 'Add' button on the first - second will appear. Then I need to click on the cell in tableView (in the 2nd VC) and pass it's value to the label of the first VC and segue...

Dismis showDetailViewController swift

swift,ios8,segue,uistoryboardsegue
I am using the showDetailViewController to show a webview, but i am having problems to close it. how can i close it? this is how i am calling it override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { var link = (feeds.objectAtIndex(indexPath.row).objectForKey("link") as String) link = trataLink(link) let navegador = UIStoryboard(name:...

programaticlly load viewController class

ios,swift,segue,uistoryboardsegue
I want to load show (segue to) specific ViewController class when a user click a button. I need to do it only in code without dragging and creating segues in the story board. Say i have root viewController: class ViewController: UIViewController { func startPlayer(sender: AnyObject) { // B.startView() // should...

Push segue from UITableViewCell to ViewController in Swift

ios,iphone,uitableview,swift,uistoryboardsegue
I'm encountering problems with my UITableViewCells. I connected my UITableView to a API to populate my cells. Then I've created a function which grabs the indexPath.row to identify which JSON-object inside the array that should be sent to the RestaurantViewController. Link to my Xcode Project for easier debugging and problem-solving...

Redirect a View with Push Notification in AppDelegate

ios,swift,cocoa-touch,push-notification,uistoryboardsegue
My aim is writing a code that when a user gets a push notification, I want that user to be redirected to another view. If the user comes with the push notification and if he has been first viewed the controller (welcome home screen etc. (but not logged in)) var...

Added navigation bar but there is no back button?

ios,uitableview,swift,segue,uistoryboardsegue
I created a table view and from there let say a user pressed a cell it will go to the detailItemView , but the only problem right now is that whenever a user is in detailItemView there is no back button even thought I already embed a navigation Controller Here's...

Swift - How do I segue from ViewController to TabBarController

xcode,swift,uistoryboardsegue
How do I add a ViewController before a TabBarController in Swift? I am using Parse to make a custom login in the ViewController which would lead to the TabBarController... Help would be appreciated!

Swift - Segue to a specific view if conditions met

ios,swift,uiviewcontroller,parse.com,uistoryboardsegue
I have a tab bar with an item that leads to a navigation controller, which has a list of the user's friends. However, while an anonymous user should be able to browse the app, I only want logged in users to be able to view the friend list, since only...

Replace-root-view-controller custom segue with animation?

ios,objective-c,storyboard,segue,uistoryboardsegue
I've got a custom UIStoryboardSegue subclass which just replaces the root view controller with the destination VC. Works exactly as I want it to... however, I'd like to be able to add a transition animation, and I can't find any good examples of how to do that in the context...

Going back to viewController that was already segued to and is already loaded? No nav controller

ios,segue,uistoryboardsegue
How can I go back to a viewController that was already segued from another VC without Nav Controller embed? Meaning I have viewController A which segued to viewController B. I dismissed viewController B and now back at viewController A. How can I go back to the same instance of viewController...

How to connect two view controllers with one button?

ios,objective-c,viewcontroller,uistoryboardsegue
I have one button in main screen. When user clicks "Search" button, I will search that user in database whether he signed in or not. If he already signed in, I will show "Sign Out" screen. If not, I want to show "Sign In" screen. I connected "Search" button and...