How to convert NSURL to String in Swift

It turns out there are properties of NSURL you can access (see Swift Reference): var directoryURL: NSURL var urlString: String = directoryURL.absoluteString // OR var urlString: String = directoryURL.relativeString // OR var urlString: String = directoryURL.relativePath // OR var urlString: String = directoryURL.path // etc.

Converting Int to Bool

No, there is and has never been an explicit built in option for conversion of Int to Bool, see the language reference for Bool for details. There exists, still, however, an initializer by NSNumber. The difference is that implicit bridging between Swift numeric type and NSNumber has been removed in Swift 3 (which previously allowed … Read more