मैंने स्विफ्ट में अपनी घड़ी परियोजना को लागू किया और अब मैं एक्सकोड 8 के कारण स्विफ्ट 3 में माइग्रेट कर रहा हूं। मैंने एक्सकोड 8 को सोर्स कोड को स्विफ्ट 3 में बदलने दिया है। हालांकि, कोड में त्रुटियां हैं और मेरे द्वारा इसका निर्धारण नहीं किया जा सकता।एक्सकोड 8 और स्विफ्ट 3 एनएससीएंडर
let unitFlags: Calendar = [.hour, .firstWeekday, .monthSymbols, .year, .minute, .firstWeekday]
var calendar = NSCalendar.current
calendar.timeZone = NSTimeZone(identifier: "UTC")!
let components = (calendar as NSCalendar).components(unitFlags, from: reservationDate)
एक्सकोड इन पंक्तियों में त्रुटि देता है और मैं समस्या को समझ नहीं पा रहा हूं।
ERROR: Contextual type ' Calendar' cannot be used with array literal
ERROR: Argument labels '(identifier:)' do not match any available overloads
ERROR: Cannot convert value of type 'Calendar' to expected argument type 'NSCalendar.Unit'