Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.07 KB

README.md

File metadata and controls

39 lines (32 loc) · 1.07 KB

Section

Header

var body: some View {
    NavigationView {
        Form {
            Section {
                TextField("Amount", text: $checkAmount)
                    .keyboardType(.decimalPad)
                Picker("Number of people", selection: $numberOfPeople) {
                    ForEach(2 ..< 100) {
                        Text("\($0) people")
                    }
                }
            }
            
            Section(header: Text("How much tip do you want to leave?")) {
                Picker("Tip percentage", selection: $tipPercentage) {
                    ForEach(0 ..< tipPercentages.count) {
                        Text("\(self.tipPercentages[$0])%")
                    }
                }.pickerStyle(SegmentedPickerStyle())
            }
            
            Section {
                Text("$\(checkAmount)")
            }
        }.navigationBarTitle("WeSplit")
    }
}

Links that help