https://github.com/steve228uk/fbimagepicker
:camera: An image picker for Facebook
https://github.com/steve228uk/fbimagepicker
cocoapods facebook image ios picker swift-3
Last synced: 5 months ago
JSON representation
:camera: An image picker for Facebook
- Host: GitHub
- URL: https://github.com/steve228uk/fbimagepicker
- Owner: steve228uk
- License: mit
- Created: 2017-01-31T11:17:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T15:39:38.000Z (about 8 years ago)
- Last Synced: 2024-12-02T03:40:53.291Z (5 months ago)
- Topics: cocoapods, facebook, image, ios, picker, swift-3
- Language: Swift
- Homepage:
- Size: 13.7 MB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :camera: FBImagePicker
### A simple drop-in image picker for Facebook
## Installation
### CocoaPods
Simply add the following dependency to your `podfile`
```ruby
pod 'FBImagePicker', '~> 1.0'
```### Usage
> This usage example assumes that you've already setup the [Facebook SDK for iOS](https://developers.facebook.com/docs/ios/)
## 1. Set the delegate
First, set the delegate where you wish to access selected images:
```swift
import FBImagePickerclass 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:
```swift
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`.
```swift
/// This is the title that's displayed in the navigation bar on the album selection screen
static var albumsTitle = "Facebook Albums"
``````swift
/// This is the text that's displayed for the empty state in the album selection screen
static var noAlbumsText = "No Albums"
``````swift
/// This is the text that's displayed for the empty state in the album selection screen
static var noImagesText = "No Images"
``````swift
/// The style the status bar should be in the image picker
static var statusBarStyle = UIStatusBarStyle.lightContent
``````swift
/// This is the tint colour used for buttons on the nav bar
static var navTintColor = UIColor.white
``````swift
/// 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)
``````swift
/// This is the text colour of the title in the nav bar
static var navBarTextColor = UIColor.white
``````swift
/// Used to control the cross fade on images. Leave as 0 for no transition.
static var imageTransitionDuration = 0.0
``````swift
/// This controls the offset of the infinite scroll. If you're not sure, leave this as 200.
static var infiniteScrollOffset: CGFloat = 200
```