Skip to content

LicaGao/SwiftImagePickerDemo

Repository files navigation

SwiftImagePickerDemo

11月19日练习

  • 调用系统的相机和相册,模拟应用中用户更改头像的操作。使用 UIImagePickerControllerDelegate 和 UINavigationControllerDelegate 这两个代理,并调用完成图片选择的代理方法实现头像更改:
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        imgView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
        dismiss(animated: true, completion: nil)
    }

About

Swift 调用系统相册和相机 模仿更换用户头像

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages