In the XCode Playground editor, there is result views at the right hand side after the code is executed in playground. I notice that some of the displayed variable values has a description "fixed". What does "fixed" mean in this context?
Thank you!
In the XCode Playground editor, there is result views at the right hand side after the code is executed in playground. I notice that some of the displayed variable values has a description "fixed". What does "fixed" mean in this context?
Thank you!
I think posting some code can make what I am referring to clear:
It did indeed. Thanks.
In this context, the
(fixed)
is not a feature of the playground but a feature of
Calendar
. Consider this snippet:
import Foundation
let cal = Calendar.autoupdatingCurrent
It logs
gregorian (autoupdatingCurrent)
. In the world of
Calendar
, there are two types of calendars:
An auto-updating calendar tracks user settings. For example, if the user goes to Settings > General > Language & Region > Calendar and changes their calendar, the auto-updating calendar will start returning results based on that new calendar.
A fixed calendar is… well… fixed. Once you create a calendar value, it will continue return results based on that calendar, regardless of any user settings changes.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
I’m not entirely sure what you’re getting at here, so some questions:
Are all the variables that exhibit this behaviour of the same type?
What type (or types) are they?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Hi eskimo
I think posting some code can make what I am referring to clear:
// create calendar
var calGreg: Calendar
calGreg = Calendar(identifier: .gregorian)
var calBudd: Calendar
calBudd = Calendar(identifier: .buddhist)
After running in the playground, the result displayed at the right hand side for the two assignment statements are:
gregorian (fixed)
buddhist (fixed)
I am just wondering what does the "(fixed)" indicate.
Thank you.
I think posting some code can make what I am referring to clear:
It did indeed. Thanks.
In this context, the
(fixed)
is not a feature of the playground but a feature of
Calendar
. Consider this snippet:
import Foundation
let cal = Calendar.autoupdatingCurrent
It logs
gregorian (autoupdatingCurrent)
. In the world of
Calendar
, there are two types of calendars:
An auto-updating calendar tracks user settings. For example, if the user goes to Settings > General > Language & Region > Calendar and changes their calendar, the auto-updating calendar will start returning results based on that new calendar.
A fixed calendar is… well… fixed. Once you create a calendar value, it will continue return results based on that calendar, regardless of any user settings changes.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thank you for your explaination Eskimo!