segue

prepareForSegue not setting UILabel

会有一股神秘感。 提交于 2019-12-13 18:25:30
问题 I have a prepareForSegue method setup in that sends everything I want to the destinationViewController except the value for a UILabel on the destinationVC . I threw a NSLog statement in to see what value it prints and it prints what I want. It doesn't crash, but it doesn't set. I know I'm missing something very basic here, but it's not jumping out at me. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(UIButton *)sender { if ([[segue identifier] isEqualToString:@"directionsSegue"])

How do I segue to one UIViewController from multiple UIViewControllers embedded in different UINavigationControllers

北战南征 提交于 2019-12-13 17:17:37
问题 In my weightlifting app, I have a view controller that I want to use for a couple of different purposes. One is to select a lift type that will be saved as the user's default. The other is to select a lift type that will be used to filter a log of the user's lifts by lift type. One of the paths (choosing a default) starts at a Settings screen. When you tap the UITableViewCell to go to the Select a Lift screen, the view slides in from right to left as expected, however , it immediately slides

I managed to segue to a blank view controller. How do I segue back?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 17:14:17
问题 // // ViewController.swift // FunFacts // // Created by Alex Macleod on 4/10/14. // Copyright (c) 2014 Alex Macleod. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var funFactLabel: UILabel! @IBOutlet weak var funFactButton: UIButton! @IBOutlet weak var swipeView: UIView! // let swipeRec = UISwipeGestureRecognizer() let factBook = FactBook() let colorWheel = ColorWheel() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup

Restore view state without animating segue

落花浮王杯 提交于 2019-12-13 15:26:54
问题 I have added state restoration to my app, and it seems to work fine, however I'm not happy with the way that it functions. Basically, the app is a Disney wait time tracker, so it has a selection of the four parks when you first open the app. Tapping on one of these parks segues (with the slide up animation) to the main section of the app. The problem is - When the app is reopened and the view restores after a few seconds, the slide up segue is performed (which is quite distracting). Anyone

Application tried to present modally an active controller ios

瘦欲@ 提交于 2019-12-13 13:12:47
问题 I was trying to set the ViewController with a parent view controller before it shows show that it can provide call backs, I done this using PrepareForSegue - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"newQuarter"]) { [segue.destinationViewController setParentViewController:self]; } } It crashed giving me the error message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to

Passing data from CollectionView to DetailVC in Swift 4

柔情痞子 提交于 2019-12-13 10:45:15
问题 My CollectionView should pass a class model to DetailViewController , but when I tap on a cell I get the nil error. Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value The CollectionViewController is embedded programmatically on a TabBarController . Collection View func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return soundArray.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt

iOS - “UIViewController from storyboard ”Main", but didn't get a UITableView

喜你入骨 提交于 2019-12-13 09:36:06
问题 I have an UIViewController which has UITableView in it. Everything works fine. In "didSelectRowAtIndexPath" methos I want to activate a "show" segue to UIViewController. I set it in Storyboard, created its ViewController class etc. When I choose the cell, I get an error saying: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] instantiated view controller with identifier "UIViewController-ndM-tm-7SM" from storyboard

How to present several UIViewControllers at once making visible only the last one?

孤者浪人 提交于 2019-12-13 08:04:15
问题 This is what I need to do: Suppose I am at view "A", I want to show view "C" but "C" must be presented from "B". That is A->B->C (no problem here) What's the issue? I don't want UIVIewController B to be visible at any time in this sequence. 回答1: self.view.hidden ? Eg In "B": override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) if someFlag == true { self.view.hidden = true } } 回答2: My last guess would be to hide B with transparency, using some property like view.layer

Decide Appearance Screen iOS

不羁的心 提交于 2019-12-13 07:45:20
问题 please refer image below : I want to start app 'directly' on "VIEW 1" screen or "VIEW 2" screen, without visual appearance of "START" screen which decide VIEW screen to display. Eg. in loadView() of STARTviewcontroller.m if (some condition) { call "VIEW 1" screen } else { call "VIEW 2" screen } Is this best way to do it ? what should i use segue / [self presentViewController: ...] ?? 回答1: Do one thing. Set " View1 " controller as initial view controller in your storyboard. Now And in your

Previous segue repeats on time on different button

拟墨画扇 提交于 2019-12-13 07:25:37
问题 I'll try to explain you my problem at my best.I'm trying to build a kind of schedule using a circular animation. I have 2 views: the first one contains 6 buttons with the titles from MONDAY to SATURDAY. When the user clicks on a button it will present modally the second view, which contains only one button with no title; this second view will take the backgroundColor and the title of the button from the previous VC: ScheduleDaysViewController. In the second view ,if the user clicks on the