1. OC 和 Swift 中的区别
OC中定义Options
typedef NS_OPTIONS(NSUInteger, OCOptions) {
OC_Sound = 1 << 0,
OC_Title = 1 << 1,
OC_Vibrate = 1 << 2,
};
Swift 中定义Options
// 需要实现OptionSetType协议
struct SwiftOptions: OptionSetType {
let rawValue: UInt
init(rawValue: UInt) { self.rawValue = rawValue }
static let Swift_Sound = SwiftOptions(rawValue: 1 << 0)