TransitionTreasury icon indicating copy to clipboard operation
TransitionTreasury copied to clipboard

Generic parameter 'T' could not be inferred

Open lfarah opened this issue 8 years ago • 6 comments

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

lfarah avatar Aug 22 '16 07:08 lfarah

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

alkanyunus avatar Oct 01 '16 19:10 alkanyunus

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.

CedricJEA avatar Oct 02 '16 07:10 CedricJEA

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 ;)

alkanyunus avatar Oct 02 '16 11:10 alkanyunus

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 [email protected] 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.

CedricJEA avatar Oct 02 '16 12:10 CedricJEA

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

AkdM avatar Aug 25 '17 15:08 AkdM

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.

QiProject avatar Jul 12 '18 01:07 QiProject