Here are some screenshot images which may help.
My GUI is shown in the image below:
And the code:
import SwiftUI
import UIKit
public struct ContentView6: View {
@State public var tabSelection = 2 // The app will open on this page.
public var body: some View {
TabView(selection: $tabSelection) {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
helpView()
.tabItem {
Image(systemName: "questionmark.circle.fill") // SF symbol
Text("Help") // Text beneath symbol
}
.tag(0) // 1st item on menu bar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
selectPhotoView()
.tabItem {
Image(systemName: "photo") // SF symbol
Text("Photos") // Text beneath symbol
}
.tag(1) // 2nd item on menu bar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
takePictureView()
.tabItem {
Image(systemName: "camera") // SF symbol
Text("Camera") // Text beneath symbol
}
.tag(2) // 3rd item on menu bar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
historyView()
.tabItem {
Image(systemName: "clock") // SF symbol
Text("History") // Text beneath symbol
}
.tag(3) // 4th item on menu bar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
settingsView()
.tabItem {
Image(systemName: "gearshape") // SF symbol
Text("Settings") // Text beneath symbol
}
.tag(4) // 5th item on menu bar
}
}
}
// Action on 'Help' tab:
struct helpView: View {
var body: some View {
ContentView5().edgesIgnoringSafeArea(.all) // Naviagtion Stacks (Help page)
}
}
// Action on 'Photos' tab:
struct selectPhotoView: View {
var body: some View {
storyboardview2().edgesIgnoringSafeArea(.all) // ViewController2 (Photos page)
}
}
// Action on 'Camera' tab:
struct takePictureView: View {
var body: some View {
storyboardview().edgesIgnoringSafeArea(.all) // ViewController (Camera page)
}
}
// Action on 'History' tab:
struct historyView: View {
var body: some View {
storyboardview3().edgesIgnoringSafeArea(.all) // ViewController3 = OCR - does not belog here (History page)
}
}
// Action on 'Settings' tab:
struct settingsView: View {
var body: some View {
//Tutorial().edgesIgnoringSafeArea(.all) // Tutorial - does not belong here (Settings page)
SettingsView()
}
}
struct ContentView6_Previews: PreviewProvider {
static var previews: some View {
ContentView6()
}
}
And the tutorial with the more info button is called on tab 0, this is under ContentView5. An image of this is shown below:
Topic:
Programming Languages
SubTopic:
Swift
Tags: