module MotionAL

Private Class Methods

asset_group_types() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 9
def asset_group_types
  {
    :library      => ALAssetsGroupLibrary,
    :album        => ALAssetsGroupAlbum,
    :event        => ALAssetsGroupEvent,
    :faces        => ALAssetsGroupFaces,
    :saved_photos => ALAssetsGroupSavedPhotos,
    :photo_stream => ALAssetsGroupPhotoStream,
    :all          => ALAssetsGroupAll
  }
end
asset_orientations() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 31
def asset_orientations
  {
    :up             => ALAssetOrientationUp,
    :down           => ALAssetOrientationDown,
    :left           => ALAssetOrientationLeft,
    :right          => ALAssetOrientationRight,
    :up_mirrored    => ALAssetOrientationUpMirrored,
    :down_mirrored  => ALAssetOrientationDownMirrored,
    :left_mirrored  => ALAssetOrientationLeftMirrored,
    :right_mirrored => ALAssetOrientationRightMirrored
  }
end
asset_types() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 22
def asset_types
  {
    :photo   => ALAssetTypePhoto,
    :video   => ALAssetTypeVideo,
    :unknown => ALAssetTypeUnknown
  }
end
authorization_statuses() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 45
def authorization_statuses
  {
    :not_determined => ALAuthorizationStatusNotDetermined,
    :restricted     => ALAuthorizationStatusRestricted,
    :denied         => ALAuthorizationStatusDenied,
    :authorized     => ALAuthorizationStatusAuthorized
  }
end
authorized?() click to toggle source

@return [Boolean] False means that your app cannot access the asset library.

# File lib/motional/core.rb, line 74
def authorized?
  ALAssetsLibrary.authorizationStatus == authorization_statuses[:authorized]
end
disable_shared_photo_streams_support() click to toggle source

A simple wrapper of ALAssetsLibrary.disableSharedPhotoStreamsSupport

# File lib/motional/core.rb, line 79
def disable_shared_photo_streams_support
  ALAssetsLibrary.disableSharedPhotoStreamsSupport
end
enum_orders()
Alias for: enumeration_options
enumeration_options() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 65
def enumeration_options
  {
    :asc   => NSEnumerationConcurrent,
    :desc  => NSEnumerationReverse
  }
end
Also aliased as: enum_orders
library() click to toggle source
# File lib/motional/core.rb, line 4
def library
  @library ||= Library.instance
end
notification_keys() click to toggle source

@return [Hash] readable key and objective-c constant value

# File lib/motional/core.rb, line 55
def notification_keys
  {
    :updated_assets_key        => ALAssetLibraryUpdatedAssetsKey,
    :inserted_asset_groups_key => ALAssetLibraryInsertedAssetGroupsKey,
    :updated_asset_groups_key  => ALAssetLibraryUpdatedAssetGroupsKey,
    :deleted_asset_groups_key  => ALAssetLibraryDeletedAssetGroupsKey
  }
end