Skip to content

Instantly share code, notes, and snippets.

@kastiglione
Created November 7, 2014 05:31
Show Gist options
  • Save kastiglione/a6f014b478ccbe142d84 to your computer and use it in GitHub Desktop.
Save kastiglione/a6f014b478ccbe142d84 to your computer and use it in GitHub Desktop.
notifications = -> name {
NSNotificationCenter.defaultCenter.rac_addObserverForName(name, object:nil)
}
rac.showing_keyboard = RACSignal.
merge!(
notifications(UIKeyboardWillShowNotification).map{true},
notifications(UIKeyboardWillHideNotification).map{false},
).
takeUntil(self.rac_willDeallocSignal)
class RACSignal
def self.merge!(*signals)
self.merge(signals)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment