Jun 14, 2024
viewDidLoad
boilerplate code.Choose Photo
action.UIImagePickerController
to access the photo library.picker.delegate = self
.UIImagePickerControllerDelegate
and UINavigationControllerDelegate
.navigationController.present(picker, animated: true, completion: nil)
when the choose photo button is clicked.imagePickerController(didFinishPickingMediaWithInfo:)
to get selected image and display it in the ImageView.navigationController.dismiss(animated: true, completion: nil)
.applySepia
action).CIFilter
) to apply sepia filter.UIImage
, CIImage
, CGImage
) as needed.applyNoir
and applyVintage
actions similar to applySepia
.CIFilter
and apply it to the selected image.Original
image state is managed properly.guard let
or if let
.