There are Objective-C libraries with functions that take integer enumeration parameters as a parameter, but they expect you to pass 0 if you want to use the default parameters, as is usually the case. But in Swift, this is unacceptable because the library defines the type of enumeration. Is there a way around this by not adding the 0 enum option to the library and then generating the bridge code so that its ObjC hugs work in Swift?
Here is an example with SDWebImageManager in an iPhone app:
SDWebImageManager.sharedManager().downloadWithURL(url, options: 0, progress: nil) { (image:UIImage!, error:NSError!, cacheType:SDImageCacheType, finished:Bool) -> Void in
Xcode will indicate an error where it says options: 0 , because 'Int' is not convertible to SDWebImageOptions . I tried something like the following, but I get the same error:
let emptyOptions:SDWebImageOptions = 0
source share