Created
October 24, 2024 01:52
-
-
Save takoikatakotako/41958918b251140de24276685314d95d to your computer and use it in GitHub Desktop.
NavigationViewの戻るボタンを非表示にする
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 ContentView: View { | |
let fruits = ["Apple", "Banana", "Orange", "Grape", "Cherry", "Peach"] | |
var body: some View { | |
NavigationView { | |
List(fruits, id: \.self) { fruit in | |
NavigationLink(destination: SecondView(fruit: fruit)) { | |
Text(fruit) | |
} | |
} | |
} | |
} | |
} |
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 SecondView: View { | |
let fruit: String | |
var body: some View { | |
Text(fruit) | |
.navigationBarBackButtonHidden(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment