iOS SDK  3.5.0.104555
 All Classes Files Functions Variables Properties Macros Pages
Queue View

The class ASQueueViewController implements a queue view that provides an interface to examine and manipulate transfers in the queue:

queue-view-screenshot.png

Usage In Code

ASQueueViewController instances can be instantiated and pushed onto navigation controllers:

Objective-C     Swift
ASQueueViewController *queue_vc = [[ASQueueViewController alloc] init];
[self.navigationController pushViewController:queue_vc animated:YES];
let queue_vc = ASQueueViewController()
self.navigationController!.pushViewController(queue_vc, animated: true)

Alternatively, they can be presented as modal view controllers. Note that the interface constructed by ASQueueViewController does not include any buttons to dismiss a modal view. If such a button is desired this may be accomplished by presenting a navigation controller with the queue view as the root view, to which a button can be added:

Objective-C     Swift
ASQueueViewController *queue_view = [[ASQueueViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:queue_view];
SEL done_sel = @selector(dismissModalViewButtonTapped:);
UIBarButtonItem *done_item = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleBordered
target:queue_view
action:done_sel];
[queue_view.navigationItem setRightBarButtonItem:done_item];
[self presentModalViewController:nav animated:YES];
let queue_view = ASQueueViewController()
let nav = UINavigationController(rootViewController: queue_view)
let done_item = UIBarButtonItem(title: "Done", style: .Bordered, target: queue_view, action: "dismissModalViewButtonTapped:")
queue_view.navigationItem.rightBarButtonItem = done_item
self.presentViewController(nav!, animated: true, completion: nil)

Note the use of dismissModalViewButtonTapped: (ASQueueViewController), which is an action implemented by ASQueueViewController that dimisses the view modally.

It is also possible to present an instance of ASQueueViewController in a popover. When doing so it is recommended to create an instance of UINavigationController with ASQueueViewController as the root view controller and then present the navigation controller in the popover.

Usage In Storyboards

ASQueueViewController may also be used in storyboards. Since it inherits from UITableViewController, in order to use ASQueueViewController in a storyboard be sure to create a scene using UITableViewController. Once a new scene has been created using UITableViewController select this scene and in the right pane enable the Identity Inspector. Under "Custom Class" enter "ASQueueViewController".

If ASQueueViewController is used only in storyboards one may encounter the following error when building the project: "Unknown class ASQueueViewController in Interface Builder file". The source of the problem is that if ASQueueViewController is not referenced in any source file it may not get included in the final binary by the linker. This problem can be resolved by adding the following line to any one of the source files of the project (for instance the application delegate):

Objective-C     Swift
[ASQueueViewController class]; // Force ASQueueViewController to be linked when building
ASQueueViewController() // Force ASQueueViewController to be linked when building

Different types of segues can be used to display an ASQueueViewController instance including push, modal or popover segues. When using a push segue to display the queue view one may push a scene created as described directly (this is equivalent to pushing an instance of ASQueueViewController onto the navigation stack of a navigation controller). When using popover or modal segues it is best to push a scene composed of a UINavigationController that has the ASQueueViewController as its root view controller.

For modal segues that push a navigation controller with an ASQueueViewController instance as the root view it is possible to add a UIBarButtonItem to the ASQueueViewController scene and connect it to the action dismissModalViewButtonTapped: (ASQueueViewController) implemented by ASQueueViewController. This action dismisses the view modally.