This question already has answers here :
Delegate function has beed changed. Now it is
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
And You can get information from info dictionary as following
info[UIImagePickerController.InfoKey.mediaType]
and
info[UIImagePickerController.InfoKey.editedImage]
Hope this helps.
update(with:), Availability. Xcode 10.2+. Framework. Swift Standard Library Declaration. @discardableResult mutating func update(with newMember: Element) -> Element? The Swift compiler and runtime are fully embedded throughout Xcode, so your app is constantly being built and run. The design canvas you see isn’t just an approximation of your user interface — it’s your live app. And Xcode can swap edited code directly in your live app with “dynamic replacement”, a new feature in Swift. Previews.
Replace Your
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo Info: [String: Any]) {}
with
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {}
Swift 5 Release Notes for Xcode 10.2, Update your code to use new language features and test your apps against changes. Overview. Read these notes when you're writing Swift apps in Xcode 10.2. Swift packages are integrated throughout all of Xcode 11, making it incredibly simple to use a package in your apps for Apple platforms. Just add a new package dependency to add an external package to your project., then clone the package from GitHub, Bitbucket, GitLab, or your own code host.
You are getting the error because of changes in Swift 4.2 version.
Use this code:
func imagePickerController(_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
picker.dismiss(animated: true)
if let originalImage = info[.originalImage] as? UIImage {
print(originalImage)
}
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true)
}
Migrating to Swift 5, Migrating to Swift 5. Xcode 10.2 comes with a Swift Migrator tool that helps you migrate your project to Swift 5. For the previous release's Migration Guide, Open the app directory (right click->show package contents) of your xcode 10.2.1 app. Navigate to Xcode 10.2.1.app/Contents/ and edit the file Info.plist, change the Minimum System Version to 10.13.6 (it should have 10.14.3 originally written on it), make sure to save.
Download Swift, *Swift 2.2 is available as part of Xcode 7.3 release. Snapshots. Trunk Development (master). Development Snapshots are prebuilt binaries that are automatically Just visit the Apple Developer page for Xcode. If you download it from the Mac App Store, then updating Xcode becomes really easy since you can just download and install the update through the store. Download the latest version of Xcode from the Mac App Store.
How To Install New Swift Versions in Xcode, Xcode ships with Swift, but you are not limited to just that version. In fact, you may not be aware of this, but you can have multiple versions of Swift installed at any Downloading and Updating Xcode The current release of Xcode is available as a free download from the Mac App Store. The Mac App Store will notify you when an update is available or you can have macOS update automatically as it becomes available. The latest beta version and previous versions of Xcode can be downloaded from the Downloads page.
How to Update Xcode for a New Swift Release, If you need to load older versions, go to the Downloads tab at Xcode→Preferences to review what needs to be downloaded. The unchecked items are available for Xcode uses the selected toolchain for building Swift code, debugging, and even code completion and syntax coloring. You’ll see a new toolchain indicator in Xcode’s toolbar when Xcode is using a Swift toolchain. Select the Xcode toolchain to go back to Xcode’s built-in tools. Selecting a Swift toolchain affects the Xcode IDE only.