NSURL(FWEncode)

@interface NSURL (FWEncode)

/// 获取当前query的参数字典,不含空值
@property (nonatomic, copy, readonly) NSDictionary<NSString *, NSString *> *fw_queryDictionary NS_REFINED_FOR_SWIFT;

/// 获取基准URI字符串,不含path|query|fragment等,包含scheme|host|port等
@property (nonatomic, copy, readonly, nullable) NSString *fw_baseURI NS_REFINED_FOR_SWIFT;

/// 获取路径URI字符串,不含scheme|host|port等,包含path|query|fragment等
@property (nonatomic, copy, readonly, nullable) NSString *fw_pathURI NS_REFINED_FOR_SWIFT;

/// 生成URL,中文自动URL编码
+ (nullable NSURL *)fw_urlWithString:(nullable NSString *)string NS_REFINED_FOR_SWIFT;

/// 生成URL,中文自动URL编码
+ (nullable NSURL *)fw_urlWithString:(nullable NSString *)string relativeTo:(nullable NSURL *)baseURL NS_REFINED_FOR_SWIFT;

@end

Undocumented

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

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NS_REFINED_FOR_SWIFT NSDictionary<NSString *, NSString *> *fw_queryDictionary;
  • 获取基准URI字符串,不含path|query|fragment等,包含scheme|host|port等

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *fw_baseURI;
  • 获取路径URI字符串,不含scheme|host|port等,包含path|query|fragment等

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *fw_pathURI;
  • 生成URL,中文自动URL编码

    Declaration

    Objective-C

    + (nullable NSURL *)fw_urlWithString:(nullable NSString *)string;
  • 生成URL,中文自动URL编码

    Declaration

    Objective-C

    + (nullable NSURL *)fw_urlWithString:(nullable NSString *)string
                              relativeTo:(nullable NSURL *)baseURL;