Permalink
Browse files

Updated coding style and started on extremitiesStyle

  • Loading branch information...
1 parent 121b155 commit 62be25ea36ea06e8b4e02433031a0d3b0efb9d65 @soffes soffes committed May 28, 2011
View
33 SSToolkit/SSAddressBarTextField.m
@@ -13,10 +13,27 @@
@implementation SSAddressBarTextField
+#pragma mark -
+#pragma mark Accessors
+
@synthesize loading = _loading;
+
+- (void)setLoading:(BOOL)isLoading {
+ if (_loading == isLoading) {
+ return;
+ }
+ _loading = isLoading;
+
+ self.rightView = _loading ? _stopButton : _reloadButton;
+ _textFieldBackgroundView.loading = _loading;
+}
+
+
@synthesize reloadButton = _reloadButton;
@synthesize stopButton = _stopButton;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -26,6 +43,8 @@ - (void)dealloc {
[super dealloc];
}
+
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)aFrame {
@@ -78,24 +97,12 @@ - (void)layoutSubviews {
}
+#pragma mark -
#pragma mark UITextField
- (CGRect)rightViewRectForBounds:(CGRect)bounds {
CGSize size = self.frame.size;
return CGRectMake(size.width - 24.0f, roundf((size.height - 18.0f) / 2.0f), 16.0f, 18.0f);
}
-
-#pragma mark Setters
-
-- (void)setLoading:(BOOL)isLoading {
- if (_loading == isLoading) {
- return;
- }
- _loading = isLoading;
-
- self.rightView = _loading ? _stopButton : _reloadButton;
- _textFieldBackgroundView.loading = _loading;
-}
-
@end
View
36 SSToolkit/SSAddressBarTextFieldBackgroundView.m
@@ -23,6 +23,23 @@ @implementation SSAddressBarTextFieldBackgroundView
@synthesize loading;
+- (void)setLoading:(BOOL)isLoading {
+ if (_loading == isLoading) {
+ return;
+ }
+ _loading = isLoading;
+
+ if (_loading) {
+ [self _setupAnimation];
+ [_innerView fadeIn];
+ } else {
+ [_innerView fadeOut];
+ }
+ [self setNeedsDisplay];
+}
+
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -31,6 +48,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)aFrame {
@@ -51,6 +69,7 @@ - (id)initWithFrame:(CGRect)aFrame {
}
+#pragma mark -
#pragma mark Private Methods
- (void)_setupAnimation {
@@ -70,21 +89,4 @@ - (void)_setupAnimation {
}
}
-#pragma mark Setters
-
-- (void)setLoading:(BOOL)isLoading {
- if (_loading == isLoading) {
- return;
- }
- _loading = isLoading;
-
- if (_loading) {
- [self _setupAnimation];
- [_innerView fadeIn];
- } else {
- [_innerView fadeOut];
- }
- [self setNeedsDisplay];
-}
-
@end
View
1 SSToolkit/SSAddressBarTextFieldBackgroundViewInnerView.m
@@ -11,6 +11,7 @@
@implementation SSAddressBarTextFieldBackgroundViewInnerView
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)aFrame {
View
6 SSToolkit/SSBadgeTableViewCell.m
@@ -11,8 +11,13 @@
@implementation SSBadgeTableViewCell
+#pragma mark -
+#pragma mark Accessors
+
@synthesize badgeView = _badgeView;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -21,6 +26,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UITableView
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
View
9 SSToolkit/SSBadgeView.m
@@ -15,6 +15,9 @@ - (CGSize)_textSize;
@implementation SSBadgeView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize text = _text;
@synthesize textColor = _textColor;
@synthesize highlightedTextColor = _highlightedTextColor;
@@ -25,13 +28,15 @@ @implementation SSBadgeView
@synthesize badgeAlignment = _badgeAlignment;
@synthesize highlighted = _highlighted;
+#pragma mark -
#pragma mark Class Methods
+ (UIColor *)defaultBadgeColor {
return [UIColor colorWithRed:0.541f green:0.596f blue:0.694f alpha:1.0f];
}
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -45,6 +50,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)rect {
@@ -132,13 +138,15 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
+#pragma mark -
#pragma mark Private Methods
- (CGSize)_textSize {
return [_text sizeWithFont:_font];
}
+#pragma mark -
#pragma mark Setters
- (void)setText:(NSString *)text {
@@ -149,6 +157,7 @@ - (void)setText:(NSString *)text {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
21 SSToolkit/SSCollectionView.h
@@ -15,6 +15,11 @@ typedef enum {
SSCollectionViewScrollPositionBottom = UITableViewScrollPositionBottom
} SSCollectionViewScrollPosition;
+typedef enum {
+ SSCollectionViewExtremitiesStyleFixed = UITableViewStylePlain,
+ SSCollectionViewExtremitiesStyleScrolling = UITableViewStyleGrouped
+} SSCollectionViewExtremitiesStyle;
+
@protocol SSCollectionViewDelegate;
@protocol SSCollectionViewDataSource;
@@ -37,6 +42,7 @@ typedef enum {
id<SSCollectionViewDelegate> _delegate;
id<SSCollectionViewDataSource> _dataSource;
+ SSCollectionViewExtremitiesStyle _extremitiesStyle;
CGFloat _minimumColumnSpacing;
CGFloat _rowSpacing;
BOOL _allowsSelection;
@@ -58,6 +64,17 @@ typedef enum {
@property (nonatomic, assign) id<SSCollectionViewDelegate> delegate;
/**
+ @brief The style of the receiving collection view's headers and footers.
+
+ Setting to <code>SSCollectionViewExtremitiesStyleFixed</code> will cause the headers and footer to behave like a
+ <code>UITableView</code> with its style set to <code>UITableViewStylePlain</code>. Setting to
+ <code>SSCollectionViewExtremitiesStyleScrolling</code> will cause the headers and footer to behave like a
+ <code>UITableView</code> with its style set to <code>UITableViewStyleGrouped</code>. The default is
+ <code>SSCollectionViewExtremitiesStyleFixed</code>.
+ */
+@property (nonatomic, assign, readonly) SSCollectionViewExtremitiesStyle extremitiesStyle;
+
+/**
@brief The minimum column spacing.
The default is 0.
@@ -106,8 +123,8 @@ typedef enum {
@param identifier A string identifying the cell object to be reused.
- @return A <code>SSCollectionViewItem</code< object with the associated identifier or nil if no such object exists in the
- reusable-item queue.
+ @return A <code>SSCollectionViewItem</code< object with the associated identifier or nil if no such object exists in
+ the reusable-item queue.
*/
- (SSCollectionViewItem *)dequeueReusableItemWithIdentifier:(NSString *)identifier;
View
106 SSToolkit/SSCollectionView.m
@@ -22,12 +22,69 @@ - (NSIndexPath *)_cellIndexPathFromItemIndexPath:(NSIndexPath *)rowIndexPath;
@implementation SSCollectionView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize dataSource = _dataSource;
+
+- (void)setDataSource:(id<SSCollectionViewDataSource>)dataSource {
+ _dataSource = dataSource;
+
+ if (_delegate && _dataSource) {
+ [self reloadData];
+ }
+}
+
+
@synthesize delegate = _delegate;
+
+- (void)setDelegate:(id<SSCollectionViewDelegate>)delegate {
+ _delegate = delegate;
+
+ if (_delegate && _dataSource) {
+ [self reloadData];
+ }
+}
+
+
@synthesize minimumColumnSpacing = _minimumColumnSpacing;
@synthesize rowSpacing = _rowSpacing;
@synthesize allowsSelection = _allowsSelection;
+- (UIScrollView *)scrollView {
+ return _tableView;
+}
+
+
+- (UIView *)backgroundView {
+ return _tableView.backgroundView;
+}
+
+
+- (void)setBackgroundColor:(UIColor *)color {
+ [super setBackgroundColor:color];
+ _tableView.backgroundColor = color;
+}
+
+
+- (void)setBackgroundView:(UIView *)background {
+ _tableView.backgroundView = background;
+}
+
+
+@synthesize extremitiesStyle = _extremitiesStyle;
+
+- (void)setExtremitiesStyle:(SSCollectionViewExtremitiesStyle)style {
+ if (_extremitiesStyle == style) {
+ return;
+ }
+
+ _extremitiesStyle = style;
+ [self reloadData];
+}
+
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -52,6 +109,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -82,6 +140,7 @@ - (void)setFrame:(CGRect)frame {
}
+#pragma mark -
#pragma mark SSCollectionView
- (void)reloadData {
@@ -212,6 +271,7 @@ - (CGRect)rectForFooterInSection:(NSInteger)section {
}
+#pragma mark -
#pragma mark Private Methods
- (void)_reuseItem:(SSCollectionViewItem *)item {
@@ -300,49 +360,7 @@ - (NSIndexPath *)_cellIndexPathFromItemIndexPath:(NSIndexPath *)rowIndexPath {
}
-#pragma mark Getters
-
-- (UIScrollView *)scrollView {
- return _tableView;
-}
-
-
-- (UIView *)backgroundView {
- return _tableView.backgroundView;
-}
-
-
-#pragma mark Setters
-
-- (void)setBackgroundColor:(UIColor *)color {
- [super setBackgroundColor:color];
- _tableView.backgroundColor = color;
-}
-
-
-- (void)setDataSource:(id<SSCollectionViewDataSource>)dataSource {
- _dataSource = dataSource;
-
- if (_delegate && _dataSource) {
- [self reloadData];
- }
-}
-
-
-- (void)setDelegate:(id<SSCollectionViewDelegate>)delegate {
- _delegate = delegate;
-
- if (_delegate && _dataSource) {
- [self reloadData];
- }
-}
-
-
-- (void)setBackgroundView:(UIView *)background {
- _tableView.backgroundView = background;
-}
-
-
+#pragma mark -
#pragma mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
@@ -389,6 +407,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
+#pragma mark -
#pragma mark UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -428,6 +447,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
}
+#pragma mark -
#pragma mark UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
View
8 SSToolkit/SSCollectionViewController.m
@@ -11,8 +11,13 @@
@implementation SSCollectionViewController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize collectionView = _collectionView;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -23,6 +28,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
@@ -54,6 +60,7 @@ - (void)viewDidAppear:(BOOL)animated {
}
+#pragma mark -
#pragma mark SSCollectionViewDataSource
- (NSInteger)collectionView:(SSCollectionView *)aCollectionView numberOfItemsInSection:(NSInteger)section {
@@ -66,6 +73,7 @@ - (SSCollectionViewItem *)collectionView:(SSCollectionView *)aCollectionView ite
}
+#pragma mark -
#pragma mark SSCollectionViewDelegate
- (CGSize)collectionView:(SSCollectionView *)aCollectionView itemSizeForSection:(NSInteger)section {
View
7 SSToolkit/SSCollectionViewItem.m
@@ -15,6 +15,9 @@
@implementation SSCollectionViewItem
+#pragma mark -
+#pragma mark Accessors
+
@synthesize imageView = _imageView;
@synthesize textLabel = _textLabel;
@synthesize detailTextLabel = _detailTextLabel;
@@ -26,6 +29,7 @@ @implementation SSCollectionViewItem
@synthesize indexPath = _indexPath;
@synthesize collectionView = _collectionView;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -41,6 +45,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIResponder
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -62,6 +67,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -76,6 +82,7 @@ - (void)layoutSubviews {
}
+#pragma mark -
#pragma mark SSCollectionViewItem
- (id)initWithStyle:(SSCollectionViewItemStyle)style reuseIdentifier:(NSString *)aReuseIdentifier {
View
45 SSToolkit/SSCollectionViewTableViewCell.m
@@ -13,11 +13,34 @@
@implementation SSCollectionViewTableViewCell
+#pragma mark -
+#pragma mark Accessors
+
@synthesize itemSize = _itemSize;
@synthesize itemSpacing = _itemSpacing;
+
@synthesize items = _items;
+
+- (void)setItems:(NSArray *)someItems {
+ [_items makeObjectsPerformSelector:@selector(removeFromSuperview)];
+ [_items release];
+ _items = [someItems retain];
+
+ if (_items == nil) {
+ return;
+ }
+
+ for (SSCollectionViewItem *item in _items) {
+ [self addSubview:item];
+ }
+
+ [self setNeedsLayout];
+}
+
@synthesize collectionView = _collectionView;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -27,6 +50,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (void)layoutSubviews {
@@ -39,6 +63,7 @@ - (void)layoutSubviews {
}
+#pragma mark -
#pragma mark UITableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
@@ -65,30 +90,12 @@ - (void)prepareForReuse {
}
+#pragma mark -
#pragma mark Initializer
- (id)initWithReuseIdentifier:(NSString *)aReuseIdentifier {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:aReuseIdentifier];
return self;
}
-
-#pragma mark Setters
-
-- (void)setItems:(NSArray *)items {
- [_items makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [_items release];
- _items = [items retain];
-
- if (_items == nil) {
- return;
- }
-
- for (SSCollectionViewItem *item in _items) {
- [self addSubview:item];
- }
-
- [self setNeedsLayout];
-}
-
@end
View
4 SSToolkit/SSConcurrentOperation.m
@@ -10,6 +10,7 @@
@implementation SSConcurrentOperation
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -21,6 +22,7 @@ - (id)init {
}
+#pragma mark -
#pragma mark NSOperation
- (BOOL)isConcurrent {
@@ -45,6 +47,7 @@ - (void)start {
}
+#pragma mark -
#pragma mark SSConcurrentOperation
- (void)finish {
@@ -58,5 +61,4 @@ - (void)finish {
[self didChangeValueForKey:@"isFinished"];
}
-
@end
View
8 SSToolkit/SSGradientView.m
@@ -18,6 +18,9 @@ - (void)_refreshGradient;
@implementation SSGradientView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize topColor = _topColor;
@synthesize bottomColor = _bottomColor;
@synthesize topBorderColor = _topBorderColor;
@@ -26,6 +29,8 @@ @implementation SSGradientView
@synthesize bottomInsetAlpha = _bottomInsetAlpha;
@synthesize gradientScale = _gradientScale;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -37,6 +42,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -137,6 +143,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
+#pragma mark -
#pragma mark Gradient Methods
- (void)_refreshGradient {
@@ -156,6 +163,7 @@ - (void)_refreshGradient {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
64 SSToolkit/SSHUDView.m
@@ -22,15 +22,47 @@ - (void)_removeWindow;
@implementation SSHUDView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize textLabel = _textLabel;
+
@synthesize textLabelHidden = _textLabelHidden;
+
+- (void)setTextLabelHidden:(BOOL)hidden {
+ _textLabelHidden = hidden;
+ _textLabel.hidden = hidden;
+ [self setNeedsLayout];
+}
+
+
@synthesize activityIndicator = _activityIndicator;
@synthesize hudSize = _hudSize;
+
@synthesize loading = _loading;
+
+- (void)setLoading:(BOOL)isLoading {
+ _loading = isLoading;
+ _activityIndicator.alpha = _loading ? 1.0 : 0.0;
+ [self setNeedsDisplay];
+}
+
+
@synthesize successful = _successful;
@synthesize completeImage = _completeImage;
@synthesize failImage = _failImage;
+- (BOOL)hidesVignette {
+ return _hudWindow.hidesVignette;
+}
+
+
+- (void)setHidesVignette:(BOOL)hide {
+ _hudWindow.hidesVignette = hide;
+}
+
+
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -50,6 +82,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -103,6 +136,8 @@ - (void)layoutSubviews {
}
}
+
+#pragma mark -
#pragma mark HUD
- (id)initWithTitle:(NSString *)aTitle {
@@ -263,34 +298,7 @@ - (void)dismissAnimated:(BOOL)animated {
}
-#pragma mark Getters
-
-- (BOOL)hidesVignette {
- return _hudWindow.hidesVignette;
-}
-
-
-#pragma mark Setters
-
-- (void)setLoading:(BOOL)isLoading {
- _loading = isLoading;
- _activityIndicator.alpha = _loading ? 1.0 : 0.0;
- [self setNeedsDisplay];
-}
-
-
-- (void)setTextLabelHidden:(BOOL)hidden {
- _textLabelHidden = hidden;
- _textLabel.hidden = hidden;
- [self setNeedsLayout];
-}
-
-
-- (void)setHidesVignette:(BOOL)hide {
- _hudWindow.hidesVignette = hide;
-}
-
-
+#pragma mark -
#pragma mark Private Methods
- (void)_setTransformForCurrentOrientation:(BOOL)animated {
View
22 SSToolkit/SSHUDWindow.m
@@ -13,8 +13,19 @@
@implementation SSHUDWindow
+#pragma mark -
+#pragma mark Accessors
+
@synthesize hidesVignette = _hidesVignette;
+- (void)setHidesVignette:(BOOL)hide {
+ _hidesVignette = hide;
+ self.userInteractionEnabled = !hide;
+ [self setNeedsDisplay];
+}
+
+
+#pragma mark -
#pragma mark Class Methods
+ (SSHUDWindow *)defaultWindow {
@@ -25,6 +36,7 @@ + (SSHUDWindow *)defaultWindow {
}
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -36,6 +48,7 @@ - (id)init {
}
+#pragma mark -
#pragma mark UIView
- (void)drawRect:(CGRect)rect {
@@ -52,13 +65,4 @@ - (void)drawRect:(CGRect)rect {
image.size.width, image.size.height)];
}
-
-#pragma mark Setters
-
-- (void)setHidesVignette:(BOOL)hide {
- _hidesVignette = hide;
- self.userInteractionEnabled = !hide;
- [self setNeedsDisplay];
-}
-
@end
View
34 SSToolkit/SSIndicatorLabel.m
@@ -15,10 +15,27 @@ + (CGFloat)padding;
@implementation SSIndicatorLabel
+#pragma mark -
+#pragma mark Accessors
+
@synthesize textLabel = _textLabel;
@synthesize activityIndicatorView = _activityIndicatorView;
+
@synthesize loading = _loading;
+- (void)setLoading:(BOOL)l {
+ if (_loading == l) {
+ return;
+ }
+
+ [UIView beginAnimations:@"loading" context:nil];
+ _loading = l;
+ [self layoutSubviews];
+ [UIView commitAnimations];
+}
+
+
+#pragma mark -
#pragma mark Class Methods
+ (CGSize)indicatorSize {
@@ -31,6 +48,7 @@ + (CGFloat)padding {
}
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -40,6 +58,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)rect {
@@ -93,6 +112,7 @@ - (void)setOpaque:(BOOL)o {
}
+#pragma mark -
#pragma mark Status
- (void)startWithText:(NSString *)text {
@@ -105,18 +125,4 @@ - (void)completeWithText:(NSString *)text {
_textLabel.text = text;
}
-
-#pragma mark Custom Setters
-
-- (void)setLoading:(BOOL)l {
- if (_loading == l) {
- return;
- }
-
- [UIView beginAnimations:@"loading" context:nil];
- _loading = l;
- [self layoutSubviews];
- [UIView commitAnimations];
-}
-
@end
View
7 SSToolkit/SSLabel.m
@@ -10,9 +10,13 @@
@implementation SSLabel
+#pragma mark -
+#pragma mark Accessors
+
@synthesize verticalTextAlignment = _verticalTextAlignment;
@synthesize textEdgeInsets = _textEdgeInsets;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -24,6 +28,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)aFrame {
@@ -38,6 +43,7 @@ - (id)initWithFrame:(CGRect)aFrame {
}
+#pragma mark -
#pragma mark UILabel
- (void)drawTextInRect:(CGRect)rect {
@@ -55,6 +61,7 @@ - (void)drawTextInRect:(CGRect)rect {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
3 SSToolkit/SSLineView.m
@@ -14,6 +14,7 @@ @implementation SSLineView
@synthesize insetColor = _insetColor;
@synthesize showInset = _showInset;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -23,6 +24,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -74,6 +76,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
6 SSToolkit/SSLoadingView.m
@@ -14,13 +14,17 @@
@implementation SSLoadingView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize activityIndicatorView = _activityIndicatorView;
@synthesize text = _text;
@synthesize font = _font;
@synthesize textColor = _textColor;
@synthesize shadowColor = _shadowColor;
@synthesize shadowOffset = _shadowOffset;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -39,6 +43,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -104,6 +109,7 @@ - (void)drawRect:(CGRect)rect {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
7 SSToolkit/SSNavigationController.m
@@ -11,11 +11,18 @@
@implementation SSNavigationController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize modalParentViewController = _modalParentViewController;
@synthesize dismissCustomModalOnVignetteTap = _dismissCustomModalOnVignetteTap;
@synthesize contentSizeForViewInCustomModal = _contentSizeForViewInCustomModal;
@synthesize originOffsetForViewInCustomModal = _originOffsetForViewInCustomModal;
+
+#pragma mark -
+#pragma mark UIViewController
+
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
View
9 SSToolkit/SSPickerViewController.m
@@ -10,10 +10,15 @@
@implementation SSPickerViewController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize selectedKey = _selectedKey;
@synthesize keys = _keys;
@synthesize currentIndexPath = _currentIndexPath;
+
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -30,6 +35,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIViewController Methods
- (void)viewDidLoad {
@@ -45,6 +51,7 @@ - (void)viewDidLoad {
}
+#pragma mark -
#pragma mark SSPickerViewController
// This method should be overridden by a subclass
@@ -60,6 +67,7 @@ - (NSString *)cellTextForKey:(id)key {
}
+#pragma mark -
#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -69,6 +77,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
+#pragma mark -
#pragma mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
View
22 SSToolkit/SSPieProgressView.m
@@ -13,12 +13,24 @@
@implementation SSPieProgressView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize progress = _progress;
+
+- (void)setProgress:(CGFloat)newProgress {
+ _progress = fmaxf(0.0f, fminf(1.0f, newProgress));
+ [self setNeedsDisplay];
+}
+
+
@synthesize pieBorderWidth = _pieBorderWidth;
@synthesize pieBorderColor = _pieBorderColor;
@synthesize pieFillColor = _pieFillColor;
@synthesize pieBackgroundColor = _pieBackgroundColor;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -29,6 +41,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)aFrame {
@@ -92,14 +105,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
-#pragma mark Setters
-
-- (void)setProgress:(CGFloat)newProgress {
- _progress = fmaxf(0.0f, fminf(1.0f, newProgress));
- [self setNeedsDisplay];
-}
-
-
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
9 SSToolkit/SSRatingPicker.m
@@ -17,6 +17,9 @@ - (void)_setNumberOfStarsWithTouch:(UITouch *)touch;
@implementation SSRatingPicker
+#pragma mark -
+#pragma mark Accessors
+
@synthesize numberOfStars = _numberOfStars;
@synthesize totalNumberOfStars = _totalNumberOfStars;
@synthesize emptyStarImage = _emptyStarImage;
@@ -25,6 +28,8 @@ @implementation SSRatingPicker
@synthesize starSpacing = _starSpacing;
@synthesize textLabel = _textLabel;
+
+#pragma mark
#pragma mark NSObject
- (void)dealloc {
@@ -35,6 +40,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIResponder
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -47,6 +53,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)rect {
@@ -128,6 +135,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
+#pragma mark -
#pragma mark Private Methods
- (void)_setNumberOfStarsWithTouch:(UITouch *)touch {
@@ -152,6 +160,7 @@ - (void)_setNumberOfStarsWithTouch:(UITouch *)touch {
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
14 SSToolkit/SSRatingPickerScrollView.m
@@ -15,10 +15,14 @@
@implementation SSRatingPickerScrollView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize ratingPicker = _ratingPicker;
@synthesize titleTextField = _titleTextField;
@synthesize reviewTextField = _reviewTextField;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -32,6 +36,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -101,14 +106,7 @@ - (void)layoutSubviews {
}
-#pragma mark UIScrollView
-
-//- (void)setContentSize:(CGSize)size {
-// [super setContentSize:size];
-// [self setNeedsDisplay];
-//}
-
-
+#pragma mark -
#pragma mark UITextViewDelegate
- (void)textViewDidChange:(UITextView *)textView {
View
8 SSToolkit/SSRatingPickerViewController.m
@@ -15,8 +15,13 @@
@implementation SSRatingPickerViewController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize scrollView = _scrollView;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -25,6 +30,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIViewController
- (void)loadView {
@@ -52,6 +58,7 @@ - (void)viewWillAppear:(BOOL)animated {
}
+#pragma mark -
#pragma mark SSViewController
- (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
@@ -64,6 +71,7 @@ - (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
}
+#pragma mark -
#pragma mark Getters
- (SSRatingPicker *)ratingPicker {
View
49 SSToolkit/SSSegmentedControl.m
@@ -20,8 +20,10 @@ - (void)_setMetaValue:(id)value forKey:(NSString *)key segmentIndex:(NSUInteger)
@implementation SSSegmentedControl
+#pragma mark -
+#pragma mark Accessors
+
@synthesize numberOfSegments;
-@synthesize selectedSegmentIndex = _selectedSegmentIndex;
@synthesize momentary = _momentary;
@synthesize buttonImage = _buttonImage;
@synthesize highlightedButtonImage = _highlightedButtonImage;
@@ -34,6 +36,26 @@ @implementation SSSegmentedControl
@synthesize textShadowOffset = _textShadowOffset;
@synthesize textEdgeInsets = _textEdgeInsets;
+@synthesize selectedSegmentIndex = _selectedSegmentIndex;
+
+- (void)setSelectedSegmentIndex:(NSInteger)index {
+ if (_selectedSegmentIndex == index) {
+ return;
+ }
+
+ _selectedSegmentIndex = index;
+ [self setNeedsDisplay];
+ [self sendActionsForControlEvents:UIControlEventValueChanged];
+}
+
+
+- (void)setFrame:(CGRect)rect {
+ [super setFrame:rect];
+ [self setNeedsDisplay];
+}
+
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -51,6 +73,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIResponder
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -79,6 +102,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -237,12 +261,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
-- (void)setFrame:(CGRect)rect {
- [super setFrame:rect];
- [self setNeedsDisplay];
-}
-
-
+#pragma mark -
#pragma mark Initializer
- (id)initWithItems:(NSArray *)items {
@@ -262,6 +281,7 @@ - (id)initWithItems:(NSArray *)items {
}
+#pragma mark -
#pragma mark Segments
- (NSUInteger)numberOfSegments {
@@ -334,19 +354,7 @@ - (BOOL)isEnabledForSegmentAtIndex:(NSUInteger)segment {
}
-#pragma mark Setters
-
-- (void)setSelectedSegmentIndex:(NSInteger)index {
- if (_selectedSegmentIndex == index) {
- return;
- }
-
- _selectedSegmentIndex = index;
- [self setNeedsDisplay];
- [self sendActionsForControlEvents:UIControlEventValueChanged];
-}
-
-
+#pragma mark -
#pragma mark Private Methods
- (NSMutableDictionary *)_metaForSegmentIndex:(NSUInteger)index {
@@ -382,6 +390,7 @@ - (void)_setMetaValue:(id)value forKey:(NSString *)key segmentIndex:(NSUInteger)
}
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
22 SSToolkit/SSSwitch.m
@@ -18,7 +18,16 @@ - (void)_handleDraggingEnded:(id)sender;
@implementation SSSwitch
+#pragma mark -
+#pragma mark Accessors
+
@synthesize on = _on;
+
+- (void)setOn:(BOOL)on {
+ [self setOn:on animated:NO];
+}
+
+
@synthesize style = _style;
@synthesize handle = _handle;
@synthesize leftHandleImage = _leftHandleImage;
@@ -38,6 +47,8 @@ @implementation SSSwitch
@synthesize trackEdgeInsets = _trackEdgeInsets;
@synthesize switchLabelStyle = _switchLabelStyle;
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -59,6 +70,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -155,13 +167,9 @@ - (void)willMoveToSuperview:(UIView *)newSuperview {
}
+#pragma mark -
#pragma mark Switch
-- (void)setOn:(BOOL)on {
- [self setOn:on animated:NO];
-}
-
-
- (void)setOn:(BOOL)on animated:(BOOL)animated {
_on = on;
// TODO: UIControl stuff
@@ -192,6 +200,7 @@ - (void)toggleAnimated:(BOOL)animated {
}
+#pragma mark -
#pragma mark Private Methods
- (void)_layoutSubviewsWithHandlePosition:(CGFloat)x {
@@ -275,6 +284,7 @@ - (void)_handleDraggingEnded:(id)sender {
}
+#pragma mark -
#pragma mark Setters
- (void)setStyle:(SSSwitchStyle)s {
@@ -324,7 +334,7 @@ - (void)setStyle:(SSSwitchStyle)s {
}
-
+#pragma mark -
#pragma mark NSKeyValueObserving
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
View
9 SSToolkit/SSTableViewController.m
@@ -11,9 +11,14 @@
@implementation SSTableViewController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize tableView = _tableView;
@synthesize clearsSelectionOnViewWillAppear = _clearsSelectionOnViewWillAppear;
+
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -30,6 +35,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIViewController
- (void)loadView {
@@ -62,6 +68,7 @@ - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
}
+#pragma mark -
#pragma mark SSViewController
- (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
@@ -70,6 +77,7 @@ - (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
}
+#pragma mark -
#pragma mark Initializer
- (id)initWithStyle:(UITableViewStyle)style {
@@ -84,6 +92,7 @@ - (id)initWithStyle:(UITableViewStyle)style {
}
+#pragma mark -
#pragma mark UITableViewDataSource
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
View
6 SSToolkit/SSTextField.m
@@ -11,9 +11,14 @@
@implementation SSTextField
+#pragma mark -
+#pragma mark Accessors
+
@synthesize textEdgeInsets = _textEdgeInsets;
@synthesize clearButtonEdgeInsets = _clearButtonEdgeInsets;
+
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -25,6 +30,7 @@ - (id)initWithFrame:(CGRect)frame {
}
+#pragma mark -
#pragma mark UITextField
- (CGRect)textRectForBounds:(CGRect)bounds {
View
44 SSToolkit/SSTextView.m
@@ -16,9 +16,31 @@ - (void)_textChanged:(NSNotification *)notification;
@implementation SSTextView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize placeholder = _placeholder;
@synthesize placeholderColor = _placeholderColor;
+- (void)setText:(NSString *)string {
+ [super setText:string];
+ [self _updateShouldDrawPlaceholder];
+}
+
+
+- (void)setPlaceholder:(NSString *)string {
+ if ([string isEqual:_placeholder]) {
+ return;
+ }
+
+ [_placeholder release];
+ _placeholder = [string retain];
+
+ [self _updateShouldDrawPlaceholder];
+}
+
+
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -30,6 +52,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -53,26 +76,7 @@ - (void)drawRect:(CGRect)rect {
}
-#pragma mark Setters
-
-- (void)setText:(NSString *)string {
- [super setText:string];
- [self _updateShouldDrawPlaceholder];
-}
-
-
-- (void)setPlaceholder:(NSString *)string {
- if ([string isEqual:_placeholder]) {
- return;
- }
-
- [_placeholder release];
- _placeholder = [string retain];
-
- [self _updateShouldDrawPlaceholder];
-}
-
-
+#pragma mark -
#pragma mark Private Methods
- (void)_updateShouldDrawPlaceholder {
View
9 SSToolkit/SSViewController.m
@@ -24,12 +24,17 @@ - (void)_dismissVignetteAnimationDidStop:(NSString *)animationID finished:(NSNum
@implementation SSViewController
+#pragma mark -
+#pragma mark Accessors
+
@synthesize modalParentViewController = _modalParentViewController;
@synthesize customModalViewController = _customModalViewController;
@synthesize dismissCustomModalOnVignetteTap = _dismissCustomModalOnVignetteTap;
@synthesize contentSizeForViewInCustomModal = _contentSizeForViewInCustomModal;
@synthesize originOffsetForViewInCustomModal = _originOffsetForViewInCustomModal;
+
+#pragma mark -
#pragma mark NSObject
- (id)init {
@@ -48,6 +53,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIViewController
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
@@ -63,6 +69,7 @@ - (void)viewWillAppear:(BOOL)animated {
}
+#pragma mark -
#pragma mark Layout
- (void)layoutViews {
@@ -104,6 +111,7 @@ - (void)layoutViewsWithOrientation:(UIInterfaceOrientation)orientation {
}
+#pragma mark -
#pragma mark Modal
- (void)presentCustomModalViewController:(UIViewController<SSModalViewController> *)viewController {
@@ -270,6 +278,7 @@ - (void)customModalDidDisappear:(BOOL)animated {
}
+#pragma mark -
#pragma mark Private Methods
- (void)_cleanUpModal {
View
12 SSToolkit/SSWebView.m
@@ -22,6 +22,9 @@ - (void)_DOMLoaded;
@implementation SSWebView
+#pragma mark -
+#pragma mark Accessors
+
@synthesize delegate = _delegate;
@synthesize scrollEnabled = _scrollEnabled;
@synthesize bounces = _bounces;
@@ -30,6 +33,7 @@ @implementation SSWebView
@synthesize lastRequest = _lastRequest;
@synthesize loadingPage = _loadingPage;
+#pragma mark -
#pragma mark NSObject
- (void)dealloc {
@@ -42,6 +46,7 @@ - (void)dealloc {
}
+#pragma mark -
#pragma mark UIView
- (id)initWithFrame:(CGRect)frame {
@@ -63,6 +68,7 @@ - (void)layoutSubviews {
}
+#pragma mark -
#pragma mark SSWebView Methods
- (void)dismissKeyboard {
@@ -122,6 +128,7 @@ - (void)reset {
}
+#pragma mark -
#pragma mark Convenience Methods
- (void)loadHTMLString:(NSString *)string {
@@ -146,6 +153,7 @@ - (void)loadURLString:(NSString *)string {
}
+#pragma mark -
#pragma mark Private Methods
+ (BOOL)_isBackedByScroller {
@@ -187,6 +195,7 @@ - (void)_DOMLoaded {
}
+#pragma mark -
#pragma mark Getters
- (BOOL)shadowsHidden {
@@ -203,6 +212,7 @@ - (BOOL)shadowsHidden {
}
+#pragma mark -
#pragma mark Setters
- (void)setOpaque:(BOOL)o {
@@ -346,6 +356,7 @@ - (void)setShadowsHidden:(BOOL)hide {
}
+#pragma mark -
#pragma mark UIWebView Methods
- (BOOL)canGoBack {
@@ -465,6 +476,7 @@ - (void)setMediaPlaybackRequiresUserAction:(BOOL)requires {
#endif
+#pragma mark -
#pragma mark UIWebViewDelegate
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {

0 comments on commit 62be25e

Please sign in to comment.