FWABDefaultRepository

@objcMembers
public class FWABDefaultRepository : NSObject, FWABRandomRepository

默认随机数仓库,存储于UserDefaults

  • 单例模式

    Declaration

    Swift

    public static let sharedInstance: FWABDefaultRepository
  • 初始化,使用默认UserDefaults

    Declaration

    Swift

    public override init()
  • 初始化,指定UserDefaults

    Declaration

    Swift

    public init(userDefaults: UserDefaults)
  • 获取指定key随机数

    Declaration

    Swift

    public func getRandomNumber(key: String) -> Int
  • 设置指定key随机数

    Declaration

    Swift

    public func setRandomNumber(_ randomNumber: Int, key: String)
  • 删除指定key随机数

    Declaration

    Swift

    public func removeRandomNumber(key: String)