swift:枚举值转Int

2016-09-22  本文已影响235人  半江瑟瑟
let dict = [NSParagraphStyleAttributeName:par,
                NSFontAttributeName:self.alertContentLabelFont(),
                NSUnderlineStyleAttributeName:NSNumber.init(integer: NSUnderlineStyle.StyleNone.rawValue)]

//Cannot convert value of type 'NSUnderlineStyle' to expected argument type 'Int' --->用rawValue 解决枚举转Int

上一篇下一篇

猜你喜欢

热点阅读