Is it possible to call a method (written in a Gamescene) from a ViewController in Swift? I read about Protocol, delegate or Inheritance but all tutorials I saw don't show this case.
Thank you for your help.
try this.
in ViewController class
#import "Gamescene.h"
Gamescene *obj = [[Gamescene alloc] init];
[Gamescene methodName];
and don't forgot to add method name in Gamescene.h file..
in Swift
class SomeClass {
class func someTypeMethod() {
// type method implementation goes here
}
}
SomeClass.someTypeMethod()
you can learn here apple Documentation.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments