Created
October 9, 2020 20:05
-
-
Save rudrankriyam/fec27c4113a9d1fe993e0b8df7264ff9 to your computer and use it in GitHub Desktop.
The new main view of gradient Game Raw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct GGMainView: View { | |
| @State private var showSheet = false | |
| var body: some View { | |
| VStack(spacing: 0) { | |
| ZStack(alignment: .center) { | |
| Text(RGBViewText.mainTitleText) | |
| .tracking(1.0) | |
| .font(.headline) | |
| HStack { | |
| Spacer() | |
| CustomNavigationButton(imageName: TabViewText.settingsImageName, accessibilityLabel: TabViewText.settingsTabName, action: { | |
| self.showSheet = true | |
| }) | |
| } | |
| .padding(.trailing) | |
| } | |
| .padding(.bottom, 8) | |
| RGBView() | |
| } | |
| .sheet(isPresented: $showSheet, content: { | |
| SettingsView() | |
| }) | |
| } | |
| } | |
| struct CustomNavigationButton: View { | |
| var imageName: String | |
| var accessibilityLabel: String | |
| var action: ()->() | |
| var body: some View { | |
| Button(action: { | |
| action() | |
| }, label: { | |
| Image(systemName: imageName) | |
| .font(.system(size: 20)) | |
| .frame(width: 40, height: 40, alignment: .center) | |
| .foregroundColor(.mainColor) | |
| .accessibility(label: Text(accessibilityLabel)) | |
| }) | |
| .buttonStyle(PlainButtonStyle()) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment