How can I call a method from ViewController?

Haox

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.

hmdeep

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I call a method from ViewController?

From Dev

How can I start a ViewController from within a Method?

From Dev

How can I call async method from constructor?

From Dev

SignalR - How can I call Hub Method on server from server

From Dev

How can I call on a parent method from outside the class?

From Dev

How can I call a method from nested fragment

From Dev

How can I call an overloaded Java varargs method from Scala?

From Dev

How can I call a different method than run() from a Thread

From Dev

How can I call a method from another swift file in GameViewController?

From Dev

How can I call an instance method from a generic object?

From Dev

How can i call a controller method from view

From Dev

How Can I Call a Class Method From a Different Class in Python?

From Dev

How can I call a different method than run() from a Thread

From Dev

How can I call a method from another swift file in GameViewController?

From Dev

How can I call a method in one view controller from another?

From Dev

How can I dynamically call a function from a method?

From Dev

How can I call method in child component from parent component?

From Dev

How can i call a method in my fragment from my activity?

From Dev

How can I call an asynchronous method from WndProc?

From Dev

How to call a ViewController.m method from the AppDelegate.m

From Dev

Can I call an async method from OnOptionsItemSelected?

From Dev

How to call xib viewcontroller from storyboard viewcontroller

From Dev

How can I debounce a method call?

From Dev

How can I call Timer as a method?

From Dev

How can I call a method in Squeak?

From Dev

How can I "intercept" a method call for a test?

From Dev

How can I call the displayAd() method?

From Dev

How can i call child's static method from parent's static method?

From Dev

How can I run testNG through a call from another method, let's say a main method?

Related Related

  1. 1

    How can I call a method from ViewController?

  2. 2

    How can I start a ViewController from within a Method?

  3. 3

    How can I call async method from constructor?

  4. 4

    SignalR - How can I call Hub Method on server from server

  5. 5

    How can I call on a parent method from outside the class?

  6. 6

    How can I call a method from nested fragment

  7. 7

    How can I call an overloaded Java varargs method from Scala?

  8. 8

    How can I call a different method than run() from a Thread

  9. 9

    How can I call a method from another swift file in GameViewController?

  10. 10

    How can I call an instance method from a generic object?

  11. 11

    How can i call a controller method from view

  12. 12

    How Can I Call a Class Method From a Different Class in Python?

  13. 13

    How can I call a different method than run() from a Thread

  14. 14

    How can I call a method from another swift file in GameViewController?

  15. 15

    How can I call a method in one view controller from another?

  16. 16

    How can I dynamically call a function from a method?

  17. 17

    How can I call method in child component from parent component?

  18. 18

    How can i call a method in my fragment from my activity?

  19. 19

    How can I call an asynchronous method from WndProc?

  20. 20

    How to call a ViewController.m method from the AppDelegate.m

  21. 21

    Can I call an async method from OnOptionsItemSelected?

  22. 22

    How to call xib viewcontroller from storyboard viewcontroller

  23. 23

    How can I debounce a method call?

  24. 24

    How can I call Timer as a method?

  25. 25

    How can I call a method in Squeak?

  26. 26

    How can I "intercept" a method call for a test?

  27. 27

    How can I call the displayAd() method?

  28. 28

    How can i call child's static method from parent's static method?

  29. 29

    How can I run testNG through a call from another method, let's say a main method?

HotTag

Archive