hanmayz / Landmark-SwiftUI-Practice

SwiftUI Practice repo, following Apple's Tutorials (https://developer.apple.com/tutorials/swiftui/creating-and-combining-views).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Landmark-SwiftUI-Practice

SwiftUI Practice repo, following Apple's Tutorials (https://developer.apple.com/tutorials/swiftui/creating-and-combining-views).

Learning Outcome:

Screen Shot_iPhoneXR

Takeaway:

  • UIView can now be "converted" to SwiftUI View by conforming to UIViewRepresentable protocol.
  • SwiftUI View.offset(y: 100) is an equivalent to UIScrollView.contentOffset.y = 100.
  • SwiftUI View.edgesIgnoringSafeArea(.top) is an equivalent to
    UIScrollView.contentInset.top = -statusBarHeight or
    UIViewController.additionalSafeAreaInsets.top = -statusBarHeight or
    UIScrollview.contentInsetAdjustmentBehavior = .never.
  • Spacer() max out the gap inbetween Views.
  • Lots of syntactic sugar, sweet!

-tbc

About

SwiftUI Practice repo, following Apple's Tutorials (https://developer.apple.com/tutorials/swiftui/creating-and-combining-views).


Languages

Language:Swift 100.0%