SCImagePickerCell

@interface SCImagePickerCell
    : SCCustomCell <UINavigationControllerDelegate,
                    UIImagePickerControllerDelegate, UIActionSheetDelegate,
                    SCViewControllerDelegate, UIScrollViewDelegate> {
  UIImage *cachedImage;
  UIPopoverController *popover;
  UIImagePickerController *imagePickerController;
  NSString *placeholderImageName;
  NSString *placeholderImageTitle;
  BOOL displayImageNameAsCellText;
  BOOL askForSourceType;
  UIButton *clearImageButton;
  BOOL displayClearImageButtonInDetailView;
  BOOL autoPositionClearImageButton;
  BOOL autoPositionImageView;
  CGRect textLabelFrame;
  CGRect imageViewFrame;
  NSString *selectedImageName;
}

This class functions as a cell that provides the end-user with an automatically generated detail view of type UIImagePickerController to pick an image with. As soon as the image is picked, it will be saved to the Documents folder using either an auto generated name from the current time stamp, or a name provided through SCTableViewModelDelegate or the cell’s actions. The bound property of this cell must be of type NSString, and will be bound to the name of the selected image. Once an image is selected, tapping an SCImagePickerCell will display the image in a detail view. To select a different image, the table view must be put in edit mode (make sure UITableView’s allowsSelectionDuringEditing property is TRUE). Alternatively, make sure that displayClearImageButtonInDetailView property is TRUE, and the user will be able to tap a “Clear Image” button to clear the selected image.

Creation and Initialization

  • Allocates and returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the cell’s selected image name. Property must be a readwrite property of type NSString.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                     boundObject:(NSObject *)object
           imageNamePropertyName:(NSString *)propertyName;
  • Returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the cell’s selected image name. Property must be a readwrite property of type NSString.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                     boundObject:(NSObject *)object
           imageNamePropertyName:(NSString *)propertyName;

Configuration

Internal Methods (should only be used by the framework or when subclassing)