Inherits from C2ExpandViewController
Declared in SCPhotoViewerController.h

Overview

Presents the standard C2Call SDK Photo Viewer Controller.

Properties

activityView

Activity View presented when loading photos.

@property (nonatomic, weak) IBOutlet UIActivityIndicatorView *activityView

Declared In

SCPhotoViewerController.h

controlsView

View containing photo action controls.

@property (nonatomic, weak) IBOutlet UIView *controlsView

Discussion

This view will be hidden on touch or re-displayed.

Declared In

SCPhotoViewerController.h

expandCollapseButton

Button to toggle the full-screen mode.

@property (nonatomic, weak) IBOutlet UIButton *expandCollapseButton

Discussion

The Photo Viewer is sub classing C2ExpandViewController to provide a full-screen view for the photos with expand and collapse animations.

Declared In

SCPhotoViewerController.h

labelMessage

Attached message to the Photo.

@property (nonatomic, weak) IBOutlet UILabel *labelMessage

Declared In

SCPhotoViewerController.h

labelSubtitle

Sub-Title of the Photo.

@property (nonatomic, weak) IBOutlet UILabel *labelSubtitle

Declared In

SCPhotoViewerController.h

labelTitle

Title of the Photo.

@property (nonatomic, weak) IBOutlet UILabel *labelTitle

Declared In

SCPhotoViewerController.h

messageView

View Containing the message label.

This view will be hidden if no message is attached to the photo.

@property (nonatomic, weak) IBOutlet UIView *messageView

Declared In

SCPhotoViewerController.h

pagingScrollView

PhotoViewer ScollView.

@property (nonatomic, weak) IBOutlet UIScrollView *pagingScrollView

Declared In

SCPhotoViewerController.h

Instance Methods

arrowLeft:

Shows the previous image.

- (IBAction)arrowLeft:(id)sender

Declared In

SCPhotoViewerController.h

arrowRight:

Shows the next image.

- (IBAction)arrowRight:(id)sender

Declared In

SCPhotoViewerController.h

contentAction:

Shows the default content menu using SCPopupMenu.

- (IBAction)contentAction:(id)sender

Parameters

sender
  • The initiator of the action

Discussion

Default Implementation: SCPopupMenu *cv = [SCPopupMenu popupMenu:self];

[cv addChoiceWithName:NSLocalizedString(@"Forward", @"Choice Title") andSubTitle:NSLocalizedString(@"Share via FriendCaller", @"Choice SubTitle") andIcon:[UIImage imageNamed:@"ico_forward"] andCompletion:^(){
    [self forwardMessage:nil];
}];

if ([MFMailComposeViewController canSendMail]) {
    [cv addChoiceWithName:NSLocalizedString(@"Email", @"Choice Title") andSubTitle:NSLocalizedString(@"Share via Email", @"Choice SubTitle") andIcon:[UIImage imageNamed:@"ico_email"] andCompletion:^(){
        [self shareEmail:nil];
    }];
}

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
    [cv addChoiceWithName:NSLocalizedString(@"Copy", @"MenuItem") andSubTitle:NSLocalizedString(@"Copy to Clipboard", @"Button") andIcon:[UIImage imageNamed:@"ico_copy"] andCompletion:^{
        [self copyImage:nil];
    }];
}

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
    [cv addChoiceWithName:NSLocalizedString(@"Save", @"Choice Title") andSubTitle:NSLocalizedString(@"Save to your Camera Roll", @"Button") andIcon:[UIImage imageNamed:@"ico_image"] andCompletion:^{
        [self saveToAlbum:nil];
    }];
}

[cv addCancelWithName:NSLocalizedString(@"Cancel", @"Button") andCompletion:^{

}];

[cv showMenu];

Declared In

SCPhotoViewerController.h

copyImage:

Copies the current visible image to ClipBoard.

- (IBAction)copyImage:(id)sender

Parameters

sender
  • The initiator of the action

Declared In

SCPhotoViewerController.h

forwardMessage:

Forwards the current visible image.

- (IBAction)forwardMessage:(id)sender

Parameters

sender
  • The initiator of the action

Declared In

SCPhotoViewerController.h

imageAtIndex:

Gets the image at index.

- (UIImage *)imageAtIndex:(id)index

Parameters

index
  • Index of the requested image

Return Value

The image

Declared In

SCPhotoViewerController.h

imageCount

Number of images.

- (NSUInteger)imageCount

Return Value

Number of images

Declared In

SCPhotoViewerController.h

imageKeyForVisibleImage

Gets the Rich Media Key for the current visible image.

- (NSString *)imageKeyForVisibleImage

Return Value

The image key

Declared In

SCPhotoViewerController.h

magnifyImage:

Magnifies or Shrink the current visible image.

- (IBAction)magnifyImage:(id)sender

Declared In

SCPhotoViewerController.h

saveToAlbum:

Saves the current visible image to the photo album.

- (IBAction)saveToAlbum:(id)sender

Parameters

sender
  • The initiator of the action

Declared In

SCPhotoViewerController.h

scrollToPage:animate:

Scrolls to image with index.

- (void)scrollToPage:(id)index animate:(id)animate

Parameters

index
  • Image index
animate
  • YES / NO

Declared In

SCPhotoViewerController.h

setImages:currentImage:

Sets the list of images to present and the current image which is presented first.

- (void)setImages:(id)images currentImage:(id)imageKey

Parameters

images
  • The list of images to present
imageKey
  • Rich Media Key of the first image to show

Discussion

The list of images requires to be an NSArray of NSDictionary objects with the following values:

image - Rich Media Key of the image
eventType - See MOC2CallEvent.eventType (optional)
senderName - The sender of the image (assigned to labelTitle). See MOC2CallEvent.senderName (optional)
timeStamp - Assigned to labelSubTitle. See MOC2CallEvent.timeStamp (optional)

Declared In

SCPhotoViewerController.h

shareEmail:

Shares the current visible image as email.

- (IBAction)shareEmail:(id)sender

Parameters

sender
  • The initiator of the action

Declared In

SCPhotoViewerController.h