Complete the code to set the app version in the Info.plist file.
let appVersion = (Bundle.main.infoDictionary as? NSDictionary)?[1]("CFBundleShortVersionString") as? String
The correct method to get a value from the infoDictionary is object(forKey:).
Complete the code to upload an app binary to App Store Connect using altool.
xcrun altool --[1] -f MyApp.ipa -t ios -u user@example.com -p app-specific-passwordThe correct command to upload an app with altool is upload-app.
Fix the error in the code to set the build number in Info.plist before submission.
if let infoPlistPath = Bundle.main.path(forResource: "Info", ofType: "plist") { var plist = NSMutableDictionary(contentsOfFile: infoPlistPath) plist?.setValue([1], forKey: "CFBundleVersion") plist?.write(toFile: infoPlistPath, atomically: true) }
The build number must be a string, so it should be quoted.
Fill both blanks to complete the code that checks if the app archive exists before uploading.
let fileManager = FileManager.default if fileManager.[1](atPath: "[2]") { print("Archive found, ready to upload.") }
The correct method is fileExists(atPath:) and the path is the archive name.
Fill all three blanks to complete the Swift code that prepares the app metadata dictionary for submission.
let metadata: [String: Any] = [ "[1]": "MyApp", "[2]": "1.0", "[3]": "This is a great app." ]
The keys for metadata are appName, version, and description.