researchkit - return new ViewController in Swift -


this follow question : assign viewcontroller class or vice versa

so have viewcontroller called swipestepviewcontroller, subclasses orkactivestepviewcontroller. in swipestep class try override default viewcontroller custom swipestepviewcontroller.

i tried override +stepviewcontrollerclass method , return custom viewcontroller inside swipestep class: import researchkit

class swipestep:orkactivestep{      override func stepviewcontrollerclass(){         return swipestepviewcontroller.self     }  } 

but not work @ all. use researchkit, guess general swift question.

i don't have experience researchkit, after taking @ objective-c code believe method should be:

override class func stepviewcontrollerclass() -> anyclass {     return swipestepviewcontroller.self } 

to explain why you're getting errors:

method not override method superclass.

and

'swipestepviewcontroller.type' not convertible '()'

take @ class method (indicated +) you're supposedly overriding:

+ (class)stepviewcontrollerclass {     return [orkformstepviewcontroller class]; } 

compare method:

override func stepviewcontrollerclass(){     return swipestepviewcontroller.self } 

which neither class method, nor returns class , it's clear errors coming from.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -