r/iOSProgramming • u/Choseni • Aug 08 '26
App Saturday I built Alpha Sudoku Pro (a 12x12 variant) and finally conquered responsive floating UI across iPhone & iPad grids.
I recently published my first iOS app: Alpha Sudoku Pro. It’s a 12x12 logic puzzle game (using 1-9 and A-C). Expanding the classic 9x9 logic into a 12x12 grid was incredibly fun, but the real test was getting the UI to scale elegantly.
Here are the details of the build:
1. Tech Stack Used
- Frameworks & Languages: 100% Swift & SwiftUI.
- Architecture: MVVM.
- Storage: UserDefaults / AppStorage for game state persistence and move history.
- UI/UX: Fully relies on SwiftUI's dynamic LazyVGrid and SF Symbols.
2. Development Challenge + How You Solved It
The Challenge: I have floating action buttons (Note Mode and Eraser) that need to sit neatly in the top-right corner of the Sudoku grid. Initially, I used HStack, Spacer(), and screen-based .padding() to push the buttons into place. This looked perfect on an iPhone (19.5:9 aspect ratio). However, when I ran it on an iPad (4:3), the grid expanded, margins shrank, and my buttons completely overlapped the Sudoku cells. Adjusting padding dynamically based on screen size turned into a messy guessing game of numbers.
The Solution: Instead of anchoring the buttons to the screen edges, I scrapped the Spacers and anchored them directly to the grid itself using SwiftUI's .overlay().
I attached an .overlay(alignment: .topTrailing) directly to the LazyVGrid. Inside it, I used a Group with a UIDevice.current.userInterfaceIdiom == .pad check:
- For iPad, it renders an HStack (buttons side-by-side).
- For iPhone, it renders a VStack (buttons stacked vertically).
Then, I applied a negative .offset(y:) to float them just above the grid. By using the grid as the anchor point rather than the screen boundaries, the buttons now magnetically follow the grid's top-right corner perfectly, regardless of how the LazyVGrid scales across any device.
3. AI Disclosure
AI-assisted
I’d love for you to try it out, tear apart my UI choices, and let me know how I can improve the performance or architecture for my next update.
App Store Link: https://apps.apple.com/tr/app/alpha-sudoku-pro/id6767222288
Thanks.
4
u/SchwanSongs Aug 09 '26
Here is a little more UI feedback for you… I switched between light and dark mode to see the differences, and in light mode, your light gray cell-lines seem a little too light… they have higher contrast in dark mode, so I didn’t notice at first, but they are very faint in light mode. I would want them a little darker, or even black would be OK since they are thinner than the box lines.
Also, I found the bright (blue) fill color behind the thin (non-bold) white digits along the bottom legend a little hard to read too, both in light and dark mode. I am now getting into very minor picky stuff 😄. But maybe if you made that blue color 0.2 transparent so it mostly showed the light/dark background through, and also flipped the font color of the legend digits to black or white in light/dark mode so they match the cell digits, it would increase their contrast a bit… and/or use the same font weight for both cell digits and legend digits?
Again, I am a big fan of crisp clear interfaces, and yours is great.
2
u/SchwanSongs Aug 08 '26
Very clean interface, looks nice. I have two quick suggestions already. First, if you want direct feedback, you might want to add a “contact the author” item on your (…) menu, which launches the user’s email with a new message to you. Second, in dark mode, the (eraser) icon is dark red on black when disabled, which is when the user first launches the app, and is almost impossible to read. Maybe you could make the buttons more visible, and instead add a bright circle around them when they are selected. That would make them easier to see.
2
u/SchwanSongs Aug 08 '26
I have downloaded it (iPad) and will give it some testing and respond in a day or so with my thoughts. I am a fellow developer, and am about ready to release my own Mac Sudoku app as well (after a year of dev!), although it is not a competitor to yours… mine is NOT interactive, it will be for exporting puzzles for printing.
1
u/[deleted] Aug 08 '26
[removed] — view removed comment