2016-07-19 10 views
2

Dies ist, wie ich meine Gewohnheit präsentieren UIPresentationController:UIPresentationController wird nach großer Verzögerung präsentiert

func presentOverlayController(controller: UIViewController) { 

    controller.modalPresentationStyle = .Custom 
    controller.transitioningDelegate = self 

    presentViewController(controller, animated: true, completion: nil) 
} 

//MARK: - UIViewControllerTransitioningDelegate 

public func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? { 
    return OverlayPresentationController(presentedViewController: presented, presentingViewController: presenting) 
} 

stellt ich meinen Controller, sobald ich auf UITableViewCell tippen. Es wird nur sehr schnell angezeigt, wenn ich zweimal auf Zelle klicke. Wenn ich einen einzelnen Tap spiele, funktioniert es aber auch mit großer Verzögerung (zwischen 15 und 60 Sekunden).

Was ist der Grund? Wie umgehen Sie es?

Antwort

1

starten:

dispatch_async(dispatch_get_main_queue()) { 
    self.presentViewController(controller, animated: true, completion: nil) 
} 
Verwandte Themen