0001 import Foundation 0002 0003 /** 0004 NSURL Convertible implementation 0005 0006 This implementation assumes the given value is a string which can be used to create a NSURL 0007 if not a `MapperError` is thrown 0008 */ 0009 extension NSURL: Convertible { 0010 @warn_unused_result 0011 public static func fromMap(value: AnyObject?) throws -> NSURL { 0012 if let string = value as? String, let URL = NSURL(string: string) { 0013 return URL 0014 } 0015 0016 throw MapperError() 0017 } 0018 } 0019