Check out example codes for "swift try catch". It will help you in understanding the concepts better.

Code Example 1

do {
    let sandwich = try makeMeSandwich(kitchen)
    print("i eat it \(sandwich)")
} catch SandwichError.NotMe {
    print("Not me error")
} catch SandwichError.DoItYourself {
    print("do it error")
} catch Default {
    print("Another Error")
}

Learn ReactJs, React Native from akashmittal.com