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

Playing Sheet presentation style on iOS 13

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Playing Sheet presentation style on iOS 13

Avatar for Shin Yamamoto

Shin Yamamoto

July 24, 2019

More Decks by Shin Yamamoto

Other Decks in Programming

Transcript

  1. • iOS Developer • Freelancer • Creator of FloatingPanel Hi,

    I’m @scenee! https://github.com/SCENEE/FloatingPanel
  2. Sheet presentation style • New presentation style from iOS 13

    • Mail.app • .pageSheet,.formSheet • Default style in iOS 13 (SDK) ◦ .automatic ≒.pageSheet
  3. Sheet Fullscreen Content Non immersive 非没入型 Immersive 没入型 Dismiss •

    Tapping a button • Swiping down (optional) Tapping a button Modality: Sheet and Fullscreen https://developer.apple.com/design/human-interface-guidelines/ios/app-architecture/modality/
  4. Migration notes • Add a button to dismiss • Care

    the swipe-to-dismiss action • View Controller life cycle
  5. Presenting View Controller Life Cycle Sheet Fullscreen viewWillAppear -- Invoked

    viewDidAppear -- Invoked viewWillDisappear -- Invoked viewDidDisappear -- Invoked
  6. Presented View Controller Life Cycle Sheet Fullscreen viewWillAppear Invoked Invoked

    viewDidAppear Invoked Invoked viewWillDisappear Multiple invoked Invoked viewDidDisappear Invoked Invoked
  7. WWDC19 Sessions • What’s New in iOS Design https://developer.apple.com/videos/play/wwdc2019/808 •

    Modernizing Your UI for iOS 13 https://developer.apple.com/videos/play/wwdc2019/224
  8. • Disable to dismiss ◦ Set .isModalnPresentation to true ◦

    UIAdaptivePresentationControllerDelegate ▪ Return false in presentationControllerShouldDismiss Swipe to dismiss
  9. • Detect a dismiss action ◦ UIAdaptivePresentationControllerDelegate ▪ presentationControllerDidAttempToDismiss ▪

    presentationControllerWillDismiss ▪ presentationControllerDidDismiss Swipe to dismiss
  10. Recap • Sheet presentation style as default in iOS 13

    • A few APIs to customize the behavior • Imitate a task suspending UI using presentedView