Check out example codes for "how to check object is nil in swift". It will help you in understanding the concepts better.
Code Example 1
if let variableName = abc { // If casting, use, eg, if let var = abc as? NSString
// variableName will be abc, unwrapped
} else {
// abc is nil
}
Learn ReactJs, React Native from akashmittal.com