NSStringDrawingOptions is not exposed correctly in Swift on iOS
| Originator: | sean.labastille | ||
| Number: | rdar://19532688 | Date Originated: | 20-Jan-2015 06:14 PM |
| Status: | Duplicate | Resolved: | Duplicate of 17883233 (Closed) |
| Product: | iOS | Product Version: | |
| Classification: | Other Bug | Reproducible: | always |
Summary:
In the Swift interface for NSStringDrawingOptions this is not exposed as conforming to RawOptionSetType on iOS.
Due to this an unsafe operation must be used in order to combine multiple NSStringDrawingOptions
Steps to Reproduce:
1. Create an iOS Playground containing the following expression:
NSStringDrawingOptions.UsesFontLeading | NSStringDrawingOptions.UsesLineFragmentOrigin
Expected Results:
The expression evaluates to {rawValue 3} as in an OS X playground.
Actual Results:
The following error is shown:
error: cannot invoke '|' with an argument list of type '(NSStringDrawingOptions, NSStringDrawingOptions)'
Version:
Xcode 6.2 (6C107a)
Notes:
Workaround: unsafeBitCast may be used to perform the operation on the .rawValue of the enum values.
Configuration:
N/A
Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!