swift
This is an old revision of the document!
Swift
Tutorial for beginners: https://developer.apple.com/tutorials/app-dev-training
- Important concept: pass object between views.
struct ScrumsView_Previews: PreviewProvideris just for showing an mock up preview when you coding. It is not a part of the real app.- Add
@Stateat the beginning to declear a single source of truth at the very most parent view. Use$[variable name]to pass it to child view. In child view initialize with@Binding var [variable name]: [variable type]to use that data. - The annotation
environmentObject(_:)means … - Property wrappers is those code started with
@than you add before declearing an variable or object. For example@EnvironmentObject var time: Float. - Scenes are like windows. active — A scene is in the foreground, and the user can interact with it.
inactive — The scene is visible, but the system disabled interaction with the scene. For example, in multitasking mode, you can see your app’s panel alongside others, but it isn’t the active panel. background — The app is running, but the scene isn’t visible in the UI. A scene enters this phase prior to app termination.
swift.1659967682.txt.gz · Last modified: (external edit)
