-
Notifications
You must be signed in to change notification settings - Fork 0
/
PickImageNailsViewController
41 lines (29 loc) · 1.18 KB
/
PickImageNailsViewController
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// PickImageNailsViewController.swift
// Treatably
//
// Created by Ívar Guðmundsson on 05/10/2020.
// Copyright © 2020 Treatably. All rights reserved.
//
import UIKit
class PickImageNailsViewController: UIViewController, UIImagePickerControllerDelegate & UINavigationControllerDelegate {
@IBOutlet weak var img1: UIImageView!
var imagePicker = UIImagePickerController()
override func viewDidLoad() {
super.viewDidLoad()
imagePicker.delegate = self
}
@IBAction func choose(_ sender: Any) {
imagePicker.sourceType = .photoLibrary
imagePicker.allowsEditing = true
present(imagePicker, animated:true , completion: nil)
}
}
extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
//func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]){
// if let image = info[UIImagePickerController.InfoKey.editedImage.rawValue] as? UIImage {
// img1.image = image;
// }
// dismiss(animated: true, completion: all(<#T##mask: SIMDMask<SIMD>##SIMDMask<SIMD>#>))
// }
}