***25:SwiftUI-Popover 模态弹出
正文
// // PopoverPage.swift // SwiftUIDeom // // Created by zhoukang03 on 2023/3/28. // import SwiftUI struct PopoverPage : View { @State var showPop = false var body: some View { VStack { Button(action: { self.showPop = true print(self.showPop) }) { Text("Popover").bold().font(.system(.largeTitle, design: .monospaced)) } .popover(isPresented: $showPop, content: { ImagePage() }) } } } #if DEBUG struct PopoverPage_Previews : PreviewProvider { static var previews: some View { PopoverPage() } } #endif
示例图
项目