Skip to content

Instantly share code, notes, and snippets.

@bobleesj
Last active December 17, 2016 12:41
Show Gist options
  • Save bobleesj/b45639d1f0a7da256bd2c3deaff31749 to your computer and use it in GitHub Desktop.
Save bobleesj/b45639d1f0a7da256bd2c3deaff31749 to your computer and use it in GitHub Desktop.
import UIKit
class FirstVC: UIViewController {
@IBOutlet weak var FirstVCLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self,
selector: #selector(doSomethingAfterNotified),
name: NSNotification.Name(rawValue: myNotificationKey),
object: nil) }
func doSomethingAfterNotified() {
print("I've been notified")
FirstVCLabel.text = "Damn, I feel your spark 😱"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment