Optional Device Lessons: Dice Foundry on a Physical iPhone
Everything in the main course runs in the iOS Simulator. These four lessons cover the checks the Simulator cannot do: installing the app on your own iPhone, feeling haptics, and testing accessibility by ear and at real text sizes. Each lesson says which chapter it follows, so you can do it as soon as the app exists, or leave it until later.
The course author has not run any of these lessons on hardware. The steps come from Apple's current documentation and from developer reports, and menus change between Xcode and iOS versions. Where a menu name differs on your phone, look for the closest match and check Apple's documentation.
Before you start
- A Mac with Xcode, the same setup as the main course.
- An iPhone running iOS 17.0 or later. That is Dice Foundry's minimum version (Chapter 1).
- A USB cable between the iPhone and the Mac.
- An Apple ID. Xcode can sign an app for your own phone with a free Apple ID. This is separate from a paid Apple Developer Program membership. Check Apple's current documentation for any limits on free signing, such as how long an installed app keeps running before you must reinstall it.
D1 — Run Dice Foundry on your iPhone
Useful after: Chapter 1. Any later checkpoint also works.
Goal: install your project on your own phone and launch it from Xcode.
- Add your Apple ID to Xcode. Open Xcode → Settings…, choose Accounts, click +, and sign in with your Apple ID. Xcode lists a personal team under your name.
- Set the signing team. In the project navigator, select the project, then the DiceFoundry target, and open Signing & Capabilities. Keep Automatically manage signing on, and choose your personal team in Team. Leave the simulator setting in Chapter 1 as it was; this step changes only your own project.
- Make the bundle identifier unique. If Xcode reports that the bundle identifier is unavailable, change it in the same tab to something only you use, for example
com.yourname.DiceFoundry. - Connect the iPhone. Plug it into the Mac, unlock it, and tap Trust on the phone if it asks whether to trust this computer. Enter the passcode if asked.
- Turn on Developer Mode. On the iPhone, go to Settings → Privacy & Security and scroll to the bottom. Turn on Developer Mode, then restart the phone and confirm when it asks. The Developer Mode switch may not appear until Xcode has seen the phone. If it is missing, select the phone as the run destination (step 6), then look again.
- Choose the phone as the run destination. In Xcode's toolbar, open the device menu and choose your iPhone instead of a simulator. Press ⌘R.
- Trust the developer on the phone. The first launch may fail with a message that the developer is not trusted. On the iPhone, go to Settings → General → VPN & Device Management, tap your developer name, and tap Trust. On iOS 18 and later the button may read Allow & Restart. Verifying trust needs an internet connection.
- Launch the app. Press ⌘R again if needed. Dice Foundry should open and roll.
Record what you saw:
- The project built and installed on my iPhone.
- The phone showed the developer as trusted and the app opened.
- Rolling works, and the history keeps the rolls after I quit and reopen the app.
If it fails: the signing error in Chapter 1 ("Signing for DiceFoundry requires a development team") means step 2 is not done. A message about the bundle identifier means step 3 is not done. If the developer never appears under VPN & Device Management, rebuild with ⌘R while the phone is connected and selected, then look again.
D2 — Feel the haptics
Useful after: Chapter 11, Part F (haptics). Requires D1 first.
Why this is a device lesson: haptics do not play in the Simulator, because the Mac has no Taptic Engine. Chapter 11 teaches the code, and this lesson is where you feel it.
Steps:
- Open Dice Foundry on your iPhone with the Haptic feedback toggle on. Tap Roll Dice. You should feel a medium tap on each roll.
- If you completed the Chapter 11 challenge, tap a different die button. You should feel a light tap for the selection.
- Turn the Haptic feedback toggle off. Roll again and tap a different die. You should feel nothing for either action.
- Quit the app from the app switcher, reopen it, and check that the toggle is still off. The setting is stored with
@AppStorage, so it should survive a relaunch. - Turn the toggle back on, and check that the roll tap returns.
If you feel nothing with the toggle on: check the phone's own haptic setting in Settings → Sounds & Haptics. Apple's name for it and its position can differ between iOS versions. Confirm that the toggle works with the phone's system setting on, and that you are not in a mode that suppresses it.
Record what you saw:
- A medium tap on each roll with the toggle on.
- A light tap on the die selection, if the Chapter 11 challenge is done.
- No tap for either action with the toggle off, including after a relaunch.
D3 — Accessibility on a physical iPhone
Useful after: Chapter 11, Part H (accessibility) and the Accessibility Inspector steps. Requires D1 first.
Why this is a device lesson: the Accessibility Inspector in Chapter 11 shows what VoiceOver would read. Only a real phone lets you hear it, and real text sizes and Reduce Motion are easiest to judge on the device you use every day.
VoiceOver by ear
- Turn on VoiceOver: Settings → Accessibility → VoiceOver, then switch it on. Apple also lets you set a triple-click shortcut under Settings → Accessibility → Accessibility Shortcut if you want to toggle it quickly. Apple's current documentation gives the exact button for your model.
- Open Dice Foundry. With VoiceOver on, you move with swipes and activate with a double-tap, so you cannot tap buttons normally.
- Swipe through the screen and listen for: - each die button, which should be spoken as, for example, "6-sided die", with the Selected state when chosen; - the result card, which should be read as one sentence, such as "Rolled 3D6 + 2. Total 14. Dice: 4, 2, 6."; - each history row, which should be one item, not several; - the header, which should be announced as a heading.
- Note any wording that sounds awkward. Chapter 11's labels are a reasoned starting point, and you may want to change the wording after listening.
- Turn VoiceOver off in the same place you turned it on. Use the shortcut if you set one up.
Dynamic Type at real sizes
- Go to Settings → Accessibility → Display & Text Size → Larger Text, and drag the slider up.
- Return to Dice Foundry and look for text that is cut off where it should not be, overlapping views, or chips that do not grow.
- Turn on Larger Accessibility Sizes and check the largest sizes. Long labels such as "Modifier: +20" may wrap to two lines, which is acceptable.
- Reset the text size when you finish.
Reduce Motion
- Go to Settings → Accessibility → Motion and turn on Reduce Motion.
- Return to Dice Foundry and roll. The circle should not spin, and the total should change instantly.
- Turn Reduce Motion off.
Home Screen icon
- Install the app with D1. Look at the icon on the Home Screen. It should be the dark rounded square with the gold d20.
- If you still see an old or blank icon, delete the app from the Home Screen and install it again. Chapter 11's warning about cached icons applies to the phone as well.
Record what you saw:
- VoiceOver read the die buttons, the result card and the history rows in a way I understood.
- Text stayed readable at my largest chosen size, and the layout did not overlap.
- Reduce Motion removed the spin and made the total change at once.
- The Home Screen icon matches the Chapter 11 icon.
D4 — Run the final project on your iPhone
Useful after: Chapter 14. Requires D1 first.
Goal: check the Chapter 14 features on hardware. Use the same project and signing as D1.
- Install the final project on your iPhone with the steps in D1, and launch it.
- Die picker. Check that seven dice appear, and that the D100 symbol shows as a symbol, not an empty box.
- D100 roll. Roll one D100. The notation should read
1D100, and the value should be between 1 and 100. Roll five D100 with a modifier of -3, and check that the total is the subtotal minus 3. - Natural maxima and minima. Roll D20 several times. Some chips should be marked as 20 and some as 1. Check that the marking is visible without relying on color alone, for example with the arrow symbols.
- VoiceOver on the result. Turn on VoiceOver as in D3, and listen to the result. When a roll includes a maximum or minimum, the spoken description should say how many dice reached each. Turn VoiceOver off afterward.
- History filter. Choose a die type and check that only its rolls appear. Choose a type with no rolls and check the "No rolls match this filter" message. Choose All dice again.
- Relaunch. Quit the app from the app switcher and reopen it. The history should show the same rolls, and the filter should return to All dice.
- Clear. Tap Clear and check that the history is empty, including rows the filter was hiding.
Record what you saw:
- Seven dice in the picker, and the D100 symbol renders.
- D100 rolls fall between 1 and 100, and the modifier arithmetic is right.
- Maximum and minimum chips are visible without color alone.
- VoiceOver reports the maximum and minimum counts.
- The filter shows the right rolls, and the empty-state messages are correct.
- After a relaunch, the history is the same and the filter is All dice.
If the D100 symbol shows as an empty box: the symbol name may not exist on your iOS version. Check it against SF Symbols on your Mac, and treat that as a finding to report rather than a fix to guess at.
What these lessons do not cover
- Testing on iPads, Macs or older iPhones.
- Dark Mode and Light Mode on the phone, which Chapter 11 covers in the Simulator.
- Installing for other people, through TestFlight or the App Store. Those need a paid developer membership and are outside this course.