SwiftUI - PresentationButton with modal that is full screen

后端 未结 6 2084
滥情空心
滥情空心 2020-12-08 10:18

I am trying to implement a button that presents another scene with a \"Slide from Botton\" animation.

PresentationButton looked like a good candidate, so I gave it

6条回答
  •  暖寄归人
    2020-12-08 11:02

    Xcode 12.0 - SwiftUI 2 - iOS 14

    Now possible. Use fullScreenCover() modifier.

    var body: some View {
        Button("Present!") {
            self.isPresented.toggle()
        }
        .fullScreenCover(isPresented: $isPresented, content: FullScreenModalView.init)
    }
    

    Hacking With Swift

提交回复
热议问题