Latest 1.0.1
Homepage https://github.com/istered/RxPhotos
License MIT
Platforms ios 10.0
Dependencies RxSwift
Frameworks UIKit, Foundation, AVFoundation, Photos
Authors

CI Status
Version
License
Platform
Carthage compatible

This library is a tiny wrapper around some callback-based Photos’ framework functions.

Usage

Request image:

PHImageManager.default().rx.requestImage(
            for: asset,
            targetSize: CGSize(width: 120, height: 200),
            contentMode: PHImageContentMode.aspectFit,
            options: nil
            ).subscribe(onNext: { image in
                //
            }).disposed(by: disposeBag)

Watch PHPhotoLibrary changes:

PHPhotoLibrary.shared().rx.photoLibraryChange
            .subscribe(onNext: { change in
                //
            }).disposed(by: disposeBag)

Request authorization:

PHPhotoLibrary.rx.requestAuthorization()
            .subscribe(onSuccess: { status in
                //
            }).disposed(by: disposeBag)

Perform changes on photo library:

PHPhotoLibrary.shared().rx.performChanges({ /**/ })
            .subscribe(onSuccess: { result in
                //
            }).disposed(by: disposeBag)

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate RxPhotos into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'RxPhotos'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate RxPhotos into your Xcode project using Carthage, specify it in your Cartfile:

github "istered/RxPhotos"

Run carthage update to build the framework and drag the built RxPhotos.framework into your Xcode project.

Dependencies

Requirements

  • iOS 10+
  • Swift 4.0+

Author

Anton Romanov

License

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

Latest podspec

{
    "name": "RxPhotos",
    "version": "1.0.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Reactive extensions for Photos framework.",
    "homepage": "https://github.com/istered/RxPhotos",
    "authors": {
        "Anton Romanov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/istered/RxPhotos.git",
        "tag": "1.0.1"
    },
    "source_files": "Source/**/*.{h,m,swift}",
    "swift_version": "4.0",
    "frameworks": [
        "UIKit",
        "Foundation",
        "AVFoundation",
        "Photos"
    ],
    "dependencies": {
        "RxSwift": [
            "~> 4.0"
        ]
    },
    "platforms": {
        "ios": "10.0"
    }
}

Pin It on Pinterest

Share This