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
struct ContentView: View { | |
init() { | |
// 背景色を指定 | |
UITabBar.appearance().barTintColor = UIColor.blue | |
// 選択していないアイテム色を指定 | |
UITabBar.appearance().unselectedItemTintColor = UIColor.green | |
} | |
var body: some View { |
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
struct ContentView: View { | |
/// タブの種類 | |
enum Tab { | |
case circle | |
case triangle | |
} | |
/// 選択中のタブ | |
@State private var selection: Tab = .circle | |
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 { | |
/// スイッチのオンオフ | |
@State var isOn: Bool = false | |
/// 選択した日付 | |
@State var selection: Date = Date() | |
var body: some View { | |
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 { | |
@State private var selection: Tab = .circle | |
var body: some View { | |
TabView(selection: $selection) { | |
Text("丸のビュー") | |
.tabItem { |
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
"name" = "Great Dane"; | |
"favoriteButton" = "Favorite"; |
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 { | |
// 進捗 | |
@State private var progress: Float = 0.3 | |
var body: some View { | |
VStack { | |
// 進捗ビュー (青) | |
CircleProgressView(progress: $progress, |
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 { | |
var body: some View { | |
VStack { | |
Text("ドッグマッチングアプリ") | |
.font(.subheadline) | |
.opacity(0.8) | |
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 { | |
/// ViewModel | |
@ObservedObject var viewModel = ContentViewModel(selection: .circle, isPresented: false) | |
/// 一つ前のタブ | |
/// シートが閉じた時に選択していたタブに戻る際に利用 | |
@State var oldSelection: Tab = .circle | |
var body: some View { |
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 | |
/// 犬の種類 | |
enum Dog { | |
/// 秋田犬 | |
case akitainu | |
/// 甲斐犬 | |
case kaiken | |
/// 名前 |
OlderNewer