That's because the Objective-C versions don't include an error return. Contrast:+ (nullable instancetype)fileHandleForReadingAtPath:(NSString *)path;and:+ (nullable instancetype)fileHandleForReadingFromURL:(NSURL *)url error:(NSError **)error NS_AVAILABLE(10_6, 4_0);There's not much that Swift can do about this. * * *As an aside, I encourage folks to use file URLs rather than paths. There are a couple of situations where using a path drops useful information. Most of these are irrelevant on iOS, but it's still best practice to use file URLs everywhere.Share and Enjoy--Quinn The Eskimo!Apple Developer Relations, Developer Technical Support, Core OS/Hardware
Topic:
Programming Languages
SubTopic:
Swift
Tags: