0
0
iOS Swiftmobile~10 mins

App review guidelines in iOS Swift - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the app's display name in the Info.plist file.

iOS Swift
"CFBundle[1]Name" : "MyApp"
Drag options to blanks, or click blank then click option'
ADisplay
BVersion
CIdentifier
DExecutable
Attempts:
3 left
💡 Hint
Common Mistakes
Using CFBundleVersion instead, which is for version number.
2fill in blank
medium

Complete the code to request user permission for notifications.

iOS Swift
UNUserNotificationCenter.current().requestAuthorization(options: [.[1]]) { granted, error in
  // Handle response
}
Drag options to blanks, or click blank then click option'
Aalert, sound
Bbadge
Calert
Dsound
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'alert, sound' as a single option is invalid syntax here.
3fill in blank
hard

Fix the error in the code to check if the app has camera access permission.

iOS Swift
switch AVCaptureDevice.authorizationStatus(for: .[1]) {
case .authorized:
  print("Access granted")
default:
  print("Access denied")
}
Drag options to blanks, or click blank then click option'
Avideo
Baudio
Cphoto
Dcamera
Attempts:
3 left
💡 Hint
Common Mistakes
Using .camera or .photo which are invalid media types.
4fill in blank
hard

Fill both blanks to add a privacy usage description for camera access in Info.plist.

iOS Swift
"NS[1]UsageDescription" : "[2] is needed to take photos."
Drag options to blanks, or click blank then click option'
ACamera
BMicrophone
CCamera access
DLocation
Attempts:
3 left
💡 Hint
Common Mistakes
Using Microphone or Location keys instead of Camera.
5fill in blank
hard

Fill all three blanks to handle app review guideline compliance by checking if user agreed to terms before enabling features.

iOS Swift
if userDefaults.bool(forKey: "[1]") {
  enableFeature()
} else {
  showAlert(title: "[2]", message: "Please accept the [3] to continue.")
}
Drag options to blanks, or click blank then click option'
AtermsAccepted
BTerms of Service
Cterms
DprivacyPolicy
Attempts:
3 left
💡 Hint
Common Mistakes
Using privacyPolicy key or mismatched alert messages.