Check out example codes for "swift access appdelegate from viewcontroller". It will help you in understanding the concepts better.

Code Example 1

func appDelegate() -> AppDelegate {
    return UIApplication.shared.delegate as! AppDelegate
}

Code Example 2

let appDelegate = UIApplication.shared.delegate as! AppDelegate
let aVariable = appDelegate.someVariable

Learn ReactJs, React Native from akashmittal.com