Timing and threading helpers for Interstellar
This library does not use the term FRP (Functional Reactive Programming) in the way it was defined by Conal Elliot, but as a paradigm that is both functional and reactive. Read more about the difference at Why I cannot say FRP but I just did.
- Multithreading with GCD becomes a breeze
- Delay and throttle
Signal<T>
- Wait for async signals
- iOS 7.0+ / Mac OS X 10.9+
- Xcode 7
For a full guide on how Interstellar works the the series of blog posts about Functional Reactive Programming in Swift or the talk at UIKonf 2015 How to use Functional Reactive Programming without Black Magic.
This example executes the greet function on a background thread, then calls next on the main thread.
let text = Signal<String>()
let greet: String->String = { subject in
return "Hello \(subject)"
}
text.ensure(Thread.background).map(greet).ensure(Thread.main).next { text in
println(text)
}
text.update(.Success("World"))
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
Dynamic frameworks on iOS require a minimum deployment target of iOS 8 or later.
To use Interstellar with a project targeting iOS 7, you must include all Swift files directly in your project.
CocoaPods is a dependency manager for Cocoa projects.
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:
$ gem install cocoapods
To integrate Interstellar and WarpDrive into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'WarpDrive'
Then, run the following command:
$ pod install
Interstellar and WarpDrive is owned and maintained by Jens Ravens.
WarpDrive is released under the MIT license. See LICENSE for details.