SwiftUI] Displaying Modal View in SwiftUI (Modal View)
Today, we will see how to launch Modal View in SwiftUI. How to do the following in SwiftUI to bring up a modal view with existing Objective-C? - ( IBAction )showMyModal { MyModal *myModal = [[MyModal alloc]initWithNibName: @"MyModal" bundle: nil ]; [myModal setModalTransitionStyle: UIModalTransitionStylePartialCurl ]; [ self presentModalViewController:myModal animated: YES ]; } First, create a SwiftUI project as an example and add a Button to the ContentView. import SwiftUI struct ContentView : View { var body: some View { VStack{ Text( "Hello, World!" ) Button(action: { print( "hello button!!" ) }) { Text( /*@START_MENU_TOKEN@*/ "Button" /*@END_MENU_TOKEN@*/ ) } } } } struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() } } Define the...