Latest 1.0.0
Homepage https://github.com/steve228uk/FBImagePicker
License MIT
Platforms ios 9.0
Dependencies Alamofire, FBSDKCoreKit, FBSDKLoginKit
Frameworks UIKit
Authors

:camera: FBImagePicker

A simple drop-in image picker for Facebook

Facebook Image Picker for iOS

Installation

CocoaPods

Simply add the following dependency to your podfile

pod 'FBImagePicker', '~> 1.0'

Usage

This usage example assumes that you’ve already setup the Facebook SDK for iOS

1. Set the delegate

First, set the delegate where you wish to access selected images:

import FBImagePicker

class ViewController: UIViewController, FBImagePickerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        FBImagePicker.delegate = self
    }

    func fbImagePicker(imageSelected image: UIImage?) {
        print("Image selected")
    }

}

2. Present the picker

Next, present the picker from a view controller using the following method:

FBImagePicker.present(on: self)

3. Configure the picker (Optional)

By default FBImagePicker is designed as a quick drop-in but there are a number of options that can be configured if you like to get into the nitty-gritty.

The following options are available with their defaults on FBImagePicker.Settings.

/// This is the title that's displayed in the navigation bar on the album selection screen
static var albumsTitle = "Facebook Albums"
/// This is the text that's displayed for the empty state in the album selection screen
static var noAlbumsText = "No Albums"
/// This is the text that's displayed for the empty state in the album selection screen
static var noImagesText = "No Images"
/// The style the status bar should be in the image picker
static var statusBarStyle = UIStatusBarStyle.lightContent
/// This is the tint colour used for buttons on the nav bar
static var navTintColor = UIColor.white
/// The tint colour of the background of the nav bar
static var navBarTintColor = UIColor(hue:0.61, saturation:0.60, brightness:0.59, alpha:1.00)
/// This is the text colour of the title in the nav bar
static var navBarTextColor = UIColor.white
/// Used to control the cross fade on images. Leave as 0 for no transition.
static var imageTransitionDuration = 0.0
/// This controls the offset of the infinite scroll. If you're not sure, leave this as 200.
static var infiniteScrollOffset: CGFloat = 200

Latest podspec

{
    "name": "FBImagePicker",
    "version": "1.0.0",
    "summary": ":camera: An image picker for Facebook",
    "description": "FBImagePicker is a quick and easy drop-in image picker for Facebook. It works in tandem with the official Facebook SDK to allow easy selection of images from user albums.",
    "homepage": "https://github.com/steve228uk/FBImagePicker",
    "license": "MIT",
    "authors": {
        "Stephen Radford": "[email protected]"
    },
    "social_media_url": "http://twitter.com/steve228uk",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/steve228uk/FBImagePicker.git",
        "tag": "1.0.0"
    },
    "source_files": "FBImagePicker/**/*.{swift}",
    "resources": [
        "FBImagePicker/**/*.{storyboard}"
    ],
    "frameworks": "UIKit",
    "dependencies": {
        "Alamofire": [],
        "FBSDKCoreKit": [],
        "FBSDKLoginKit": []
    },
    "pushed_with_swift_version": "3.0.1"
}

Pin It on Pinterest

Share This