Inherits from NSObject
Declared in OlapicMediaList.h

Overview

The basic interface for media lists objects

Properties

currentOffset

The list pagination current offset

@property (nonatomic) NSInteger currentOffset

Declared In

OlapicMediaList.h

currentURL

The API URL of the last request. This may change depending on the pagination

@property (nonatomic, strong) NSMutableString *currentURL

Declared In

OlapicMediaList.h

delegate

The delegate object

@property (nonatomic, weak) id<OlapicMediaListDelegate> __weak delegate

Declared In

OlapicMediaList.h

extraParameters

Lists specific parameters to be included on every requrest

@property (nonatomic, strong) NSMutableDictionary *extraParameters

Declared In

OlapicMediaList.h

initialURL

The initial API URL from where the list will get the media objects

@property (nonatomic, strong) NSString *initialURL

Declared In

OlapicMediaList.h

mediaPerPage

How many media objects per page will be loaded

@property (nonatomic) NSInteger mediaPerPage

Declared In

OlapicMediaList.h

nextURL

The API URL to the next page

@property (nonatomic, strong) NSMutableString *nextURL

Declared In

OlapicMediaList.h

pages

A list with the pages from the API Each item will be a dictionary with the follwing keys: - links: The API pagination links - media: An array with all the media objects for that page

@property (nonatomic, strong) NSMutableArray *pages

Declared In

OlapicMediaList.h

prevURL

The API URL to the previous page

@property (nonatomic, strong) NSMutableString *prevURL

Declared In

OlapicMediaList.h

sorting

The list sorting type

@property (nonatomic) OlapicMediaListSortingType sorting

Declared In

OlapicMediaList.h

Class Methods

getKeyForSortingType:

Get string key for a sorting type

+ (NSString *)getKeyForSortingType:(OlapicMediaListSortingType)stype

Parameters

stype

OlapicMediaListSortingType

Return Value

The string with the key

Availability

v1.0

Discussion

The returned key will be used to call the get method of a OlapicEntity, so if you send OlapicMediaListSortingTypeShuffled, you’ll get “media/shuffled”

Declared In

OlapicMediaList.h

Instance Methods

canLoadNextPage

Check if there’s a new page that can be loaded

- (BOOL)canLoadNextPage

Return Value

If a new page can be loaded

Availability

v1.0

Declared In

OlapicMediaList.h

canLoadPreviousPage

Check if there’s a previous page that can be loaded

- (BOOL)canLoadPreviousPage

Return Value

If a previous page exists

Availability

v1.0

Declared In

OlapicMediaList.h

fetching

Check if the list is currenly downloading media

- (BOOL)fetching

Return Value

If the list is downloading

Availability

v1.0

Declared In

OlapicMediaList.h

getCurrentPage

Get the current page information. A dictionary with the following keys: - links: The API pagination links - media: An array with all the media objects for that page

- (NSDictionary *)getCurrentPage

Return Value

The page information

Availability

v1.0

Declared In

OlapicMediaList.h

getCurrentPageMedia

Get the current page’s media objects

- (NSArray *)getCurrentPageMedia

Return Value

An array of OlapicMediaEntity objects

Availability

v1.0

Declared In

OlapicMediaList.h

getMedia

Get all the media currently saved on the list

- (NSArray *)getMedia

Return Value

An array of OlapicMediaEntity objects

Availability

v1.0

Declared In

OlapicMediaList.h

getSDK

Get the OlapicSDK reference

- (OlapicSDK *)getSDK

Return Value

The OlapicSDK

Availability

v1.0

Declared In

OlapicMediaList.h

initFromConnectionData:

When the SDK is initialized using a specific endpoint, this method will take care of reading the JSON and create the list based on that information

- (id)initFromConnectionData:(NSDictionary *)data

Parameters

data

The received information

Return Value

An OlapicMediaList subclass instance (in this base class, it will return nil)

Discussion

This method has its own implementation for each subclass

Declared In

OlapicMediaList.h

loadNextPage

Load a new page

- (void)loadNextPage

Availability

v1.0

Declared In

OlapicMediaList.h

loadPreviousPage

Load the previous page

- (void)loadPreviousPage

Availability

v1.0

Declared In

OlapicMediaList.h

startFetching

Start downloading media objects

- (void)startFetching

Availability

v1.0

Declared In

OlapicMediaList.h