├── Image Picker
├── Assets.xcassets
│ ├── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── Icon-60.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ ├── Icon-Spotlight-40.png
│ │ ├── Icon-Spotlight-40@2x.png
│ │ ├── Icon-Spotlight-40@3x.png
│ │ └── Contents.json
│ └── test.imageset
│ │ ├── Screen Shot 2019-04-06 at 4.47.17 PM.png
│ │ └── Contents.json
├── Picker Controller
│ ├── ic_check.png
│ ├── ic_close.png
│ ├── SHCollectionViewCell.swift
│ ├── PickerController.swift
│ ├── SHCollectionViewCell.xib
│ ├── SHViewController.swift
│ └── SHViewController.xib
├── AppDelegate.swift
├── ViewController.swift
├── Info.plist
├── LaunchScreen.storyboard
└── Base.lproj
│ └── Main.storyboard
├── Image Picker.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── ajm.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── ajm.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── project.pbxproj
├── LICENSE
└── README.md
/Image Picker/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/ic_check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Picker Controller/ic_check.png
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/ic_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Picker Controller/ic_close.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/test.imageset/Screen Shot 2019-04-06 at 4.47.17 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker/Assets.xcassets/test.imageset/Screen Shot 2019-04-06 at 4.47.17 PM.png
--------------------------------------------------------------------------------
/Image Picker.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Image Picker.xcodeproj/project.xcworkspace/xcuserdata/ajm.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tryWabbit/Image-Picker/HEAD/Image Picker.xcodeproj/project.xcworkspace/xcuserdata/ajm.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Image Picker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/SHCollectionViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SHCollectionViewCell.swift
3 | // Pods
4 | //
5 | // Created by 母利 睦人 on 2017/01/04.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | class SHCollectionViewCell: UICollectionViewCell {
12 | @IBOutlet var filterNameLabel: UILabel!
13 | @IBOutlet var imageView: UIImageView!
14 | }
15 |
--------------------------------------------------------------------------------
/Image Picker.xcodeproj/xcuserdata/ajm.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Image Picker.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/test.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Screen Shot 2019-04-06 at 4.47.17 PM.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Image Picker/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Image Picker
4 | //
5 | // Created by ajm on 4/20/19.
6 | // Copyright © 2019 Wabbits. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 | var window: UIWindow?
14 |
15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16 | return true
17 | }
18 |
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/Image Picker/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // Image Picker
4 | //
5 | // Created by ajm on 4/20/19.
6 | // Copyright © 2019 Wabbits. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 | @IBOutlet weak var imageview: UIImageView!
13 |
14 | @IBAction func testButtonPressed(_ sender: UIButton) {
15 | let picker = PickerController()
16 | picker.applyFilter = true // to apply filter after selecting the picture by default false
17 | picker.selectImage(self){ image in
18 | DispatchQueue.main.async {
19 | self.imageview.image = image
20 | }
21 | }
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Wabbit
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Image Picker/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-Spotlight-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-Small@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-Small@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-Spotlight-40@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-Spotlight-40@3x.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-60@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-60@3x.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "idiom" : "ios-marketing",
53 | "size" : "1024x1024",
54 | "scale" : "1x"
55 | }
56 | ],
57 | "info" : {
58 | "version" : 1,
59 | "author" : "xcode"
60 | }
61 | }
--------------------------------------------------------------------------------
/Image Picker/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | NSCameraUsageDescription
28 | This app requires access to the camera.
29 | NSPhotoLibraryUsageDescription
30 | This app requires access to the photo library.
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Image-Picker
2 |
3 | Image Picker is a custom picker create by combining Sharaku library to retrieve an image either by Photo Library or Camera and apply beautiful filters.
4 |
5 | ---
6 |  
7 |
8 | 
9 |
10 | ## How to use?
11 | ### Step-1 - Add these keys into your Info.plist
12 |
13 | NSCameraUsageDescription
14 | This app requires access to the camera.
15 | NSPhotoLibraryUsageDescription
16 | This app requires access to the photo library.
17 |
18 | ### Step-2 - Copy the resources of Picker Controller folder in your project
19 | ### Step-3 - Initialise PickerController and enjoy
20 | let picker = PickerController()
21 | picker.applyFilter = true // to apply filter after selecting the picture by default false
22 | picker.selectImage(self){ image in
23 | DispatchQueue.main.async {
24 | self.imageview.image = image
25 | }
26 | }
27 |
28 |
29 | ---
30 | ### Sharaku Author
31 | #### [makomori](https://github.com/makomori/Sharaku), makomori26@gmail.com, Twitter: @makomori26
32 | ## MIT License
33 |
34 | Copyright (c) 2019 Wabbit
35 |
36 | Permission is hereby granted, free of charge, to any person obtaining a copy
37 | of this software and associated documentation files (the "Software"), to deal
38 | in the Software without restriction, including without limitation the rights
39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40 | copies of the Software, and to permit persons to whom the Software is
41 | furnished to do so, subject to the following conditions:
42 |
43 |
44 | The above copyright notice and this permission notice shall be included in all
45 | copies or substantial portions of the Software.
46 |
47 | The Software Is Provided "As Is", Without Warranty Of Any Kind, Express Or
48 | Implied, Including But Not Limited To The Warranties Of Merchantability,
49 | Fitness For A Particular Purpose And Noninfringement. In No Event Shall The
50 | Authors Or Copyright Holders Be Liable For Any Claim, Damages Or Other
51 | Liability, Whether In An Action Of Contract, Tort Or Otherwise, Arising From,
52 | Out Of Or In Connection With The Software Or The Use Or Other Dealings In The Software.
53 |
54 |
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/PickerController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PickerController.swift
3 | // Image Picker
4 | //
5 | // Created by ajm on 4/20/19.
6 | // Copyright © 2019 Wabbits. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | class PickerController: NSObject {
11 |
12 | var picker = UIImagePickerController();
13 | var alert = UIAlertController(title: "Select any option", message: nil, preferredStyle: .actionSheet)
14 | var viewController: UIViewController?
15 | var pickImageCallback : ((UIImage) -> ())?;
16 | var applyFilter : Bool = false
17 |
18 | func selectImage(_ viewController: UIViewController, _ callback: @escaping ((UIImage) -> ())) {
19 | pickImageCallback = callback;
20 | self.viewController = viewController;
21 |
22 | let cameraAction = UIAlertAction(title: "Camera", style: .default){
23 | UIAlertAction in
24 | self.openCamera()
25 | }
26 | let gallaryAction = UIAlertAction(title: "Gallary", style: .default){
27 | UIAlertAction in
28 | self.openGallery()
29 | }
30 | let cancelAction = UIAlertAction(title: "Cancel", style: .cancel){
31 | UIAlertAction in
32 | }
33 |
34 | picker.delegate = self
35 | alert.addAction(cameraAction)
36 | alert.addAction(gallaryAction)
37 | alert.addAction(cancelAction)
38 | alert.popoverPresentationController?.sourceView = self.viewController!.view
39 | viewController.present(alert, animated: true, completion: nil)
40 | }
41 | func openCamera(){
42 | alert.dismiss(animated: true, completion: nil)
43 | if(UIImagePickerController .isSourceTypeAvailable(.camera)){
44 | picker.sourceType = .camera
45 | self.viewController!.present(picker, animated: true, completion: nil)
46 | }
47 | }
48 | func openGallery(){
49 | picker.sourceType = .photoLibrary
50 | picker.allowsEditing = false
51 | self.viewController!.present(picker, animated: true, completion: nil)
52 | }
53 | }
54 | extension PickerController: SHViewControllerDelegate {
55 | func shViewControllerImageDidFilter(image: UIImage) {
56 | pickImageCallback?(image)
57 | }
58 |
59 | func shViewControllerDidCancel() {
60 | }
61 | }
62 | extension PickerController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
63 | func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
64 | picker.dismiss(animated: true, completion: nil)
65 | }
66 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
67 | picker.dismiss(animated: true, completion: nil)
68 | guard let image = info[.originalImage] as? UIImage else { return }
69 | if applyFilter {
70 | DispatchQueue.main.async {
71 | let image = info[UIImagePickerController.InfoKey.originalImage] as! UIImage
72 | let vc = SHViewController(image: image)
73 | vc.delegate = self
74 | self.viewController!.present(vc, animated: true, completion: nil)
75 | }
76 | }else {
77 | pickImageCallback?(image)
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Image Picker/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/SHCollectionViewCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Image Picker/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/SHViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SHViewController.swift
3 | // Pods
4 | //
5 | // Created by 母利 睦人 on 2017/01/04.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | public protocol SHViewControllerDelegate {
12 | func shViewControllerImageDidFilter(image: UIImage)
13 | func shViewControllerDidCancel()
14 | }
15 |
16 | open class SHViewController: UIViewController {
17 | public var delegate: SHViewControllerDelegate?
18 | fileprivate let filterNameList = [
19 | "No Filter",
20 | "CIPhotoEffectChrome",
21 | "CIPhotoEffectFade",
22 | "CIPhotoEffectInstant",
23 | "CIPhotoEffectMono",
24 | "CIPhotoEffectNoir",
25 | "CIPhotoEffectProcess",
26 | "CIPhotoEffectTonal",
27 | "CIPhotoEffectTransfer",
28 | "CILinearToSRGBToneCurve",
29 | "CISRGBToneCurveToLinear"
30 | ]
31 |
32 | fileprivate let filterDisplayNameList = [
33 | "Normal",
34 | "Chrome",
35 | "Fade",
36 | "Instant",
37 | "Mono",
38 | "Noir",
39 | "Process",
40 | "Tonal",
41 | "Transfer",
42 | "Tone",
43 | "Linear"
44 | ]
45 |
46 | fileprivate var filterIndex = 0
47 | fileprivate let context = CIContext(options: nil)
48 | @IBOutlet var imageView: UIImageView?
49 | @IBOutlet var collectionView: UICollectionView?
50 | fileprivate var image: UIImage?
51 | fileprivate var smallImage: UIImage?
52 |
53 | public init(image: UIImage) {
54 | super.init(nibName: nil, bundle: nil)
55 | self.image = image
56 | }
57 |
58 | required public init?(coder aDecoder: NSCoder) {
59 | fatalError("init(coder:) has not been implemented")
60 | }
61 |
62 | override open func loadView() {
63 | if let view = UINib(nibName: "SHViewController", bundle: Bundle(for: self.classForCoder)).instantiate(withOwner: self, options: nil).first as? UIView {
64 | self.view = view
65 | if let image = self.image {
66 | imageView?.image = image
67 | smallImage = resizeImage(image: image)
68 | }
69 | }
70 | }
71 |
72 | override open func viewDidLoad() {
73 | super.viewDidLoad()
74 | let nib = UINib(nibName: "SHCollectionViewCell", bundle: Bundle(for: self.classForCoder))
75 | collectionView?.register(nib, forCellWithReuseIdentifier: "cell")
76 | }
77 |
78 | @IBAction func imageViewDidSwipeLeft() {
79 | if filterIndex == filterNameList.count - 1 {
80 | filterIndex = 0
81 | imageView?.image = image
82 | } else {
83 | filterIndex += 1
84 | }
85 | if filterIndex != 0 {
86 | applyFilter()
87 | }
88 | updateCellFont()
89 | scrollCollectionViewToIndex(itemIndex: filterIndex)
90 | }
91 |
92 | @IBAction func imageViewDidSwipeRight() {
93 | if filterIndex == 0 {
94 | filterIndex = filterNameList.count - 1
95 | } else {
96 | filterIndex -= 1
97 | }
98 | if filterIndex != 0 {
99 | applyFilter()
100 | } else {
101 | imageView?.image = image
102 | }
103 | updateCellFont()
104 | scrollCollectionViewToIndex(itemIndex: filterIndex)
105 | }
106 |
107 | func applyFilter() {
108 | let filterName = filterNameList[filterIndex]
109 | if let image = self.image {
110 | let filteredImage = createFilteredImage(filterName: filterName, image: image)
111 | imageView?.image = filteredImage
112 | }
113 | }
114 |
115 | func createFilteredImage(filterName: String, image: UIImage) -> UIImage {
116 | // 1 - create source image
117 | let sourceImage = CIImage(image: image)
118 |
119 | // 2 - create filter using name
120 | let filter = CIFilter(name: filterName)
121 | filter?.setDefaults()
122 |
123 | // 3 - set source image
124 | filter?.setValue(sourceImage, forKey: kCIInputImageKey)
125 |
126 | // 4 - output filtered image as cgImage with dimension.
127 | let outputCGImage = context.createCGImage((filter?.outputImage!)!, from: (filter?.outputImage!.extent)!)
128 |
129 | // 5 - convert filtered CGImage to UIImage
130 | let filteredImage = UIImage(cgImage: outputCGImage!, scale: image.scale, orientation: image.imageOrientation)
131 |
132 | return filteredImage
133 | }
134 |
135 | func resizeImage(image: UIImage) -> UIImage {
136 | let ratio: CGFloat = 0.3
137 | let resizedSize = CGSize(width: Int(image.size.width * ratio), height: Int(image.size.height * ratio))
138 | UIGraphicsBeginImageContext(resizedSize)
139 | image.draw(in: CGRect(x: 0, y: 0, width: resizedSize.width, height: resizedSize.height))
140 | let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
141 | UIGraphicsEndImageContext()
142 | return resizedImage!
143 | }
144 |
145 | @IBAction func closeButtonTapped() {
146 | if let delegate = self.delegate {
147 | delegate.shViewControllerDidCancel()
148 | }
149 | dismiss(animated: true, completion: nil)
150 | }
151 |
152 | @IBAction func doneButtontapped() {
153 | if let delegate = self.delegate {
154 | delegate.shViewControllerImageDidFilter(image: (imageView?.image)!)
155 | }
156 | dismiss(animated: true, completion: nil)
157 | }
158 | }
159 |
160 | extension SHViewController: UICollectionViewDataSource, UICollectionViewDelegate
161 | {
162 | public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
163 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! SHCollectionViewCell
164 | var filteredImage = smallImage
165 | if indexPath.row != 0 {
166 | filteredImage = createFilteredImage(filterName: filterNameList[indexPath.row], image: smallImage!)
167 | }
168 |
169 | cell.imageView.image = filteredImage
170 | cell.filterNameLabel.text = filterDisplayNameList[indexPath.row]
171 | updateCellFont()
172 | return cell
173 | }
174 |
175 | public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
176 | return filterNameList.count
177 | }
178 |
179 | public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
180 | filterIndex = indexPath.row
181 | if filterIndex != 0 {
182 | applyFilter()
183 | } else {
184 | imageView?.image = image
185 | }
186 | updateCellFont()
187 | scrollCollectionViewToIndex(itemIndex: indexPath.item)
188 | }
189 |
190 | func updateCellFont() {
191 | // update font of selected cell
192 | if let selectedCell = collectionView?.cellForItem(at: IndexPath(row: filterIndex, section: 0)) {
193 | let cell = selectedCell as! SHCollectionViewCell
194 | cell.filterNameLabel.font = UIFont.boldSystemFont(ofSize: 14)
195 | }
196 |
197 | for i in 0...filterNameList.count - 1 {
198 | if i != filterIndex {
199 | // update nonselected cell font
200 | if let unselectedCell = collectionView?.cellForItem(at: IndexPath(row: i, section: 0)) {
201 | let cell = unselectedCell as! SHCollectionViewCell
202 | if #available(iOS 8.2, *) {
203 | cell.filterNameLabel.font = UIFont.systemFont(ofSize: 14.0, weight: UIFont.Weight.thin)
204 | } else {
205 | // Fallback on earlier versions
206 | cell.filterNameLabel.font = UIFont.systemFont(ofSize: 14.0)
207 | }
208 | }
209 | }
210 | }
211 | }
212 |
213 | func scrollCollectionViewToIndex(itemIndex: Int) {
214 | let indexPath = IndexPath(item: itemIndex, section: 0)
215 | self.collectionView?.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
216 | }
217 | }
218 |
--------------------------------------------------------------------------------
/Image Picker/Picker Controller/SHViewController.xib:
--------------------------------------------------------------------------------
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 |
36 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Image Picker.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1197D6F422A4F417007ED9DE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1197D6F322A4F417007ED9DE /* LaunchScreen.storyboard */; };
11 | 11CAD0D9226B217800E5702D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CAD0D8226B217800E5702D /* AppDelegate.swift */; };
12 | 11CAD0DB226B217800E5702D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CAD0DA226B217800E5702D /* ViewController.swift */; };
13 | 11CAD0DE226B217800E5702D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD0DC226B217800E5702D /* Main.storyboard */; };
14 | 11CAD0E0226B217A00E5702D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD0DF226B217A00E5702D /* Assets.xcassets */; };
15 | 11CAD0EB226B21B400E5702D /* PickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CAD0EA226B21B400E5702D /* PickerController.swift */; };
16 | 11CAD0EF226B2A5400E5702D /* SHViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CAD0EE226B2A5400E5702D /* SHViewController.swift */; };
17 | 11CAD0F7226B2A7800E5702D /* SHCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CAD0F4226B2A7800E5702D /* SHCollectionViewCell.swift */; };
18 | 11CAD0F8226B2A7800E5702D /* SHCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD0F5226B2A7800E5702D /* SHCollectionViewCell.xib */; };
19 | 11CAD0F9226B2A7800E5702D /* SHViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD0F6226B2A7800E5702D /* SHViewController.xib */; };
20 | 11CAD118226B304500E5702D /* ic_check.png in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD112226B304500E5702D /* ic_check.png */; };
21 | 11CAD119226B304500E5702D /* ic_close.png in Resources */ = {isa = PBXBuildFile; fileRef = 11CAD113226B304500E5702D /* ic_close.png */; };
22 | /* End PBXBuildFile section */
23 |
24 | /* Begin PBXFileReference section */
25 | 1197D6F322A4F417007ED9DE /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; };
26 | 11CAD0D5226B217800E5702D /* Image Picker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Image Picker.app"; sourceTree = BUILT_PRODUCTS_DIR; };
27 | 11CAD0D8226B217800E5702D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
28 | 11CAD0DA226B217800E5702D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
29 | 11CAD0DD226B217800E5702D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
30 | 11CAD0DF226B217A00E5702D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
31 | 11CAD0E4226B217A00E5702D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
32 | 11CAD0EA226B21B400E5702D /* PickerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerController.swift; sourceTree = ""; };
33 | 11CAD0EE226B2A5400E5702D /* SHViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHViewController.swift; sourceTree = ""; };
34 | 11CAD0F4226B2A7800E5702D /* SHCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHCollectionViewCell.swift; sourceTree = ""; };
35 | 11CAD0F5226B2A7800E5702D /* SHCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SHCollectionViewCell.xib; sourceTree = ""; };
36 | 11CAD0F6226B2A7800E5702D /* SHViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SHViewController.xib; sourceTree = ""; };
37 | 11CAD112226B304500E5702D /* ic_check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_check.png; sourceTree = ""; };
38 | 11CAD113226B304500E5702D /* ic_close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_close.png; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | 11CAD0D2226B217800E5702D /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | /* End PBXFrameworksBuildPhase section */
50 |
51 | /* Begin PBXGroup section */
52 | 11CAD0CC226B217800E5702D = {
53 | isa = PBXGroup;
54 | children = (
55 | 11CAD0D7226B217800E5702D /* Image Picker */,
56 | 11CAD0D6226B217800E5702D /* Products */,
57 | );
58 | sourceTree = "";
59 | };
60 | 11CAD0D6226B217800E5702D /* Products */ = {
61 | isa = PBXGroup;
62 | children = (
63 | 11CAD0D5226B217800E5702D /* Image Picker.app */,
64 | );
65 | name = Products;
66 | sourceTree = "";
67 | };
68 | 11CAD0D7226B217800E5702D /* Image Picker */ = {
69 | isa = PBXGroup;
70 | children = (
71 | 11CAD0D8226B217800E5702D /* AppDelegate.swift */,
72 | 11CAD0DA226B217800E5702D /* ViewController.swift */,
73 | 11CAD0EC226B294400E5702D /* Picker Controller */,
74 | 11CAD0DC226B217800E5702D /* Main.storyboard */,
75 | 11CAD0DF226B217A00E5702D /* Assets.xcassets */,
76 | 1197D6F322A4F417007ED9DE /* LaunchScreen.storyboard */,
77 | 11CAD0E4226B217A00E5702D /* Info.plist */,
78 | );
79 | path = "Image Picker";
80 | sourceTree = "";
81 | };
82 | 11CAD0EC226B294400E5702D /* Picker Controller */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 11CAD112226B304500E5702D /* ic_check.png */,
86 | 11CAD113226B304500E5702D /* ic_close.png */,
87 | 11CAD0EA226B21B400E5702D /* PickerController.swift */,
88 | 11CAD0EE226B2A5400E5702D /* SHViewController.swift */,
89 | 11CAD0F5226B2A7800E5702D /* SHCollectionViewCell.xib */,
90 | 11CAD0F4226B2A7800E5702D /* SHCollectionViewCell.swift */,
91 | 11CAD0F6226B2A7800E5702D /* SHViewController.xib */,
92 | );
93 | path = "Picker Controller";
94 | sourceTree = "";
95 | };
96 | /* End PBXGroup section */
97 |
98 | /* Begin PBXNativeTarget section */
99 | 11CAD0D4226B217800E5702D /* Image Picker */ = {
100 | isa = PBXNativeTarget;
101 | buildConfigurationList = 11CAD0E7226B217A00E5702D /* Build configuration list for PBXNativeTarget "Image Picker" */;
102 | buildPhases = (
103 | 11CAD0D1226B217800E5702D /* Sources */,
104 | 11CAD0D2226B217800E5702D /* Frameworks */,
105 | 11CAD0D3226B217800E5702D /* Resources */,
106 | );
107 | buildRules = (
108 | );
109 | dependencies = (
110 | );
111 | name = "Image Picker";
112 | productName = "Image Picker";
113 | productReference = 11CAD0D5226B217800E5702D /* Image Picker.app */;
114 | productType = "com.apple.product-type.application";
115 | };
116 | /* End PBXNativeTarget section */
117 |
118 | /* Begin PBXProject section */
119 | 11CAD0CD226B217800E5702D /* Project object */ = {
120 | isa = PBXProject;
121 | attributes = {
122 | LastSwiftUpdateCheck = 1000;
123 | LastUpgradeCheck = 1000;
124 | ORGANIZATIONNAME = Wabbits;
125 | TargetAttributes = {
126 | 11CAD0D4226B217800E5702D = {
127 | CreatedOnToolsVersion = 10.0;
128 | };
129 | };
130 | };
131 | buildConfigurationList = 11CAD0D0226B217800E5702D /* Build configuration list for PBXProject "Image Picker" */;
132 | compatibilityVersion = "Xcode 9.3";
133 | developmentRegion = en;
134 | hasScannedForEncodings = 0;
135 | knownRegions = (
136 | en,
137 | Base,
138 | );
139 | mainGroup = 11CAD0CC226B217800E5702D;
140 | productRefGroup = 11CAD0D6226B217800E5702D /* Products */;
141 | projectDirPath = "";
142 | projectRoot = "";
143 | targets = (
144 | 11CAD0D4226B217800E5702D /* Image Picker */,
145 | );
146 | };
147 | /* End PBXProject section */
148 |
149 | /* Begin PBXResourcesBuildPhase section */
150 | 11CAD0D3226B217800E5702D /* Resources */ = {
151 | isa = PBXResourcesBuildPhase;
152 | buildActionMask = 2147483647;
153 | files = (
154 | 11CAD119226B304500E5702D /* ic_close.png in Resources */,
155 | 1197D6F422A4F417007ED9DE /* LaunchScreen.storyboard in Resources */,
156 | 11CAD0F9226B2A7800E5702D /* SHViewController.xib in Resources */,
157 | 11CAD0E0226B217A00E5702D /* Assets.xcassets in Resources */,
158 | 11CAD118226B304500E5702D /* ic_check.png in Resources */,
159 | 11CAD0DE226B217800E5702D /* Main.storyboard in Resources */,
160 | 11CAD0F8226B2A7800E5702D /* SHCollectionViewCell.xib in Resources */,
161 | );
162 | runOnlyForDeploymentPostprocessing = 0;
163 | };
164 | /* End PBXResourcesBuildPhase section */
165 |
166 | /* Begin PBXSourcesBuildPhase section */
167 | 11CAD0D1226B217800E5702D /* Sources */ = {
168 | isa = PBXSourcesBuildPhase;
169 | buildActionMask = 2147483647;
170 | files = (
171 | 11CAD0F7226B2A7800E5702D /* SHCollectionViewCell.swift in Sources */,
172 | 11CAD0EB226B21B400E5702D /* PickerController.swift in Sources */,
173 | 11CAD0DB226B217800E5702D /* ViewController.swift in Sources */,
174 | 11CAD0D9226B217800E5702D /* AppDelegate.swift in Sources */,
175 | 11CAD0EF226B2A5400E5702D /* SHViewController.swift in Sources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXSourcesBuildPhase section */
180 |
181 | /* Begin PBXVariantGroup section */
182 | 11CAD0DC226B217800E5702D /* Main.storyboard */ = {
183 | isa = PBXVariantGroup;
184 | children = (
185 | 11CAD0DD226B217800E5702D /* Base */,
186 | );
187 | name = Main.storyboard;
188 | sourceTree = "";
189 | };
190 | /* End PBXVariantGroup section */
191 |
192 | /* Begin XCBuildConfiguration section */
193 | 11CAD0E5226B217A00E5702D /* Debug */ = {
194 | isa = XCBuildConfiguration;
195 | buildSettings = {
196 | ALWAYS_SEARCH_USER_PATHS = NO;
197 | CLANG_ANALYZER_NONNULL = YES;
198 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
200 | CLANG_CXX_LIBRARY = "libc++";
201 | CLANG_ENABLE_MODULES = YES;
202 | CLANG_ENABLE_OBJC_ARC = YES;
203 | CLANG_ENABLE_OBJC_WEAK = YES;
204 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
205 | CLANG_WARN_BOOL_CONVERSION = YES;
206 | CLANG_WARN_COMMA = YES;
207 | CLANG_WARN_CONSTANT_CONVERSION = YES;
208 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
211 | CLANG_WARN_EMPTY_BODY = YES;
212 | CLANG_WARN_ENUM_CONVERSION = YES;
213 | CLANG_WARN_INFINITE_RECURSION = YES;
214 | CLANG_WARN_INT_CONVERSION = YES;
215 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
216 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
217 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
218 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
219 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
220 | CLANG_WARN_STRICT_PROTOTYPES = YES;
221 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
222 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
223 | CLANG_WARN_UNREACHABLE_CODE = YES;
224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
225 | CODE_SIGN_IDENTITY = "iPhone Developer";
226 | COPY_PHASE_STRIP = NO;
227 | DEBUG_INFORMATION_FORMAT = dwarf;
228 | ENABLE_STRICT_OBJC_MSGSEND = YES;
229 | ENABLE_TESTABILITY = YES;
230 | GCC_C_LANGUAGE_STANDARD = gnu11;
231 | GCC_DYNAMIC_NO_PIC = NO;
232 | GCC_NO_COMMON_BLOCKS = YES;
233 | GCC_OPTIMIZATION_LEVEL = 0;
234 | GCC_PREPROCESSOR_DEFINITIONS = (
235 | "DEBUG=1",
236 | "$(inherited)",
237 | );
238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
240 | GCC_WARN_UNDECLARED_SELECTOR = YES;
241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
242 | GCC_WARN_UNUSED_FUNCTION = YES;
243 | GCC_WARN_UNUSED_VARIABLE = YES;
244 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
245 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
246 | MTL_FAST_MATH = YES;
247 | ONLY_ACTIVE_ARCH = YES;
248 | SDKROOT = iphoneos;
249 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
250 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
251 | };
252 | name = Debug;
253 | };
254 | 11CAD0E6226B217A00E5702D /* Release */ = {
255 | isa = XCBuildConfiguration;
256 | buildSettings = {
257 | ALWAYS_SEARCH_USER_PATHS = NO;
258 | CLANG_ANALYZER_NONNULL = YES;
259 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
261 | CLANG_CXX_LIBRARY = "libc++";
262 | CLANG_ENABLE_MODULES = YES;
263 | CLANG_ENABLE_OBJC_ARC = YES;
264 | CLANG_ENABLE_OBJC_WEAK = YES;
265 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
266 | CLANG_WARN_BOOL_CONVERSION = YES;
267 | CLANG_WARN_COMMA = YES;
268 | CLANG_WARN_CONSTANT_CONVERSION = YES;
269 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
271 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
272 | CLANG_WARN_EMPTY_BODY = YES;
273 | CLANG_WARN_ENUM_CONVERSION = YES;
274 | CLANG_WARN_INFINITE_RECURSION = YES;
275 | CLANG_WARN_INT_CONVERSION = YES;
276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
281 | CLANG_WARN_STRICT_PROTOTYPES = YES;
282 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
283 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
284 | CLANG_WARN_UNREACHABLE_CODE = YES;
285 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
286 | CODE_SIGN_IDENTITY = "iPhone Developer";
287 | COPY_PHASE_STRIP = NO;
288 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
289 | ENABLE_NS_ASSERTIONS = NO;
290 | ENABLE_STRICT_OBJC_MSGSEND = YES;
291 | GCC_C_LANGUAGE_STANDARD = gnu11;
292 | GCC_NO_COMMON_BLOCKS = YES;
293 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
294 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
295 | GCC_WARN_UNDECLARED_SELECTOR = YES;
296 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
297 | GCC_WARN_UNUSED_FUNCTION = YES;
298 | GCC_WARN_UNUSED_VARIABLE = YES;
299 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
300 | MTL_ENABLE_DEBUG_INFO = NO;
301 | MTL_FAST_MATH = YES;
302 | SDKROOT = iphoneos;
303 | SWIFT_COMPILATION_MODE = wholemodule;
304 | SWIFT_OPTIMIZATION_LEVEL = "-O";
305 | VALIDATE_PRODUCT = YES;
306 | };
307 | name = Release;
308 | };
309 | 11CAD0E8226B217A00E5702D /* Debug */ = {
310 | isa = XCBuildConfiguration;
311 | buildSettings = {
312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
313 | CODE_SIGN_STYLE = Manual;
314 | DEVELOPMENT_TEAM = C888B5AFSW;
315 | INFOPLIST_FILE = "Image Picker/Info.plist";
316 | LD_RUNPATH_SEARCH_PATHS = (
317 | "$(inherited)",
318 | "@executable_path/Frameworks",
319 | );
320 | PRODUCT_BUNDLE_IDENTIFIER = "Wabbits.Image-Picker";
321 | PRODUCT_NAME = "$(TARGET_NAME)";
322 | PROVISIONING_PROFILE_SPECIFIER = "2016_11_21 Test Profile";
323 | SWIFT_VERSION = 4.2;
324 | TARGETED_DEVICE_FAMILY = "1,2";
325 | };
326 | name = Debug;
327 | };
328 | 11CAD0E9226B217A00E5702D /* Release */ = {
329 | isa = XCBuildConfiguration;
330 | buildSettings = {
331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
332 | CODE_SIGN_STYLE = Manual;
333 | DEVELOPMENT_TEAM = "";
334 | INFOPLIST_FILE = "Image Picker/Info.plist";
335 | LD_RUNPATH_SEARCH_PATHS = (
336 | "$(inherited)",
337 | "@executable_path/Frameworks",
338 | );
339 | PRODUCT_BUNDLE_IDENTIFIER = "Wabbits.Image-Picker";
340 | PRODUCT_NAME = "$(TARGET_NAME)";
341 | PROVISIONING_PROFILE_SPECIFIER = "";
342 | SWIFT_VERSION = 4.2;
343 | TARGETED_DEVICE_FAMILY = "1,2";
344 | };
345 | name = Release;
346 | };
347 | /* End XCBuildConfiguration section */
348 |
349 | /* Begin XCConfigurationList section */
350 | 11CAD0D0226B217800E5702D /* Build configuration list for PBXProject "Image Picker" */ = {
351 | isa = XCConfigurationList;
352 | buildConfigurations = (
353 | 11CAD0E5226B217A00E5702D /* Debug */,
354 | 11CAD0E6226B217A00E5702D /* Release */,
355 | );
356 | defaultConfigurationIsVisible = 0;
357 | defaultConfigurationName = Release;
358 | };
359 | 11CAD0E7226B217A00E5702D /* Build configuration list for PBXNativeTarget "Image Picker" */ = {
360 | isa = XCConfigurationList;
361 | buildConfigurations = (
362 | 11CAD0E8226B217A00E5702D /* Debug */,
363 | 11CAD0E9226B217A00E5702D /* Release */,
364 | );
365 | defaultConfigurationIsVisible = 0;
366 | defaultConfigurationName = Release;
367 | };
368 | /* End XCConfigurationList section */
369 | };
370 | rootObject = 11CAD0CD226B217800E5702D /* Project object */;
371 | }
372 |
--------------------------------------------------------------------------------