DianQK / TransitionTreasury

Easier way to push your viewController.
https://transitiontreasury.com
MIT License
2.09k stars 158 forks source link

Generic parameter 'T' could not be inferred #25

Open lfarah opened 8 years ago

lfarah commented 8 years ago

Using the code example in the readme:

        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let mainVC = storyboard.instantiateViewControllerWithIdentifier("searchVC") as? SearchViewController
        navigationController?.tr_pushViewController(mainVC, method: TRPushTransitionMethod.Fade, completion: {
            print("Push finish")
        })

Error in 3rd line:

Generic parameter 'T' could not be inferred

alkanyunus commented 7 years ago

Yes I'm getting this error also. Some people did have also. Please give us instructions to resolve. thanks.

CedricJEA commented 7 years ago

Hello, I have the same error. Second controller is a class deviated from UIViewController with NavgationTransitionable protocol but i can't inferred it. Please help.

alkanyunus commented 7 years ago

Yeah, I read carefully and I figured out yesterday. You have to conform the delegate in your view controller, for instance you want to make a push a view controller, then you'll have to write "NavgationTransitionable" in your second view controller which is pushing up ;)

CedricJEA commented 7 years ago

It’s what I did :

import UIKit import TransitionTreasury

class CircleViewController: UIViewController , NavgationTransitionable {

  var tr_pushTransition: TRNavgationTransitionDelegate?

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
}

}and in the main controller :

    let vc: CircleViewController = CircleViewController()

    navigationController?.tr_presentViewController(vc, method: .push, statusBarStyle: .default, completion: {     
    })

Is the version compatible with Swift 3 ? i had to make some change in TransitionAnimation to compile in swift 3 (not treasury).

Le 2 oct. 2016 à 13:15, Yunus Alkan notifications@github.com a écrit :

Yeah, I read carefully and I figured out yesterday. You have to conform the delegate in your view controller, for instance you want to make a push a view controller, then you'll have you write "NavgationTransitionable" in your second view controller which is pushing up ;)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DianQK/TransitionTreasury/issues/25#issuecomment-250966182, or mute the thread https://github.com/notifications/unsubscribe-auth/AVhoZTjv5Z3B2aKlF-tYjDcjwWjWXIkuks5qv5JCgaJpZM4JpmTm.

AkdM commented 7 years ago

@CedricJEA : What did you change? It still won't work for me, I still have the "Generic" error.

QiProject commented 6 years ago

hi i think the issue is not just only add NavgationTransitionable, i had to do pod 'TransitionAnimation', '~> 5.0' and import TransitionAnimation in the FirstViewController this works for me, hope it helps you.