Add 'iOS/' from commit '938f0fb75860d3637b998bdd0c27dcffd9fc9451'

git-subtree-dir: iOS
git-subtree-mainline: c4bb775af4
git-subtree-split: 938f0fb758
This commit is contained in:
Tom Hicks
2025-06-30 12:55:22 -07:00
135 changed files with 7654 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
//
// EditBasicInfo.swift
// MonsterCards
//
// Created by Tom Hicks on 3/21/21.
//
import SwiftUI
struct EditBasicInfo: View {
@ObservedObject var monsterViewModel: MonsterViewModel
var body: some View {
List {
// Editable Text field bound to monster.name
MCTextField(
label: "Name",
value: $monsterViewModel.name)
.autocapitalization(.words)
// Editable Text field bound to monster.size
MCTextField(
label: "Size",
value: $monsterViewModel.size)
.autocapitalization(.words)
// Editable Text field bound to monster.type
MCTextField(
label: "Type",
value: $monsterViewModel.type)
.autocapitalization(.none)
// Editable Text field bound to monster.subType
MCTextField(
label: "Subtype",
value: $monsterViewModel.subType)
.autocapitalization(.none)
// Editable Text field bound to monster.alignment
MCTextField(
label: "Alignment",
value: $monsterViewModel.alignment)
.autocapitalization(.none)
// Number with -/+ buttons bound to monster.hitDice
MCStepperField(
label: "Hit Dice",
value: $monsterViewModel.hitDice)
// Toggle bound to monster.hasCustomHP?
Toggle(
"Has Custom HP",
isOn:$monsterViewModel.hasCustomHP)
// Editable Text field bound to monster.customHpText?
MCTextField(
label: "Custom HP",
value: $monsterViewModel.customHP)
.autocapitalization(.none)
}
.navigationTitle("Basic Info")
}
}
struct EditBasicInfo_Previews: PreviewProvider {
static var previews: some View {
let viewModel = MonsterViewModel.init(nil)
EditBasicInfo(monsterViewModel: viewModel)
}
}