lkzhao / ElasticTransition

A UIKit custom transition that simulates an elastic drag. Written in Swift.
MIT License
2.18k stars 177 forks source link

Does EdgePanTransition work for UITableView? #8

Closed adaoli closed 8 years ago

adaoli commented 8 years ago

When try function handleLeftPan(pan:UIPanGestureRecognizer) in a UIView it works perfectly. But when try it on a UITableView, i got error "fatal error: unexpectedly found nil while unwrapping an Optional value" for code line transition.dissmissInteractiveTransition.

Already tried changing UIViewController to UITableViewController as below for function dissmissInteractiveTransition, but it's not working. public func dissmissInteractiveTransition(viewController:UITableViewController, gestureRecognizer

Thank you and apologize in case it's a silly question.

lkzhao commented 8 years ago

Can you provide an example project. I can help you debug. The transition should work with uitableviewcontroller though, since it is a subclass of uiviewcontroller

adaoli commented 8 years ago

Thanks. here is my project example https://github.com/adaoli/TestNav . you will find fun handleLeftPan() not work for DetailTableViewController.swift.

lkzhao commented 8 years ago

Hey @adaoli,

Sorry about the late reply. Have been busy lately. The problem with your code is that the transition object is not initialized. In my demo code. I passed the transition from the root ViewController down to the next ViewController. I did that mainly because I only want a single transition so that the configuration are kept.

You can, however, initialize a new one. So instead of writing:

    var transition:ElasticTransition!

Do:

    var transition = ElasticTransition()
brettharvee commented 8 years ago

Okay! I will definitely go in and change it. Thank you SO much. I am really excited to start implementing your elastic transition into my projects!

Brett Harvey

On Feb 7, 2016, at 6:54 PM, Luke Zhao notifications@github.com<mailto:notifications@github.com> wrote:

Hey @adaolihttps://github.com/adaoli,

Sorry about the late reply. Have been busy lately. The problem with your code is that the transition object is not initialized. In my demo code. I passed the transition from the root ViewController down to the next ViewController. I did that meanly because I only want a single transition so that the configuration are kept.

You can, however, initialize a new one. So instead of writing:

var transition:ElasticTransition!

Do:

var transition = ElasticTransition()

— Reply to this email directly or view it on GitHubhttps://github.com/lkzhao/ElasticTransition/issues/8#issuecomment-181137459.

adaoli commented 8 years ago

Thanks a million!