Skip to content
Browse files

Moved SSIndicatorLabel to its own project since no one really uses this

  • Loading branch information...
1 parent 600465f commit f0a9215553be154a5fdeac5b783d225cef9d72e4 @soffes soffes committed Oct 9, 2011
View
3 Readme.markdown
@@ -10,6 +10,9 @@ If you're using this in your project, I'd love to hear about it! [Send me an ema
### Views
+* [SSAnimatedImageView][] - easily create timed or keyframed animations
+* [SSBadgeView][] - badge accessory view for table cells, similar to Mail.app unread counts
+* [SSBorderedView][] - draw boxes with top and bottom borders with optional insets
* [SSCollectionView][] - simple collection view modeled after UITableView and NSCollectionView
* [SSGradientView][] - easily create gradients with optional borders and insets
* [SSHUDView][] - simple heads-up display
View
16 SSCatalog/Classes/SCIndicatorLabelDemoViewController.h
@@ -1,16 +0,0 @@
-//
-// SCIndicatorLabelDemoViewController.h
-// SSCatalog
-//
-// Created by Sam Soffes on 11/15/10.
-// Copyright 2010 Sam Soffes. All rights reserved.
-//
-
-@interface SCIndicatorLabelDemoViewController : UIViewController
-
-+ (NSString *)title;
-
-- (void)start:(id)sender;
-- (void)stop:(id)sender;
-
-@end
View
87 SSCatalog/Classes/SCIndicatorLabelDemoViewController.m
@@ -1,87 +0,0 @@
-//
-// SCIndicatorLabelDemoViewController.m
-// SSCatalog
-//
-// Created by Sam Soffes on 11/15/10.
-// Copyright 2010 Sam Soffes. All rights reserved.
-//
-
-#import "SCIndicatorLabelDemoViewController.h"
-
-@implementation SCIndicatorLabelDemoViewController {
- SSIndicatorLabel *_indicatorLabel;
-}
-
-
-#pragma mark - Class Methods
-
-+ (NSString *)title {
- return @"Indicator Label";
-}
-
-
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_indicatorLabel release];
- [super dealloc];
-}
-
-
-#pragma mark - UIViewController
-
-- (void)viewDidLoad {
- [super viewDidLoad];
- self.title = [[self class] title];
- self.view.backgroundColor = [UIColor colorWithRed:0.851f green:0.859f blue:0.882f alpha:1.0f];
-
- CGFloat width = self.view.frame.size.width;
-
- // Indicator label
- _indicatorLabel = [[SSIndicatorLabel alloc] initWithFrame:CGRectMake(20.0f, 20.0f, width - 40.0f, 44.0f)];
- _indicatorLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
- _indicatorLabel.backgroundColor = [UIColor clearColor];
- _indicatorLabel.activityIndicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
- _indicatorLabel.textLabel.text = @"Click start";
- [self.view addSubview:_indicatorLabel];
-
- CGFloat buttonWidth = (width / 2.0f) - 30.0;
-
- // Start button
- UIButton *startButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- [startButton setTitle:@"Start" forState:UIControlStateNormal];
- [startButton addTarget:self action:@selector(start:) forControlEvents:UIControlEventTouchUpInside];
- startButton.frame = CGRectMake(20.0f, 84.0f, buttonWidth, 44.0f);
- startButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
- [self.view addSubview:startButton];
-
- // Stop button
- UIButton *stopButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- [stopButton setTitle:@"Stop" forState:UIControlStateNormal];
- [stopButton addTarget:self action:@selector(stop:) forControlEvents:UIControlEventTouchUpInside];
- stopButton.frame = CGRectMake(40.0 + buttonWidth, 84.0f, buttonWidth, 44.0f);
- stopButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
- [self.view addSubview:stopButton];
-}
-
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
- return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
- }
- return YES;
-}
-
-
-#pragma mark - Actions
-
-- (void)start:(id)sender {
- [_indicatorLabel startWithText:@"Loading something..."];
-}
-
-
-- (void)stop:(id)sender {
- [_indicatorLabel completeWithText:@"Done!"];
-}
-
-@end
View
1 SSCatalog/Classes/SCRootViewController.m
@@ -44,7 +44,6 @@ - (void)viewDidLoad {
@"SCCollectionViewDemoViewController",
@"SCGradientViewDemoViewController",
@"SCHUDViewDemoViewController",
- @"SCIndicatorLabelDemoViewController",
@"SCLineViewDemoViewController",
@"SCLoadingViewDemoViewController",
@"SCPieProgressViewDemoViewController",
View
6 SSCatalog/SSCatalog.xcodeproj/project.pbxproj
@@ -19,7 +19,6 @@
B24E9EB2121DC35B0085F81E /* SCRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9EA9121DC35B0085F81E /* SCRootViewController.m */; };
B25541EE12FF22B500D6E187 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = B25541ED12FF22B500D6E187 /* Default-Landscape~ipad.png */; };
B25541F012FF22BA00D6E187 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = B25541EF12FF22BA00D6E187 /* Default-Portrait~ipad.png */; };
- B2572FEC12924C28001FC061 /* SCIndicatorLabelDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2572FEB12924C28001FC061 /* SCIndicatorLabelDemoViewController.m */; };
B257303D1292524F001FC061 /* SCLoadingViewDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B257303C1292524F001FC061 /* SCLoadingViewDemoViewController.m */; };
B27B1A581224228000111EA2 /* SCCollectionViewDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B27B1A571224228000111EA2 /* SCCollectionViewDemoViewController.m */; };
B28C6D0B12FBE96600667755 /* SSRatingDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B28C6D0A12FBE96600667755 /* SSRatingDemoViewController.m */; };
@@ -107,8 +106,6 @@
B24E9EC5121DC3CF0085F81E /* SSToolkit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SSToolkit.xcodeproj; path = ../SSToolkit.xcodeproj; sourceTree = SOURCE_ROOT; };
B25541ED12FF22B500D6E187 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; };
B25541EF12FF22BA00D6E187 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; };
- B2572FEA12924C28001FC061 /* SCIndicatorLabelDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCIndicatorLabelDemoViewController.h; sourceTree = "<group>"; };
- B2572FEB12924C28001FC061 /* SCIndicatorLabelDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCIndicatorLabelDemoViewController.m; sourceTree = "<group>"; };
B257303B1292524F001FC061 /* SCLoadingViewDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCLoadingViewDemoViewController.h; sourceTree = "<group>"; };
B257303C1292524F001FC061 /* SCLoadingViewDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCLoadingViewDemoViewController.m; sourceTree = "<group>"; };
B27B1A561224228000111EA2 /* SCCollectionViewDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCCollectionViewDemoViewController.h; sourceTree = "<group>"; };
@@ -300,8 +297,6 @@
B24E9E9B121DC35B0085F81E /* SCGradientViewDemoViewController.m */,
B24E9E9C121DC35B0085F81E /* SCHUDViewDemoViewController.h */,
B24E9E9D121DC35B0085F81E /* SCHUDViewDemoViewController.m */,
- B2572FEA12924C28001FC061 /* SCIndicatorLabelDemoViewController.h */,
- B2572FEB12924C28001FC061 /* SCIndicatorLabelDemoViewController.m */,
B24E9E9E121DC35B0085F81E /* SCLineViewDemoViewController.h */,
B24E9E9F121DC35B0085F81E /* SCLineViewDemoViewController.m */,
B257303B1292524F001FC061 /* SCLoadingViewDemoViewController.h */,
@@ -486,7 +481,6 @@
B24E9EB1121DC35B0085F81E /* SCPieProgressViewDemoViewController.m in Sources */,
B24E9EB2121DC35B0085F81E /* SCRootViewController.m in Sources */,
B27B1A581224228000111EA2 /* SCCollectionViewDemoViewController.m in Sources */,
- B2572FEC12924C28001FC061 /* SCIndicatorLabelDemoViewController.m in Sources */,
B257303D1292524F001FC061 /* SCLoadingViewDemoViewController.m in Sources */,
B2B3CEEF1296F78D001BAC94 /* SCSwitchDemoViewController.m in Sources */,
E7FD242712F4FFC5006A6691 /* SCBadgeTableViewCellDemoViewController.m in Sources */,
View
8 SSToolkit.xcodeproj/project.pbxproj
@@ -50,8 +50,6 @@
B24E9E52121DC29A0085F81E /* SSGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E14121DC29A0085F81E /* SSGradientView.m */; };
B24E9E53121DC29A0085F81E /* SSHUDView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E15121DC29A0085F81E /* SSHUDView.h */; };
B24E9E54121DC29A0085F81E /* SSHUDView.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E16121DC29A0085F81E /* SSHUDView.m */; };
- B24E9E55121DC29A0085F81E /* SSIndicatorLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E17121DC29A0085F81E /* SSIndicatorLabel.h */; };
- B24E9E56121DC29A0085F81E /* SSIndicatorLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E18121DC29A0085F81E /* SSIndicatorLabel.m */; };
B24E9E59121DC29A0085F81E /* SSLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E1B121DC29A0085F81E /* SSLabel.h */; };
B24E9E5A121DC29A0085F81E /* SSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E1C121DC29A0085F81E /* SSLabel.m */; };
B24E9E5B121DC29A0085F81E /* SSLineView.h in Headers */ = {isa = PBXBuildFile; fileRef = B24E9E1D121DC29A0085F81E /* SSLineView.h */; };
@@ -189,8 +187,6 @@
B24E9E14121DC29A0085F81E /* SSGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSGradientView.m; sourceTree = "<group>"; };
B24E9E15121DC29A0085F81E /* SSHUDView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSHUDView.h; sourceTree = "<group>"; };
B24E9E16121DC29A0085F81E /* SSHUDView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSHUDView.m; sourceTree = "<group>"; };
- B24E9E17121DC29A0085F81E /* SSIndicatorLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSIndicatorLabel.h; sourceTree = "<group>"; };
- B24E9E18121DC29A0085F81E /* SSIndicatorLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSIndicatorLabel.m; sourceTree = "<group>"; };
B24E9E1B121DC29A0085F81E /* SSLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLabel.h; sourceTree = "<group>"; };
B24E9E1C121DC29A0085F81E /* SSLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSLabel.m; sourceTree = "<group>"; };
B24E9E1D121DC29A0085F81E /* SSLineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSLineView.h; sourceTree = "<group>"; };
@@ -468,8 +464,6 @@
B24E9E14121DC29A0085F81E /* SSGradientView.m */,
B24E9E15121DC29A0085F81E /* SSHUDView.h */,
B24E9E16121DC29A0085F81E /* SSHUDView.m */,
- B24E9E17121DC29A0085F81E /* SSIndicatorLabel.h */,
- B24E9E18121DC29A0085F81E /* SSIndicatorLabel.m */,
B24E9E1B121DC29A0085F81E /* SSLabel.h */,
B24E9E1C121DC29A0085F81E /* SSLabel.m */,
B24E9E1D121DC29A0085F81E /* SSLineView.h */,
@@ -584,7 +578,6 @@
B24E9E50121DC29A0085F81E /* SSDrawingUtilities.h in Headers */,
B24E9E51121DC29A0085F81E /* SSGradientView.h in Headers */,
B24E9E53121DC29A0085F81E /* SSHUDView.h in Headers */,
- B24E9E55121DC29A0085F81E /* SSIndicatorLabel.h in Headers */,
B24E9E59121DC29A0085F81E /* SSLabel.h in Headers */,
B24E9E5B121DC29A0085F81E /* SSLineView.h in Headers */,
B24E9E5D121DC29A0085F81E /* SSLoadingView.h in Headers */,
@@ -739,7 +732,6 @@
B24E9E4C121DC29A0085F81E /* NSURL+SSToolkitAdditions.m in Sources */,
B24E9E52121DC29A0085F81E /* SSGradientView.m in Sources */,
B24E9E54121DC29A0085F81E /* SSHUDView.m in Sources */,
- B24E9E56121DC29A0085F81E /* SSIndicatorLabel.m in Sources */,
B24E9E5A121DC29A0085F81E /* SSLabel.m in Sources */,
B24E9E5C121DC29A0085F81E /* SSLineView.m in Sources */,
B24E9E5E121DC29A0085F81E /* SSLoadingView.m in Sources */,
View
48 SSToolkit/SSIndicatorLabel.h
@@ -1,48 +0,0 @@
-//
-// SSIndicatorLabel.h
-// SSToolkit
-//
-// Created by Sam Soffes on 7/13/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-/**
- This class is a nice little view that makes showing an activity indicator next to a label when loading something easy.
-
- The indicator will slide in from the left when loading and then back out when it is complete. This is great for a view
- that shows some sort of status that can refresh.
- */
-@interface SSIndicatorLabel : UIView
-
-/**
- Returns the label used for the main textual content of the view. (read-only)
- */
-@property (nonatomic, retain, readonly) UILabel *textLabel;
-
-/**
- A view that indicates loading activity to the user. (read-only)
- */
-@property (nonatomic, retain, readonly) UIActivityIndicatorView *activityIndicatorView;
-
-/**
- A Boolean value that determines whether the view is loading.
-
- The default value is `NO`.
- */
-@property (nonatomic, assign, getter=isLoading) BOOL loading;
-
-/**
- Starts loading and updates the text of the text label.
-
- @param text String to update the `textLabel`'s `text` property to.
- */
-- (void)startWithText:(NSString *)text;
-
-/**
- Completes loading and updates the text of the text label.
-
- @param text String to update the `textLabel`'s `text` property to.
- */
-- (void)completeWithText:(NSString *)text;
-
-@end
View
123 SSToolkit/SSIndicatorLabel.m
@@ -1,123 +0,0 @@
-//
-// SSIndicatorLabel.m
-// SSToolkit
-//
-// Created by Sam Soffes on 7/13/10.
-// Copyright 2010-2011 Sam Soffes. All rights reserved.
-//
-
-#import "SSIndicatorLabel.h"
-
-@interface SSIndicatorLabel (PrivateMethods)
-+ (CGSize)indicatorSize;
-+ (CGFloat)padding;
-@end
-
-@implementation SSIndicatorLabel
-
-#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 - Class Methods
-
-+ (CGSize)indicatorSize {
- return CGSizeMake(20.0f, 20.0f);
-}
-
-
-+ (CGFloat)padding {
- return 6.0f;
-}
-
-
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_textLabel release];
- [_activityIndicatorView release];
- [super dealloc];
-}
-
-
-#pragma mark - UIView
-
-- (id)initWithFrame:(CGRect)rect {
- if ((self = [super initWithFrame:rect])) {
- self.clipsToBounds = YES;
-
- _textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
- [self addSubview:_textLabel];
-
- _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectZero];
- [_activityIndicatorView startAnimating];
- [self addSubview:_activityIndicatorView];
-
- _loading = NO;
- [self layoutSubviews];
- }
- return self;
-}
-
-
-- (void)layoutSubviews {
- CGRect rect = self.frame;
- CGSize size = [[self class] indicatorSize];
- CGFloat x = size.width + [[self class] padding];
-
- // Loading
- if (_loading) {
- _textLabel.frame = CGRectMake(x, 0.0f, rect.size.width - x, size.height);
- _activityIndicatorView.frame = CGRectMake(0.0f, 0.0f, size.width, size.height);
- }
-
- // Not loading
- else {
- _textLabel.frame = CGRectMake(0.0f, 0.0f, rect.size.width, size.height);
- _activityIndicatorView.frame = CGRectMake(-x, 0.0f, size.width, size.height);
- }
-}
-
-
-- (void)setBackgroundColor:(UIColor *)color {
- [super setBackgroundColor:color];
- _textLabel.backgroundColor = color;
- _activityIndicatorView.backgroundColor = color;
-}
-
-
-- (void)setOpaque:(BOOL)o {
- [super setOpaque:o];
- _textLabel.opaque = o;
- _activityIndicatorView.opaque = o;
-}
-
-
-#pragma mark - Status
-
-- (void)startWithText:(NSString *)text {
- self.loading = YES;
- _textLabel.text = text;
-}
-
-- (void)completeWithText:(NSString *)text {
- self.loading = NO;
- _textLabel.text = text;
-}
-
-@end
View
2 SSToolkit/SSToolkit.h
@@ -19,7 +19,6 @@
#import "SSCollectionViewItem.h"
#import "SSGradientView.h"
#import "SSHUDView.h"
-#import "SSIndicatorLabel.h"
#import "SSLabel.h"
#import "SSLineView.h"
#import "SSLoadingView.h"
@@ -60,7 +59,6 @@
#import <SSToolkit/SSCollectionViewItem.h>
#import <SSToolkit/SSGradientView.h>
#import <SSToolkit/SSHUDView.h>
-#import <SSToolkit/SSIndicatorLabel.h>
#import <SSToolkit/SSLabel.h>
#import <SSToolkit/SSLineView.h>
#import <SSToolkit/SSLoadingView.h>

0 comments on commit f0a9215

Please sign in to comment.
Something went wrong with that request. Please try again.