SCImagePickerCell Class Reference
Inherits from | SCTableViewCell : UITableViewCell |
Conforms to | SCViewControllerDelegate UIActionSheetDelegate UIImagePickerControllerDelegate UINavigationControllerDelegate |
Declared in | SCTableViewCell.h |
Overview
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.
Tasks
Creation and Initialization
-
+ cellWithText:boundObject:imageNamePropertyName:
Allocates and returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.
-
– initWithText:boundObject:imageNamePropertyName:
Returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.
Configuration
-
imagePickerController
The UIImagePickerController associated with the cell. Even though this property is readonly, feel free to customize any of the controller’s relevant properties.
property -
selectedImageObject
The selected image. Returns nil if no image is selected.
property -
placeholderImageName
The name for an image in the documents folder that will be used as a placeholder if no image is selected.
property -
placeholderImageTitle
The title for the image specified in the placeholderImageName property.
property -
displayImageNameAsCellText
If TRUE, the selected image name will be displayed in the cell’s textLabel. Default: TRUE.
property -
askForSourceType
If TRUE, the user will be asked for the source type, otherwise, the source type will be determined from imagePickerController’s sourceType property. Default: TRUE.
property -
clearImageButton
A button that clears the currently selected image when tapped. Feel free to customize the default look and feel of this button.
property -
displayClearImageButtonInDetailView
If TRUE, clearImageButton will be displayed in the cell’s detail view. Default: TRUE.
property -
autoPositionClearImageButton
If TRUE, clearImageButton will be automatically positioned in the cell’s detail view. Default: TRUE.
property -
textLabelFrame
Set this property to customize the placement of the cell’s textLabel.
property -
imageViewFrame
Set this property to customize the placement of the cell’s imageView.
property -
selectedImageName
The name of the selected image.
property -
– resetClearImageButtonStyles
Resets the clearImageButton default layer styles such as corneRadius and borderWidth.
Properties
askForSourceType
If TRUE, the user will be asked for the source type, otherwise, the source type will be determined from imagePickerController’s sourceType property. Default: TRUE.
@property (nonatomic) BOOL askForSourceType
Discussion
Note: If the device has no camera, setting this to TRUE automatically sets the sourceType to UIImagePickerControllerSourceTypePhotoLibrary.
Declared In
SCTableViewCell.h
autoPositionClearImageButton
If TRUE, clearImageButton will be automatically positioned in the cell’s detail view. Default: TRUE.
@property (nonatomic) BOOL autoPositionClearImageButton
Declared In
SCTableViewCell.h
clearImageButton
A button that clears the currently selected image when tapped. Feel free to customize the default look and feel of this button.
@property (nonatomic, readonly) UIButton *clearImageButton
Declared In
SCTableViewCell.h
displayClearImageButtonInDetailView
If TRUE, clearImageButton will be displayed in the cell’s detail view. Default: TRUE.
@property (nonatomic) BOOL displayClearImageButtonInDetailView
Declared In
SCTableViewCell.h
displayImageNameAsCellText
If TRUE, the selected image name will be displayed in the cell’s textLabel. Default: TRUE.
@property (nonatomic) BOOL displayImageNameAsCellText
Declared In
SCTableViewCell.h
imagePickerController
The UIImagePickerController associated with the cell. Even though this property is readonly, feel free to customize any of the controller’s relevant properties.
@property (nonatomic, readonly) UIImagePickerController *imagePickerController
Declared In
SCTableViewCell.h
imageViewFrame
Set this property to customize the placement of the cell’s imageView.
@property (nonatomic, readwrite) CGRect imageViewFrame
Declared In
SCTableViewCell.h
placeholderImageName
The name for an image in the documents folder that will be used as a placeholder if no image is selected.
@property (nonatomic, copy) NSString *placeholderImageName
Declared In
SCTableViewCell.h
placeholderImageTitle
The title for the image specified in the placeholderImageName property.
@property (nonatomic, copy) NSString *placeholderImageTitle
Declared In
SCTableViewCell.h
selectedImageName
The name of the selected image.
@property (nonatomic, copy) NSString *selectedImageName
Declared In
SCTableViewCell.h
Class Methods
cellWithText:boundObject:imageNamePropertyName:
Allocates and returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.
+ (id)cellWithText:(NSString *)cellText boundObject:(NSObject *)object imageNamePropertyName:(NSString *)propertyName
Parameters
- cellText
The text that will appear in the cell’s textLabel.
- object
The cell’s bound object (see SCTableViewCell class overview).
- propertyName
The cell’s bound property name corresponding to the cell’s selected image name. Property must be a readwrite property of type NSString.
Declared In
SCTableViewCell.h
Instance Methods
initWithText:boundObject:imageNamePropertyName:
Returns an initialized SCImagePickerCell given cell text, bound object, and a bound property name.
- (id)initWithText:(NSString *)cellText boundObject:(NSObject *)object imageNamePropertyName:(NSString *)propertyName
Parameters
- cellText
The text that will appear in the cell’s textLabel.
- object
The cell’s bound object (see SCTableViewCell class overview).
- propertyName
The cell’s bound property name corresponding to the cell’s selected image name. Property must be a readwrite property of type NSString.
Declared In
SCTableViewCell.h
resetClearImageButtonStyles
Resets the clearImageButton default layer styles such as corneRadius and borderWidth.
- (void)resetClearImageButtonStyles
Declared In
SCTableViewCell.h