Check out example codes for "how to make extension for optional in swift". It will help you in understanding the concepts better.

Code Example 1

extension Swift.Optional where Wrapped == String {
    var isBlank: Bool {
        return self?.isBlank ?? true
    }
}

Learn ReactJs, React Native from akashmittal.com