How would I do the following - passing two NSStringDrawing options as a function parameter in swift:
CGRect boundingRect = [string boundingRectWithSize:CGSiz
in swift 2.0 that will be something like
theStringDrawingOptions = [NSStringDrawingOptions.UsesLineFragmentOrigin,
NSStringDrawingOptions.UsesFontLeading]
see lecture wwdc 2015 -> 106_hd_whats_new_in_swift in 6 min
Another solution, use unsafeBitCast
.
Like below:
let options = unsafeBitCast(NSStringDrawingOptions.UsesLineFragmentOrigin.rawValue |
NSStringDrawingOptions.UsesFontLeading.rawValue,
NSStringDrawingOptions.self)