User Tools

Site Tools


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: PreviewProvider is just for showing an mock up preview when you coding. It is not a part of the real app.
  • Add @State at 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
swift.1659886641.txt.gz · Last modified: 2022/08/07 23:37 by admin