Simple image picker.
This iOS swift SDK can pick image to your iOS swift project through gallery & camara.
Screen.Recording.2021-12-30.at.12.03.28.AM.mov
Pick image from Gallery.
Pick image from Camara.
Swift
iOS 9.0+
pod 'SwiftyImagePicker'
pod install
Open SwiftyImagePicker.xcworkspace
Select terget: SwiftyImagePickerExample
Update your info.plis by
KEY : NSCameraUsageDescription
Value : Use to camara access for take a selfi.
import UIKit
import SwiftyImagePicker
class ViewController: UIViewController {
@IBOutlet weak var pickedImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func pickImageButtonAction(_ sender: UIButton) {
let imagePik = SwiftyImagePicker()
imagePik.pickImage(self) { image in
DispatchQueue.main.async {
// picked image : process your picked image here
self.pickedImageView.image = image
}
}
}
}