URL

extension URL: WrapperCompatible
extension URL: AnyModel
extension URL: BasicType
extension URL: URLParameter, StringParameter, URLRequestParameter

Codable+Extension

  • 安全URL,不为nil,不兼容文件路径(需fileURLWithPath)

    Declaration

    Swift

    public static func fw_safeURL(_ value: Any?) -> URL
  • 生成URL,中文自动URL编码

    Declaration

    Swift

    public static func fw_url(string: String?) -> URL?
  • 生成URL,中文自动URL编码,支持基准URL

    Declaration

    Swift

    public static func fw_url(string: String?, relativeTo baseURL: URL?) -> URL?

ObjectType+Extension

  • Undocumented

    Declaration

    Swift

    public init()

AnyParameter+Extension

  • Undocumented

    Declaration

    Swift

    public var urlValue: URL { get }
  • Undocumented

    Declaration

    Swift

    public var stringValue: String { get }
  • Undocumented

    Declaration

    Swift

    public var urlRequestValue: URLRequest { get }

Encode

  • 获取当前query的参数字典,不含空值

    Declaration

    Swift

    public var fw_queryParameters: [String : String] { get }
  • 获取基准URI字符串,不含path|query|fragment等,包含scheme|host|port等

    Declaration

    Swift

    public var fw_baseURI: String? { get }
  • 获取路径URI字符串,不含host|port等,包含path|query|fragment等

    Declaration

    Swift

    public var fw_pathURI: String? { get }
  • 添加query参数字典并返回新的URL

    Declaration

    Swift

    public func fw_appendingQueryParameters(_ parameters: [String : String]) -> URL
  • 获取指定query参数值

    Declaration

    Swift

    public func fw_queryValue(for key: String) -> String?

Framer

  • isTLSScheme returns true if the scheme is https or wss

    Declaration

    Swift

    var isTLSScheme: Bool { get }
  • getParts pulls host and port from the url.

    Declaration

    Swift

    func getParts() -> WebSocketURLParts?

URL+Foundation

  • 生成App Store外部URL

    @param appId 应用Id @return NSURL

    Declaration

    Swift

    public static func fw_appStoreURL(_ appId: String) -> URL
  • 生成苹果地图地址外部URL

    @param addr 显示地址,格式latitude,longitude或搜索地址 @param options 可选附加参数,如[“ll”: “latitude,longitude”, “z”: “14”] @return NSURL

    Declaration

    Swift

    public static func fw_appleMapsURL(addr: String?, options: [AnyHashable : Any]? = nil) -> URL?
  • 生成苹果地图导航外部URL

    @param saddr 导航起始点,格式latitude,longitude或搜索地址 @param daddr 导航结束点,格式latitude,longitude或搜索地址 @param options 可选附加参数,如[“ll”: “latitude,longitude”, “z”: “14”] @return NSURL

    Declaration

    Swift

    public static func fw_appleMapsURL(saddr: String?, daddr: String?, options: [AnyHashable : Any]? = nil) -> URL?
  • 生成谷歌地图外部URL

    @param addr 显示地址,格式latitude,longitude或搜索地址 @param options 可选附加参数,如[“query_place_id”: “”] @return NSURL

    Declaration

    Swift

    public static func fw_googleMapsURL(addr: String?, options: [AnyHashable : Any]? = nil) -> URL?
  • 生成谷歌地图导航外部URL

    @param saddr 导航起始点,格式latitude,longitude或搜索地址 @param daddr 导航结束点,格式latitude,longitude或搜索地址 @param mode 导航模式,支持driving|transit|bicycling|walking @param options 可选附加参数,如[“origin_place_id”: “”] @return NSURL

    Declaration

    Swift

    public static func fw_googleMapsURL(saddr: String?, daddr: String?, mode: String? = nil, options: [AnyHashable : Any]? = nil) -> URL?
  • 生成外部URL,需配置对应URL SCHEME

    @param string 外部主URL @param params 附加参数 @return NSURL

    Declaration

    Swift

    public static func fw_vendorURL(_ string: String, params: [AnyHashable : Any]? = nil) -> URL?