Module: Lotion::Notifications

Included in:
Application, Command
Defined in:
lib/lotion/notifications.rb

Instance Method Summary collapse

Instance Method Details

#notification_centerObject

The shared notification center instance.



16
17
18
# File 'lib/lotion/notifications.rb', line 16

def notification_center
  NSNotificationCenter.defaultCenter
end

#notify(name, info = nil) ⇒ Object

Publishes a notification named ‘name` to the default notification center. You can optionally pass an `info` object that will be available to any subscribers of the notification.



9
10
11
12
# File 'lib/lotion/notifications.rb', line 9

def notify( name, info=nil )
  notification_center.postNotificationName name,
    object:self, userInfo:info
end