About
innosoft-mdgallery aims to help produce an easily usable implementation of taking image from gallery and camera.
Requirements
- iOS 11.6
- XCode 13.6
- Swift 4.0+
Installation
CocoaPods
pod 'MDSoftGallery', '~> 1.0' or if above not run properly please use thispod 'MDSoftGallery', :git => 'https://github.com/maedilaziman/innosoft-mdgallery.git'
Just the files from the MDSoftGallery subfolder to your project. Manual
It needs a extension: Setup
extension ViewController: CameraPhoto_Communicate{ func getAllPhotos(images: [UIImage]) { print("get_all_photos = \(images)") } }
Declare CameraPhoto() and call showPhotoGalleryAndCamera function like this example. Usage
import UIKit import MDSoftGallery
extension ViewController: CameraPhoto_Communicate { func getAllPhotos(images: [UIImage]) { print("get_all_photos = \(images)") } }
class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. }
@IBAction func actOpenGallery(_ sender: Any) { let camPhoto = CameraPhoto() camPhoto.showPhotoGalleryAndCamera(comm: self) } }
That's it!
License
Copyright 2020 Maedi Laziman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.