SWRLToastView Class Reference

Inherits from UIView
Declared in SWRLToastView.h
SWRLToastView.m

Overview

A SWRLToastView is a floating notification view that allows the user to delete it from the screen, to move up and down and to slide it way to the right to get it out of the way. It is used by the SWRLContentManager to provide a default return to content button when the user dismisses content.

Accessing Information Attributes

  title

The toast title text. Displays as the first line. If nil, it will collapse and take up no space.

@property (nonatomic, nullable) NSString *title

Declared In

SWRLToastView.h

  message

The toast message. Displays under the title and if nil, will collapse to nothing

@property (nonatomic, nullable) NSString *message

Declared In

SWRLToastView.h

  time

The toast timestamp. Displays to the right of the title. If nil, will not display

@property (nonatomic, nullable) NSDate *time

Declared In

SWRLToastView.h

Controlling the Appearance

  font

The font to use for all text. By default uses the systemFont

@property (nonatomic) UIFont *font

Declared In

SWRLToastView.h

  textColor

The text color for all labels. By default is nill and will derive an approriate color based on the background

@property (nonatomic) UIColor *textColor

Declared In

SWRLToastView.h

  backgroundColor

The background of the toast. The default is black with a .60 alpha

@property (nonatomic) UIColor *backgroundColor

Declared In

SWRLToastView.h

  displaySeconds

The time to display. Currently this field has no effect.

@property (nonatomic) NSTimeInterval displaySeconds

Declared In

SWRLToastView.h

  tabAccessoryView

The view to display when the toast is in its parked right position. The default is a tab.

@property (nonatomic) UIView *tabAccessoryView

Declared In

SWRLToastView.h

  deleteAccessoryView

The view to display when the toast is in its swiped left or delete mode. The default is an X on red background

@property (nonatomic) UIView *deleteAccessoryView

Declared In

SWRLToastView.h

  swipeToDelete

Boolean to control whether the user can swipe left to delete in a single motion. Default is NO

@property (nonatomic) BOOL swipeToDelete

Declared In

SWRLToastView.h

  contentView

Background view of the toast

@property (nonatomic, readonly) UIView *contentView

Declared In

SWRLToastView.h

  titleLabel

Default titleLabel

@property (nonatomic, readonly) UILabel *titleLabel

Declared In

SWRLToastView.h

  timeLabel

Default timeLabel

@property (nonatomic, readonly) UILabel *timeLabel

Declared In

SWRLToastView.h

  messageLabel

Default messageLabel

@property (nonatomic, readonly) UILabel *messageLabel

Declared In

SWRLToastView.h

– initWithTitle:message:time:actionHandler:

Construct and initialise a toastView with title, message and timestamp.

- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message time:(NSDate *)time actionHandler:(void ( ^ ) ( SWRLToastView *view , BOOL ))actionHandler

Parameters

title

The toast view title

message

The toast view message

time

The toast view timestamp (optional)

actionHandler

The completion block that is called when the user activates the toast or deletes it.

Declared In

SWRLToastView.h

– presentFromViewController:

Present a toast view from a controller.

- (void)presentFromViewController:(UIViewController *)vc

Parameters

vc

The viewController to use as the host of the toast view.

Declared In

SWRLToastView.h