Skip to content

YouClap/ReactiveFirebase

 
 

Repository files navigation

ReactiveFirebase

ReactiveSwift extensions for Firebase.

Swift Version License CocoaPods Compatible
Platform

ReactiveFirebase adds ReactiveSwift extensions for several Firebase components. Currently FirebaseAuth, FirebaseDatabase, and FirebaseStorage are supported.

NOTE: The CocoaPod does not currently work. Firebase distributes their SDK as a static library which makes distributing this as a CocoaPod very difficult. Your best bet for now is to drop the source files into your Xcode project manually.

Installation

CocoaPods

You can use CocoaPods to install ReactiveFirebase by adding it to your Podfile:

use_frameworks!
pod 'ReactiveFirebase'

Manually

  1. Download and drop all the .swift files into your project.
  2. There is no step two.

Usage example

Here's a few simple examples.

import ReactiveFirebase

FIRDatabase.database().reference(withPath: "users")
	.child(userID)
	.reactive
	.value
	.startWithValues { user in
		// do something with your user JSON
	}
import ReactiveFirebase

FIRAuth.auth()
  .reactive
	.currentUser
	.startWithValues { user in
		// do something with your FIRUser
	}

Contribute

I would love for you to contribute to ReactiveFirebase, check the LICENSE file for more info. I'd be happy to review any pull requests.

Meta

You can find me on Twitter @edc1591

Distributed under the MIT license. See LICENSE for more information.

About

[WIP] ReactiveSwift extensions for Firebase.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.1%
  • Ruby 5.9%