This is a silly question — or rather, it should be a silly question — but it’s going to bite you sometimes when you integrate Objective-C and Swift code together (*cough* UIKit).
You will try to use what you think is a Bool
from an Objective-C API, and suddenly you’re getting this compile error:
Cannot convert value of type ‘ObjCBool’ to expected argument type ‘Bool’
This is a Boolean value; why can’t I use this @($^ thing as a Bool
?
Normally the standard types play nice between Objective-C and Swift. But Bool
s are an unusual case that require a non-obvious solution.