I came across this in the implementation instructions of Google Analytics:
guard let gai = GAI.sharedInstance() else {
assert(false, "Google Analytics not configured correctly")
}
I had never thought it was possible to have an assertion in the else clause, without returning. This doesn't make sense to me because the assert will only be evaluated in a testing scheme. So, why doesn't the compiler warn about it not returning (in the case of a release build).
Edit: This is within the function application(_:didFinishLaunchingWithOptions) -> Bool
Edit 2: Additional info I found on this that answers it:
Unfortunately, this will break as soon as you do a release build, since assertions are removed in release configurations, and a guard block must end execution of the current scope.