segue

Swift - Segue from Button inside a cell

寵の児 提交于 2019-12-04 21:00:53
问题 i have a custom cell attached to TableViewCell class, and i have a button inside that custom cell, i want whey i press the button it segues to another view controller, but the: performSegueWithIdentifier(identifier: String, sender: AnyObject?) function is not recognised, how to fix that ? Edit: 回答1: -performSegueWithIdentifier: method is declared in UIViewController . So you can't just call it in UITableViewCell subclass. You can add an action to that button when you are creating cell in

Hiding a Segue on Login process

倖福魔咒の 提交于 2019-12-04 20:01:32
after finding a good solution about a missing Segue execution thanks to this post I'm clashing against another problem: Following the approach described in the aforementioned post I'm performing the check for my auth token in the Dashboard VC and,if not set,I activate a segue pointing to the LoginVC exploiting the delegate mechanism in order to dismiss the view once the operation is completed. Now,the problem is that on the very first run I got the Dashboard VC show for a moment before the LoginVC gets displayed. I would like to show the Login screen immediately hiding (somehow) the Dashboard

Custom UITableViewCell not calling prepareForSegue

旧时模样 提交于 2019-12-04 18:46:49
问题 I have a custom UITableViewCell, called EventCell . EventCell.h #import <UIKit/UIKit.h> @interface EventCell : UITableViewCell @property (nonatomic, strong) IBOutlet UILabel *titleLabel; @property (nonatomic, strong) IBOutlet UILabel *locationLabel; @property (nonatomic, strong) IBOutlet UILabel *dateLabel; @property (nonatomic, strong) IBOutlet UILabel *typeLabel; @end EventCell.m #import "EventCell.h" @implementation EventCell @synthesize titleLabel, locationLabel, dateLabel, typeLabel; -

How to segue from UIButton to a Tab Bar Item?

偶尔善良 提交于 2019-12-04 18:39:59
I have an app with a tab bar, which contains 5 tabs. I decided to have a "Home screen" instead of opening the app directly in the first tab. My home screen will contain a welcome message AND 5 buttons to segue directly to the wanted tab. Example: the 4th button will go to the 4th tab. After clicking one button, the home screen should never be seen again. The navigation mode will by the tab bar. My Home View Controller 5 buttons and a reference to the Tab Bar Controller, to pass the button clicked. The Tab Bar Controller ( @interface TabBar : UITabBarController <UITabBarControllerDelegate> )

Modal segue needs 2 clicks instead of one

一世执手 提交于 2019-12-04 18:34:25
问题 My UITableView needs 2 clicks to show the detail page of the selected cell : one for selection and another one for show the detail view. I would like one clic to directly show the detail view of the clicked cell. I use a modal segue with this method inside my UITableViewManager.m : - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *indexPath = [playerList indexPathForSelectedRow]; TCPlayerStat *object =

ViewController as Overlay on MapView in Swift (like Google Maps Application User Interface)

一笑奈何 提交于 2019-12-04 17:14:32
I'm building a small app with Swift where I want to achieve following: - MapView with several Annotations - Click on one of the annotations shows some Details in an overlay that is moving in from the bottom and fill approx. half of the screen - The upper half of the display still shows the MapView. A click on the map closes the details Now I've read a lot about different possibilities. First I've tried using a ContainerView with something like this: @IBOutlet weak var detailsContainerYPosition: NSLayoutConstraint! func mapView(mapView: MKMapView!, didSelectAnnotationView view: MKAnnotationView

Perform segue on press on Back button

纵然是瞬间 提交于 2019-12-04 17:10:19
I want to perform segue when I click on Back button. For it I do: override func didMoveToParentViewController(parent: UIViewController?) { self.performSegueWithIdentifier("fromGalleryToBody", sender: self) } but it crashes my app when I tap on Back button. How can I realize it? Default button of navigation gives you functionality to move to the previous view You can check it by : override func didMoveToParentViewController(parent: UIViewController?) { if parent == nil { println("Back Pressed") } } But the situation is didMoveToParentViewController means it already move to the previous view.

Workaround for swift unwinding

十年热恋 提交于 2019-12-04 16:49:06
So in response to this question: Xcode 6 Storyboard Unwind Segue with Swift Not Connecting to Exit I'm having the same problem and tried the fix presented, but it still doesn't work. I get the feeling that I'm missing a step for my header file, is it sufficient to simple add a .h file to my project and add the lines mentioned? Or is there more to it? IndexViewController.h: @interface IndexViewController (Workaround) - (IBAction)blaat: (UIStoryboardSegue *)segue; @end IndexViewController.swift: @objc(IndexViewController) class IndexViewController : UITableViewController { @IBAction func blaat

iOS7 issue with modal view controller segue from custom cell selection

不问归期 提交于 2019-12-04 15:10:41
问题 Final Edit After further investigation I thought it would be best to repost the question with more information on the sepcific issue. This issue seems to occur only on iOS7. I have tested on iOS6 and this works without issue. -- Setup The setup is you have one UIViewController (first VC for example), this holds a tableView and is the datasource/delegate. When the cell in tableView is selected/tapped you perform a segue to the Second View Controller (this can be empty for now). Issue The issue

Swift - Perform Segue from map annotation

二次信任 提交于 2019-12-04 14:44:37
I have 1 pin on my map. I need to pass title of annotation to another UIView (which is ikinciEkran.swift in that case). But I am unable to do so. Here is the segue part of my code and I do not know how to segue title of selected annotation. I only pasted related part of the code. class MapViewController: UIViewController, CLLocationManagerDelegate, MKMapViewDelegate { @IBOutlet weak var mapView: MKMapView! @IBOutlet weak var lbl_Name: UILabel! @IBOutlet weak var lbl_Address: UILabel! @IBOutlet weak var lbl_Phone: UILabel! var LocationManager = CLLocationManager() var i = 0 var annotation