Skip to content

SwiftUI 项目实战 3

Hike

GitHub 仓库

知识点:

  • 修改 App 的图标

Todo App

GitHub 仓库

知识点:

  • Core Data
  • 在 Sheet 里关闭自己 @Environment(\.presentationMode) var presentationMode
举例说明
swift
.sheet(isPresented: $showSheet) {
    SheetView()
}

然后在 SheetView 里写:

swift
@Environment(\.presentationMode) var presentationMode

Button("关闭") {
    presentationMode.wrappedValue.dismiss()
}
  • ForEach 和 List 啥时候要配合,啥时候不要啊
  • LaunchScreen
  • frame 修饰器的 minWidth, idealWidth, maxWidth