r/iOSProgramming • Beginner • Oct 01 '26

Question Best place for a 'Next' button?

Post image

What's the most appropriate location for a next button here, in keeping with the Apple UI consistency and ecosystem?

Mockup:

NavigationStack {
	List {
		Section {
			TextField("Email Address", text: $email)
		} header: {
			VStack(alignment: .leading, spacing: 4) {
				Text("Sign In")
					.frame(maxWidth: .infinity, alignment: .leading)
					.padding(.top, 5)
					.font(.largeTitle)
					.bold()
					.foregroundColor(.primary) // Override default gray header color
				Text("Subtitle")//school.name)
					.frame(maxWidth: .infinity, alignment: .leading)
					.font(.title3)
					.foregroundColor(.secondary)
			}
			.listRowInsets(EdgeInsets())
			.textCase(nil) // Prevents SwiftUI from forcing ALL CAPS on the header
			.padding(.bottom, 10)
		}
	}
	.toolbar {
		ToolbarItem(placement:.confirmationAction) {
			NavigationLink() {
				VerificationCodeView(email: email.lowercased(), school: school, resend: { })
			} label: {
				Text("Next").padding(5)
			}
			.buttonStyle(.borderedProminent)
		}
	}
}
60 Upvotes

43 comments sorted by

View all comments

28

u/dat_tae Oct 01 '26

At the bottom (and moves up with the keyboard).

-1

u/Fun_Moose_5307 Beginner Oct 01 '26

How so? Draw it?
Also see edited post containing code

3

u/hiropark Oct 01 '26

Have you tried safeAreaInset(edge: .bottom)?

1

u/Fun_Moose_5307 Beginner Oct 01 '26

Not sure what the use of that would be?
Also see this second mockup, is that closer to what you are suggesting?

1

u/hiropark Oct 01 '26

Yes, that would be the result. The button stays at the bottom, but if the keyboard appears, the button goes up instead of being covered by the keyboard.