Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the TestFlight beta testing process by importing the correct framework.
iOS Swift
import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing UIKit or SwiftUI instead of TestFlight.
Forgetting to import any framework.
✗ Incorrect
You need to import the TestFlight framework to access beta testing features in your iOS app.
2fill in blank
mediumComplete the code to present the TestFlight beta feedback interface to users.
iOS Swift
TestFlight.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method name that does not exist in TestFlight.
Confusing method names with similar words.
✗ Incorrect
The method showFeedback() presents the beta feedback interface to users in TestFlight.
3fill in blank
hardFix the error in the code to correctly check if the app is running in TestFlight beta environment.
iOS Swift
let isBeta = Bundle.main.appStoreReceiptURL?.path.[1]("sandboxReceipt") ?? false
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using contains which checks anywhere in the string.
Using non-existent methods like startsWith or endsWith.
✗ Incorrect
The method hasSuffix("sandboxReceipt") correctly checks if the receipt URL's path ends with 'sandboxReceipt', indicating TestFlight.
4fill in blank
hardFill both blanks to create a function that detects if the app is running via TestFlight.
iOS Swift
func isRunningTestFlight() -> Bool {
guard let url = Bundle.main.appStoreReceiptURL else { return false }
return url.path.[1]("sandboxReceipt") || url.path.[2]("sandboxReceipt")
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same method for both checks.
Using non-existent string methods.
✗ Incorrect
Use hasSuffix to check if the path ends with 'sandboxReceipt' and contains to check if it includes 'sandboxReceipt'.
5fill in blank
hardFill all three blanks to create a dictionary that maps beta tester emails to their testing status.
iOS Swift
let betaTesters = [ "alice@example.com": [1], "bob@example.com": [2], "carol@example.com": [3] ]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of Booleans.
Using nil which is not allowed in this dictionary.
✗ Incorrect
Use true for active testers and false for inactive. nil is not valid for Bool values in this dictionary.