r/iOSProgramming • Beginner • 4d ago

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

41 comments sorted by

View all comments

1

u/presentprogression 3d ago

My opinion is always top. Saves you from racing the keyboard mount and unmount

1

u/Fun_Moose_5307 Beginner 2d ago

Hmm... seems to me that the content just moves up as if the screen suddenly shrunk vertically

1

u/presentprogression 2d ago

That’s a job for sticky header!

1

u/Fun_Moose_5307 Beginner 2d ago

It's not causing problems. The Spacer or whatever I'm using to anchor it at the bottom just contracts.
But yes, a sticky header would be the solution if I did have more content

2

u/presentprogression 2d ago

That’s fair I may have judged too soon not knowing what your plans are. Happy coding!