GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ReactiveKit/ReactiveFoundation: Reactive NSFoundation

BranchesTags
Open more actions menu

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
ReactiveFoundation.xcodeproj
ReactiveFoundation.xcodeproj
 
 
ReactiveFoundation.xcworkspace
ReactiveFoundation.xcworkspace
 
 
ReactiveFoundation
ReactiveFoundation
 
 
ReactiveFoundationTests
ReactiveFoundationTests
 
 
ReactiveKit @ d02db4c
ReactiveKit @ d02db4c
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ReactiveFoundation.podspec
ReactiveFoundation.podspec
 
 

Repository files navigation

ReactiveFoundation

ReactiveFoundation is a framework from ReactiveKit collection of frameworks that extends NSObject objects with type-safe KVO support and NSNotificationCenter with reactive observing mechanism. Consult ReactiveKit documentation to learn how to work with the Observables it provides.

Key-Value Observing

let user = ObjCUserClass()

user.rValueForKeyPath("name").observe { (name: String?) in
  print(name)
}.disposeIn(rBag)

user.rValueForKeyPath("name").bindTo(nameLabel.rText)

Observing KVO-observable will be active as long as the returned disposable is alive. Make sure you store the disposable when using observe method on KVO-observable. You don't need to store the disposable when using bindTo method. Binding will be automatically disposed when the bindable target (i.e. view) is deallocated.

NSNotificationCenter

NSNotificationCenter.defaultCenter().rNotification("MyNotification").observe { notification in
  print("Did receive notificaton \(notification).")
}.disposeIn(rBag)

Make sure you always dispose observation when it's no longer necessary. The simplet way is to put the disposable into the disposable bag on the object that has initiated observation.

rBag

Dispose bag is provided by NSObject and all its subclasses and it is disposed when the object is deallocated. Use this to cleanup your observations.

Installation

CocoaPods

pod 'ReactiveKit', '~> 1.0'
pod 'ReactiveFoundation', '~> 1.0'

Carthage

github "ReactiveKit/ReactiveKit" 
github "ReactiveKit/ReactiveFoundation"

License

The MIT License (MIT)

Copyright (c) 2015 Srdan Rasic (@srdanrasic)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Reactive NSFoundation

Resources

Readme
MIT license
Activity
Custom properties

Stars

14 stars

Watchers

1 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.