Post

Replies

Boosts

Views

Activity

Reply to Switching Views in SwiftUI with a button.
This is the code: // //  ContentView.swift //  Computing History (1940s) // //  Created by _____ on 4/2/21. // import SwiftUI struct ContentView: View {     @State var showingEniacHistory = false     var body: some View {         if showingEniacHistory {                 ContentView()             } else {                 EniacHistory()             }         }                  VStack {             Text("Major Advances in Computing History - ENIAC & FRIENDS")                 .fontWeight(.bold)                 .multilineTextAlignment(.leading)                 .padding()             Spacer()             Text("Basic Info")                 .font(.subheadline)                 .fontWeight(.bold)             Spacer()             Text("The ENIAC was the first ever programmable computer. ENIAC stood for ''Electronic Numerical Integrator and Computer'' and it cost the government around $400,000 to build. It started comstruction in 1943, and was completed in 1945. It had 40 panels and took up a majority of the space of the 50 by 30 foot walls of the basement of the Moore School in Pensylvania. To say the least, It paved the way for a number of life altering devices. This app will inform you about the ENIAC and many other innovative and revolutionary computers.")                 .padding(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)             Spacer()             Button("Next Page") {                 showingEniacHistory = true             }                                                    }     } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21