Xcode 6.3.1: NSCalendarUnit.DayCalendarUnit is said to be deprecated, but recommended fix doesn't compile
| Originator: | barissncn | ||
| Number: | rdar://20966498 | Date Originated: | 14-May-2015 04:50 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.3.1 (6D1002) |
| Classification: | Other Bug | Reproducible: | Always |
Summary: Xcode recommends I use NSCalendarUnitDay instead of NSCalendarUnit.DayCalendarUnit in my swift code, as the former has been deprecated in iOS version 8.0. However, when replaced as ask, the compiler doesn’t recognize NSCalendarUnitDay. Steps to Reproduce: 1. Create a new swift file in an iOS 8.0 project. 2. Write `let calendarFlags = NSCalendarUnit.DayCalendarUnit’ in it. 3. Wait for the warning, or compile to see the warning. 4. Change the code as recommended in the warning. 5. Compile to get an error. Expected Results: No compiler errors, as the change was recommended by Xcode. Actual Results: Compiler gives an error saying that NSCalendarUnitDay is an unresolved identifier.
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!