Functions

The following functions are available globally.

UIScreen+FWAdaptive

  • 获取相对设计图宽度等比例缩放值

    Declaration

    Objective-C

    extern CGFloat FWRelativeValue(CGFloat value)
  • 获取相对设计图高度等比例缩放值

    Declaration

    Objective-C

    extern CGFloat FWRelativeHeight(CGFloat value)
  • 获取相对设计图宽度等比例缩放时的固定宽度值

    Declaration

    Objective-C

    extern CGFloat FWFixedValue(CGFloat value)
  • 获取相对设计图高度等比例缩放时的固定高度值

    Declaration

    Objective-C

    extern CGFloat FWFixedHeight(CGFloat value)
  • 获取相对设计图等比例缩放size

    Declaration

    Objective-C

    extern CGSize FWRelativeSize(CGSize size)
  • 获取相对设计图等比例缩放point

    Declaration

    Objective-C

    extern CGPoint FWRelativePoint(CGPoint point)
  • 获取相对设计图等比例缩放rect

    Declaration

    Objective-C

    extern CGRect FWRelativeRect(CGRect rect)
  • 获取相对设计图等比例缩放insets

    Declaration

    Objective-C

    extern UIEdgeInsets FWRelativeInsets(UIEdgeInsets insets)
  • 基于当前设备的屏幕倍数,对传进来的floatValue进行像素取整

    Declaration

    Objective-C

    extern CGFloat FWFlatValue(CGFloat value)
  • 基于指定的倍数(0取当前设备),对传进来的floatValue进行像素取整

    Declaration

    Objective-C

    extern CGFloat FWFlatScale(CGFloat value, CGFloat scale)

Function

  • 自动加载Swift类并调用autoload方法,参数为Class或String

    Declaration

    Objective-C

    extern BOOL FWAutoload(id _Nonnull clazz)

FWBlock

  • 通用互斥锁方法

    Declaration

    Objective-C

    void FWSynchronized(id _Nonnull object, void (^_Nonnull closure)(void))

FWSafeValue

  • 安全数字,不为nil

    Declaration

    Objective-C

    extern NSNumber *_Nonnull FWSafeNumber(id _Nullable value)

    Parameters

    value

    参数

    Return Value

    数字

  • 安全字符串,不为nil

    Declaration

    Objective-C

    extern NSString *_Nonnull FWSafeString(id _Nullable value)

    Parameters

    value

    参数

    Return Value

    字符串

  • 安全URL,不为nil

    Declaration

    Objective-C

    extern NSURL *_Nonnull FWSafeURL(id _Nullable value)

    Parameters

    value

    参数

    Return Value

    URL

  • 指定名称和大小初始化图标对象

    Declaration

    Objective-C

    extern FWIcon *_Nullable FWIconNamed(NSString *_Nonnull name, CGFloat size)
  • 指定名称和大小初始化图标图像

    Declaration

    Objective-C

    extern UIImage *_Nullable FWIconImage(NSString *_Nonnull name, CGFloat size)

UIFont+FWToolkit

  • 快速创建Thin字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontThin(CGFloat size)
  • 快速创建Light字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontLight(CGFloat size)
  • 快速创建Regular字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontRegular(CGFloat size)
  • 快速创建Medium字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontMedium(CGFloat size)
  • 快速创建Semibold字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontSemibold(CGFloat size)
  • 快速创建Bold字体

    Declaration

    Objective-C

    extern UIFont *_Nonnull FWFontBold(CGFloat size)

Comparable

  • Undocumented

    Declaration

    Swift

    public func == (lhs: JSON, rhs: JSON) -> Bool
  • Undocumented

    Declaration

    Swift

    public func <= (lhs: JSON, rhs: JSON) -> Bool
  • Undocumented

    Declaration

    Swift

    public func >= (lhs: JSON, rhs: JSON) -> Bool
  • Undocumented

    Declaration

    Swift

    public func > (lhs: JSON, rhs: JSON) -> Bool
  • Undocumented

    Declaration

    Swift

    public func < (lhs: JSON, rhs: JSON) -> Bool