How to use NSNotofication in Swift?

0 votes
58 views
asked Feb 6, 2015 in Swift by basicSwift
Hi All

 How to use NSNotofication in Swift?

1 Answer

0 votes
answered Feb 6, 2015 by admin (8,115 points)

HI

  For register:

      NSNotificationCenter.defaultCenter().addObserver(self, selector:"loadPage", name: "loadPage", object: nil)

func loadPage(){

 

    }

For Calling

 NSNotificationCenter.defaultCenter().postNotificationName("loadPage", object: nil)

...