SGARNavigationViewController


A subclass of UIImagePickerController that assigns an instance of SGARView to the cameraOverlayView property.

Conforms to: SGARViewDataSource, UINavigationControllerDelegate
Superclass: UIImagePickerController
Declared In: SGARNavigationViewController.h

Discussion

 As opposed to creating your own UIImagePickerController and overlaying the AR view, this class creates an easier avenue to display SGRecordAnnotations . This class implements SGARViewDataSource and provides data in the AR view a little differently.

This subclass of UIImagePickerViewController will verify that the UIImagePickerControllerSourceTypeCamera is available on the device once the view has been loaded. If the camera source type is unavailble, then the view controller will revert to UIImagePickerControllerSourceTypePhotoLibrary. Using the UIImagePickerControllerSourceTypePhotoLibrary does not stop the create of the AR enviornment. You can still access the arView . This might be advantageous if the desire is to display arView over a selected image. The arView will not be a subview of any view so it would have to be added manually.

The methods from SGARNavigationViewControllerDataSource will create a bucket list. The data structure will then be used to feed the AR view through the proper delegate callbacks. To control which bucket is being displayed make sure to call reloadBucketAtIndex: . Only a single bucket is displayed at any given time in the AR view. There is no limitation to the amount of annotations a bucket can have.

There is one minor "gotcha". If you want to access the navigation bar directly, you have to use navBar. All other calls to the navigation view controller that involve the navigation bar (e.g. setNagivationBarHidden:) will be routed to the proper one. This little tweak is needed in order to display a navigation bar properly in the view. The overlay view also has its own navigation bar and toolbar. Even though this navigation view controller creates its own bars, you can still access them by calling the usual barrage of methods (e.g. setToolbarItems:animated:). The default is that both bars have a black, translucent tint color.



Methods

-amountOfBuckets

 Returns the amount of buckets that are registered.

-close

 Stops animating the AR view and calls dismissModalViewController: on itself.

-loadNextBucket

Loads the next bucket of record annotations that were imported with reloadAllBuckets .

-loadPreviousBucket

 Loads the previous bucket of record annotations that were imported with reloadAllBuckets .

-navBar

 This is the actual navigation bar used by this view controller.

-reloadAllBuckets

 Runs through the entire process of collecting and displaying record annotations in the arView .

-reloadBucketAtIndex:

Reloads a specific bucket.


amountOfBuckets


 Returns the amount of buckets that are registered.

- (NSInteger) amountOfBuckets; 
Return Value

 The amount of buckets.


close


 Stops animating the AR view and calls dismissModalViewController: on itself.

- (void) close; 


loadNextBucket


Loads the next bucket of record annotations that were imported with reloadAllBuckets.

- (BOOL) loadNextBucket; 
Return Value

YES if there is an available bucket. Otherwise, NO.


loadPreviousBucket


 Loads the previous bucket of record annotations that were imported with reloadAllBuckets.

- (BOOL) loadPreviousBucket; 
Return Value

 YES if there is an available bucket. Otherwise, NO.


navBar


 This is the actual navigation bar used by this view controller.

- (UINavigationBar*) navBar; 
Return Value

 The navigation bar that is displayed by this navigation view controller.

Discussion

 If you attempt to access the navigationBar via "nvc.navigationBar", you will not access the proper navigation bar. See SGARNavigationViewControllerfor a more detailed discussion.


reloadAllBuckets


 Runs through the entire process of collecting and displaying record annotations in the arView.

- (void) reloadAllBuckets; 
Discussion

If any record annotations have been registered with the SGARNavigationViewController, they will be released.


reloadBucketAtIndex:


Reloads a specific bucket.

- (void) reloadBucketAtIndex:(NSInteger)bucketIndex; 
Parameters
bucketIndex

The index of the bucket to reload.

Properties

arView

The SGARView that is assigned to the cameraOverlayView property.

bucketIndex

The current bucket index that is being used to populate the arView .

dataSource

The //simplegeo/ooc/cl/SGARNavigationViewControllerDataSource data source that populates the arView .


arView


The SGARView that is assigned to the cameraOverlayView property.

@property (
    nonatomic,
    readonly) SGARView* arView; 
Discussion

You can call cameraOverlayView and still access the the same view.


bucketIndex


The current bucket index that is being used to populate the arView.

@property (
    nonatomic,
    readonly) NSInteger bucketIndex; 


dataSource


The //simplegeo/ooc/cl/SGARNavigationViewControllerDataSource data source that populates the arView.

@property (
    nonatomic,
    assign) id<SGARNavigationViewControllerDataSource> dataSource; 

© SimpleGeo Last Updated: 03/31/2010