Mobile SDK iOS: EPZPushPreferencesViewController

From ePrize Developers Wiki

Jump to: navigation, search

Contents

Overview

The EPZPushPreferencesViewController class controls the SDK’s built-in view to display a user’s push notification preferences.

Creating a View
To create an instance of EPZPushPreferencesViewController and add it to your application, you can use code like the following.

// Create instance of the view controller
EPZPushPreferencesViewController *pvc = [EPZPushPreferencesViewController pushPreferencesViewControllerWithOptions:nil];

// Set delegate
pvc.delegate = self;

// Present view controller
[self presentViewController:pvc animated:YES completion:nil];

Tasks

Setting and Getting the Delegate
  delegate property

Initializing
+ pushPreferencesViewControllerWithOptions:
- initViewWithOptions:


Properties

delegate

The receiver's delegate.

@property (nonatomic, assign) id <EPZPushPreferencesViewControllerDelegate> delegate

Discussion
The delegate is sent messages when the view is targeted to close. See EPZPushPreferencesViewControllerDelegate for methods this delegate implements.

Declared In
EPZPushPreferencesViewController.h


Class Methods

pushPreferencesViewControllerWithOptions:

Initializes and returns a newly allocated view object with the specified items from the options.

+ (EPZPushPreferencesViewController *) pushPreferencesViewControllerWithOptions:(NSDictionary *)options

Parameters

options
A dictionary of optional elements to use for styling the toolbar (and enclosed elements) in the view. This dictionary has the same keys specified in the initViewWithOptions: method.

Discussion
This method returns an initialized instance of EPZPushPreferencesViewController. Once initialized, this view loads all of the EPZPushPreferenceItem objects stored in the SDK, along with a toggle switch for each item, allowing the user to toggle a particular preference on/off as desired.

This view is designed to fill the entire screen of the application, and has appropriate logic to allow for filling the screen even when the device is rotated.

See Also
initViewWithOptions:

Declared In
EPZPushPreferencesViewController.h


Instance Methods

initViewWithOptions:

Initializes and returns a newly allocated view object with the specified items from the options.

- (id) initViewWithOptions:(NSDictionary *)options


Parameters

options
A dictionary of optional elements to use for styling the toolbar (and enclosed elements) in the view. Below is a list of all valid elements that can be included in the options dictionary, listed by their dictionary key and the type of class each item must be. Each item includes a short description and its default value.
navigationBar (UINavigationBar) - The navigation bar used at the top of the view.
Default: UINavigationBar with barStyle of UIBarStyleBlackOpaque
navigationItem (UINavigationItem) - The navigation item used in the navigation bar.
Default: UINavigationItem initialized with the title "Preferences"
closeButton (UIBarButtonItem) - The close button used to close the view.
Default: A UIBarButtonItem initialized with bar button system item UIBarButtonSystemItemDone
tintColor (UIColor) - A tint color to apply to the navigation bar.
Default: None (no tint color applied)

Discussion
This method returns an initialized instance of EPZPushPreferencesViewController. Once initialized, this view loads all of the EPZPushPreferenceItem objects stored in the SDK, along with a toggle switch for each item, allowing the user to toggle a particular preference on/off as desired.

This view is designed to fill the entire screen of the application, and has appropriate logic to allow for filling the screen even when the device is rotated.

See Also
pushPreferencesViewControllerWithOptions:

Declared In
EPZPushPreferencesViewController.h

Personal tools