Last active
April 13, 2020 09:26
-
-
Save cgiacomi/5ffb41cc208a9be5c8b260c3dccd0196 to your computer and use it in GitHub Desktop.
This file contains 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 SampleView: View { | |
@State private var showOptionsMenu: Bool = false | |
var numbers = ["1","2","3","4","5","6","7","8"] | |
var body: some View { | |
ZStack { | |
List(self.numbers, id: \.self) { number in | |
Text(number) | |
} | |
// Reproduceable also by commenting this out and removing the HalfModalView | |
//Text("Hello") | |
// .frame(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height) | |
HalfModalView(isShown: $showOptionsMenu) { | |
Text("Hello") | |
} | |
} | |
.navigationBarTitle(Text("Nav Title")) | |
.navigationBarItems( | |
trailing: | |
Button(action: { | |
self.showOptionsMenu = true | |
}) { | |
Text("Options") | |
} | |
) | |
} | |
} | |
struct SampleView_Previews: PreviewProvider { | |
static var previews: some View { | |
NavigationView { | |
SampleView() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment