Latest 0.3.0
Homepage https://github.com/youkchansim/CSPhotoGallery
License MIT
Platforms ios 9.0
Authors

Version
License
Platform
iOS 9.0+
Swift 3.0+

  • This is very simple and light photo browser written swift. and also you can show images or videos.

Sample Project
Sample Project

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CSPhotoGallery is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "CSPhotoGallery"

Usage

First Step – import CSPhotoGallery to your project

Second Step – Add a delegate CGPhotoGalleryDelegate to your class & add a delegate methods

func getAssets(assets: [PHAsset]) {
  // if you implement this delegate function, you will receive assets
  // Example )
  assets.forEach { asset in
    let size = CGSize(width: asset.pixelWidth, height: asset.pixelHeight)
    PhotoManager.sharedInstance.assetToImage(asset: asset, imageSize: size, completionHandler: { image in
          // Do something
    })
  }
}

Third Step – Present a CSPhotoGalleryViewController

let vc = CSPhotoGalleryViewController.instance
vc.delegate = self
vc.CHECK_MAX_COUNT = 20
vc.horizontalCount = 3
vc.mediaType = .image //  or .video
present(vc, animated: true)

And you can customize ui design

public class CSPhotoDesignManager {
    public static var instance: CSPhotoDesignManager = CSPhotoDesignManager()

    //  Photo collection view
    public var photoGalleryBackButtonImage: UIImage?

    //  Photo detail view
    public var photoDetailBackButtonImage: UIImage?

    //  OK Button Title
    public var photoGalleryOKButtonTitle: String?

    //  Check Image
    public var photoGalleryCheckImage: UIImage?

    //  UnCheck Image
    public var photoGalleryUnCheckImage: UIImage?

    //  When OK Button is hidden, CheckCountLabel and CheckBtn is hidden  
    public var isOKButtonHidden = false
}

Author

chansim.youk, [email protected]

License

CSPhotoGallery is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CSPhotoGallery",
    "version": "0.3.0",
    "summary": "A simple and elegant Photo gallery",
    "description": "CSPhotoGallery is a PhotoGallery that is simple and elegant. and This is written Swift.",
    "homepage": "https://github.com/youkchansim/CSPhotoGallery",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "chansim Youk": "[email protected]"
    },
    "source": {
        "git": "https://github.com/youkchansim/CSPhotoGallery.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Pod/**/*.{swift}",
    "resource_bundles": {
        "CSPhotoGallery": [
            "Pod/**/*.{xcassets,storyboard}"
        ]
    },
    "pushed_with_swift_version": "3"
}

Pin It on Pinterest

Share This