Sha256: 395bc8eabb5365590b0b5d2c52e1e0a27cbec88ca76eb3aeeb891867af3cc8a9

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

module Lotion
  module Notifications

    ##
    # 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.
    def notify( name, info=nil )
      notification_center.postNotificationName name,
        object:self, userInfo:info
    end

    ##
    # The shared notification center instance.
    def notification_center
      NSNotificationCenter.defaultCenter
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotion-0.1.0 lib/lotion/notifications.rb