segue

Swift 4 func prepare(for segue: UIStoryboardSegue, sender: Any?) not updating Int variable with indexPath.row

半世苍凉 提交于 2019-12-11 17:49:46
问题 all! I'm trying to combine previous lessons with the Audio Player, but I'm running into an issue. I have a variable activeSong which is equal to indexPath.row using the method func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) . What happens is that when I print indexPath.row its value is different form activeSong. Any idea why this might be happening. I think I'm doing something wrong with the func prepare(for segue: UIStoryboardSegue, sender: Any?) method. Thanks!

CustomCell label in ViewController not displaying data

Deadly 提交于 2019-12-11 15:39:11
问题 Good afternoon, I'm running a query in Firebase and the info i get back i use it to run another query. The issue i'm having is displaying the data on the second CustomCell. I'm using the print statement and data is showing in the console. Segues are working as expected, TableViews are setup as datasource and delegate, IBOutlets are in place, Cell identifiers in Storyboard are in place too. i cannot find a solution for it, i'm not sure what i'm missing. Any help is greatly appreciated. Cell

Swift 5 iOS13 - Segue to another Storyboard or unconnected View Controller without creating Card View

二次信任 提交于 2019-12-11 15:19:55
问题 keyWindow is also deprecated in iOS 13 thus making me find another solution for this problem. With the current updates with Swift 5.1, iOS 13, and Xcode 11 the code below when used creates the "card view" so users can easily swipe down and return to the previous view. Yet, the problem is that if a user logs in or logs out when using the code below the user can return to the login screen or main app after logging out which is problematic. What is the best way to segue users between storyboards

Trouble with segue between ViewControllers

二次信任 提交于 2019-12-11 14:36:54
问题 This is my code: import UIKit import CoreData class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() var logo = UIImage(named: "no_pain_no_gain-_.jpg") logoImage.image = logo viewExercisesButton.frame = CGRectMake(-30,250,125,125) viewExercisesButton.addTarget(self, action: "viewExercisesButtonTouch:", forControlEvents: UIControlEvents.TouchDown) viewExercisesButton.setImage(imageViewExercises, forState: .Normal) viewExercisesButton.imageEdgeInsets =

Transition to UITabBarController

不打扰是莪最后的温柔 提交于 2019-12-11 14:32:25
问题 I need help with bug fix. I'm use segue to transit between ViewControllers. I have UITabBarController with one UIViewController . When I click on button in my vc I move to second vc. My second vc doesn't have TabBar. (use segue). In my second vc I have button and UIAlertController . When I click on button or alert I must transit to first vc with TabBar, but my TabBar doesn't displayed. How to fix this ? I don't need to use NavigationController . let alert = UIAlertController(title:

I segue from two viewControllers to one viewController. How to unwind segue to the caller?

此生再无相见时 提交于 2019-12-11 13:14:10
问题 Screenshot above is 2 segue; from (view1 or view2) to view3 When creating the unwind segue, how do I get it to call the right @IBAction method? // code in view1.swift @IBAction func backview1(segue: UIStoryboardSegue) { } // code in view2.swift @IBAction func backview2(segue: UIStoryboardSegue) { } Should I add code in view3.swift? How do I code the back segue method in view3.swift in order to go back to origin view? 回答1: To create a segue you can do it by CTRL clicking on an UI element, for

Unwind Segue - Where to Drag Exit?

半世苍凉 提交于 2019-12-11 11:34:23
问题 I am trying to understand how the unwind segue works. First I created 3 ViewControllers. GlobalVC -LoginVC -RegisterVC I set the initial page the GlobalVC (only authenticated user can see). I set a segue from: GlobalVC to LoginVC called globalToLogin and LoginVC to RegisterVC called loginToRegister . Here is my storyboard: For the registerToLogin direction, I used this work-around (in RegisterVC), but looks a bit ugly. @IBAction func unwindToLogin(sender: AnyObject) { //Dismiss View

How can I dismiss unwanted pages of my two pages consisting interface controller after pushing a new interface over it? On Watchkit

好久不见. 提交于 2019-12-11 11:09:06
问题 I was trying to push an interface after clicking at one button of my two pages consisting rootController and got a weird result. My requested controller (second image) gets pushed over my first page..but, the second page of my root controller is still there and I can segue into it. I don't want this. How can I dismiss all other pages of my several pages controller after pushing a new interface over it?. Modal is not an option as I want to go deeper after pushing this controller. 回答1: WatchKit

Segue from tableview to view preceded by navigation controller

不打扰是莪最后的温柔 提交于 2019-12-11 10:18:23
问题 In my project I have a Slide Menu with 3 options in a TableView. Depending of the selected option I want to segue to the ViewController1,ViewController2 or ViewController3 all them preceded by a navigation controller. Currently I'm using a segue in the Storyboard from the Prototype Cell to the ViewController1 with "segueid" as identifier, so all the options segue to ViewController1. That's the code in the file.swift to prepare the segue: override func prepareForSegue(segue: UIStoryboardSegue,

How to use navigationController to show up a WebView when I choose one cell from the tableView?

回眸只為那壹抹淺笑 提交于 2019-12-11 09:58:36
问题 When we choose one cell from the tableView , we use the didSelectRowAtIndexPath method to implement the specific operation. Then how to jump to another view like webView via the navigationController ? I want to use the prepareForSegue to handle this issue like below, and I just know how to pass data from one viewController to another viewController . override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){ var channelC:ChannelController=segue.destinationViewController as