Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SwiftUI 豆知識 - よちよち Swift

2028fcf9065b3e34d2732587b6ac7bc5?s=47 Megabits_mzq
November 27, 2020

SwiftUI 豆知識 - よちよち Swift

2020/11/27 よちよち Swift 勉強会での発表スライドです。

2028fcf9065b3e34d2732587b6ac7bc5?s=128

Megabits_mzq

November 27, 2020
Tweet

Transcript

  1. Megabits @Megabits_mzq

  2. Megabits @Megabits_mzq

  3. None
  4. @Megabits_mzq SwiftUI ⾖知識 SwiftUI 完全に理解した (ではない

  5. struct MyAppsView_Previews: PreviewProvider { static var previews: some View {

    MyAppsView() } }
  6. None
  7. 􀆄 􀥥

  8. import PlaygroundSupport struct MainView: View { var body: some View

    { ······ } } PlaygroundPage.current.setLiveView(MainView())
  9. None
  10. None
  11. struct MyAppsView_Previews: PreviewProvider { static var previews: some View {

    MyAppsView() } }
  12. None
  13. None
  14. struct ContentView_Previews: PreviewProvider { static var previews: some View {

    ContentView() .previewLayout(.sizeThatFits) } }
  15. Circle().background(Color.yellow)

  16. Circle().background(Color.yellow.brightness(0.5))

  17. Circle().background(Color.yellow.brightness(0.5))

  18. Circle().background(Color.yellow.saturation(0.3))

  19. Circle().background(Color.yellow.saturation(0.3))

  20. Circle().background(Color.yellow.saturation(0.3)) Circle().foregroundColor(Color.yellow.saturation(0.3)) 􀆄 􀥥

  21. None
  22. NavigationView { }

  23. NavigationView { }.navigationViewStyle(StackNavigationViewStyle())

  24. None
  25. struct PopoutAlertView: View { var body: some View { ZStack

    { RoundedRectangle(cornerRadius: 15) .foregroundColor(Color.green) Text(title) .font(.headline) .padding() } } }
  26. struct PopoutAlertView: View { var body: some View { ZStack

    { RoundedRectangle(cornerRadius: 15) .foregroundColor(Color.green) .layoutPriority(-1) Text(title) .font(.headline) .padding() } } }
  27. None
  28. ありがとうございました Twitter My Apps