Skip to content

Commit

Permalink
Update SSCatalog example.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed May 28, 2012
1 parent 11ecc3a commit 7d436e6
Show file tree
Hide file tree
Showing 27 changed files with 84 additions and 458 deletions.
7 changes: 7 additions & 0 deletions examples/SSCatalog/.gitignore
@@ -0,0 +1,7 @@
.DS_Store
*.mode1v3
*.pbxuser
*.perspectivev3
*.xcworkspace
xcuserdata
Documentation
6 changes: 6 additions & 0 deletions examples/SSCatalog/.gitmodules
@@ -0,0 +1,6 @@
[submodule "Vendor/AFNetworking"]
path = Vendor/AFNetworking
url = https://github.com/gowalla/AFNetworking.git
[submodule "Vendor/SSToolkit"]
path = Vendor/SSToolkit
url = https://github.com/samsoffes/sstoolkit.git
5 changes: 0 additions & 5 deletions examples/SSCatalog/Classes/SCAddressBarDemoViewController.m
Expand Up @@ -27,11 +27,6 @@ + (NSString *)title {

- (void)dealloc {
_webView.delegate = nil;
[_webView release];
[_headerView release];
[_titleLabel release];
[_addressBar release];
[super dealloc];
}


Expand Down
4 changes: 2 additions & 2 deletions examples/SSCatalog/Classes/SCAppDelegate.h
Expand Up @@ -8,7 +8,7 @@

@interface SCAppDelegate : NSObject <UIApplicationDelegate>

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) UINavigationController *navigationController;
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) UINavigationController *navigationController;

@end
11 changes: 0 additions & 11 deletions examples/SSCatalog/Classes/SCAppDelegate.m
Expand Up @@ -21,15 +21,6 @@ @implementation SCAppDelegate {
@synthesize navigationController = _navigationController;


#pragma mark - NSObject

- (void)dealloc {
[_navigationController release];
[_window release];
[super dealloc];
}


#pragma mark - UIApplicationDelegate

- (void)applicationDidFinishLaunching:(UIApplication *)application {
Expand All @@ -41,8 +32,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {

self.navigationController = aNavigationController;

[viewController release];
[aNavigationController release];

[_window addSubview:_navigationController.view];
[_window makeKeyAndVisible];
Expand Down
Expand Up @@ -63,7 +63,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

SSBadgeTableViewCell *cell = (SSBadgeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[SSBadgeTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier] autorelease];
cell = [[SSBadgeTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
}

if (indexPath.section == 0) {
Expand Down
Expand Up @@ -53,7 +53,7 @@ - (SSCollectionViewItem *)collectionView:(SSCollectionView *)aCollectionView ite

SCImageCollectionViewItem *item = (SCImageCollectionViewItem *)[aCollectionView dequeueReusableItemWithIdentifier:itemIdentifier];
if (item == nil) {
item = [[[SCImageCollectionViewItem alloc] initWithReuseIdentifier:itemIdentifier] autorelease];
item = [[SCImageCollectionViewItem alloc] initWithReuseIdentifier:itemIdentifier];
}

CGFloat size = 80.0f * [[UIScreen mainScreen] scale];
Expand All @@ -72,7 +72,7 @@ - (UIView *)collectionView:(SSCollectionView *)aCollectionView viewForHeaderInSe
header.shadowColor = [UIColor whiteColor];
header.shadowOffset = CGSizeMake(0.0f, 1.0f);
header.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.8f];
return [header autorelease];
return header;
}


Expand All @@ -89,7 +89,6 @@ - (void)collectionView:(SSCollectionView *)aCollectionView didSelectItemAtIndexP
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:nil delegate:nil
cancelButtonTitle:@"Oh, awesome!" otherButtonTitles:nil];
[alert show];
[alert release];
}


Expand Down
9 changes: 0 additions & 9 deletions examples/SSCatalog/Classes/SCGradientViewDemoViewController.m
Expand Up @@ -21,14 +21,6 @@ + (NSString *)title {
}


#pragma mark - NSObject

- (void)dealloc {
[_gradientView release];
[super dealloc];
}


#pragma mark - UIViewController

- (void)viewDidLoad {
Expand Down Expand Up @@ -62,7 +54,6 @@ - (void)viewDidLoad {
scaleSlider.maximumValue = 1.0f;
[scaleSlider addTarget:self action:@selector(updateScale:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:scaleSlider];
[scaleSlider release];

_blue = YES;
}
Expand Down
8 changes: 0 additions & 8 deletions examples/SSCatalog/Classes/SCHUDViewDemoViewController.m
Expand Up @@ -20,14 +20,6 @@ + (NSString *)title {
}


#pragma mark - NSObject

- (void)dealloc {
[_hud release];
[super dealloc];
}


#pragma mark - UIViewController

- (void)viewDidLoad {
Expand Down
2 changes: 1 addition & 1 deletion examples/SSCatalog/Classes/SCImageCollectionViewItem.h
Expand Up @@ -8,7 +8,7 @@

@interface SCImageCollectionViewItem : SSCollectionViewItem

@property (nonatomic, retain) NSURL *imageURL;
@property (nonatomic, strong) NSURL *imageURL;

- (id)initWithReuseIdentifier:(NSString *)aReuseIdentifier;

Expand Down
10 changes: 0 additions & 10 deletions examples/SSCatalog/Classes/SCImageCollectionViewItem.m
Expand Up @@ -16,8 +16,6 @@ @implementation SCImageCollectionViewItem
@synthesize imageURL = _imageURL;

- (void)setImageURL:(NSURL *)url {
[url retain];
[_imageURL release];
_imageURL = url;

if (_imageURL) {
Expand All @@ -28,14 +26,6 @@ - (void)setImageURL:(NSURL *)url {
}


#pragma mark - NSObject

- (void)dealloc {
[_imageURL release];
[super dealloc];
}


#pragma mark - Initializer

- (id)initWithReuseIdentifier:(NSString *)aReuseIdentifier {
Expand Down
4 changes: 0 additions & 4 deletions examples/SSCatalog/Classes/SCLineViewDemoViewController.m
Expand Up @@ -26,24 +26,20 @@ - (void)viewDidLoad {

SSLineView *lineView1 = [[SSLineView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 280.0f, 2.0f)];
[self.view addSubview:lineView1];
[lineView1 release];

SSLineView *lineView2 = [[SSLineView alloc] initWithFrame:CGRectMake(20.0f, 42.0f, 280.0f, 2.0f)];
lineView2.lineColor = [UIColor blueColor];
[self.view addSubview:lineView2];
[lineView2 release];

SSLineView *lineView3 = [[SSLineView alloc] initWithFrame:CGRectMake(20.0f, 64.0f, 280.0f, 2.0f)];
lineView3.lineColor = [UIColor orangeColor];
lineView3.dashLengths = [NSArray arrayWithObjects:[NSNumber numberWithFloat:5.0f], [NSNumber numberWithFloat:2.0f], nil];
[self.view addSubview:lineView3];
[lineView3 release];

SSLineView *lineView4 = [[SSLineView alloc] initWithFrame:CGRectMake(20.0f, 86.0f, 280.0f, 2.0f)];
lineView4.lineColor = [UIColor greenColor];
lineView4.dashLengths = [NSArray arrayWithObjects:[NSNumber numberWithFloat:2.0f], [NSNumber numberWithFloat:2.0f], nil];
[self.view addSubview:lineView4];
[lineView4 release];
}


Expand Down
Expand Up @@ -28,7 +28,6 @@ - (void)viewDidLoad {

SSLoadingView *loadingView = [[SSLoadingView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, size.width, size.height)];
[self.view addSubview:loadingView];
[loadingView release];
}


Expand Down
2 changes: 1 addition & 1 deletion examples/SSCatalog/Classes/SCPickerDemoViewController.h
Expand Up @@ -8,7 +8,7 @@

@interface SCPickerDemoViewController : UITableViewController

@property (nonatomic, retain) NSString *selectedAbbreviation;
@property (nonatomic, strong) NSString *selectedAbbreviation;

+ (NSString *)title;

Expand Down
9 changes: 1 addition & 8 deletions examples/SSCatalog/Classes/SCPickerDemoViewController.m
Expand Up @@ -30,12 +30,6 @@ - (id)init {
}


- (void)dealloc {
[_selectedAbbreviation release];
[super dealloc];
}


#pragma mark - UIViewController

- (void)viewDidLoad {
Expand Down Expand Up @@ -76,7 +70,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier] autorelease];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
}

cell.textLabel.text = @"Picker Value";
Expand All @@ -93,7 +87,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
SCPickerDetailViewController *viewController = [[SCPickerDetailViewController alloc] initWithStyle:UITableViewStyleGrouped];
viewController.selectedKey = self.selectedAbbreviation;
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}

@end
10 changes: 0 additions & 10 deletions examples/SSCatalog/Classes/SCPieProgressViewDemoViewController.m
Expand Up @@ -24,10 +24,7 @@ + (NSString *)title {
#pragma mark - NSObject

- (void)dealloc {
[_progressView7 release];
[_timer invalidate];
[_timer release];
[super dealloc];
}


Expand All @@ -41,36 +38,29 @@ - (void)viewDidLoad {
SSPieProgressView *progressView1 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 55.0f, 55.0f)];
progressView1.progress = 0.25;
[self.view addSubview:progressView1];
[progressView1 release];

SSPieProgressView *progressView2 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(95.0f, 20.0f, 55.0f, 55.0f)];
progressView2.progress = 0.50;
[self.view addSubview:progressView2];
[progressView2 release];

SSPieProgressView *progressView3 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(170.0f, 20.0f, 55.0f, 55.0f)];
progressView3.progress = 0.75;
[self.view addSubview:progressView3];
[progressView3 release];

SSPieProgressView *progressView4 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(245.0f, 20.0f, 55.0f, 55.0f)];
progressView4.progress = 1.0;
[self.view addSubview:progressView4];
[progressView4 release];

SSPieProgressView *progressView5 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(20.0f, 95.0f, 130.0f, 130.0f)];
progressView5.progress = 0.33;
[self.view addSubview:progressView5];
[progressView5 release];

SSPieProgressView *progressView6 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(170.0f, 95.0f, 130.0f, 130.0f)];
progressView6.progress = 0.66;
[self.view addSubview:progressView6];
[progressView6 release];

_progressView7 = [[SSPieProgressView alloc] initWithFrame:CGRectMake(95.0f, 245.0f, 130.0f, 130.0f)];
[self.view addSubview:_progressView7];
[_progressView7 release];

_timer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(incrementProgress:) userInfo:nil repeats:YES];
}
Expand Down
13 changes: 1 addition & 12 deletions examples/SSCatalog/Classes/SCRootViewController.m
Expand Up @@ -22,14 +22,6 @@ @implementation SCRootViewController {
}


#pragma mark - NSObject

- (void)dealloc {
[_viewControllers release];
[super dealloc];
}


#pragma mark - UIViewController

- (void)viewDidLoad {
Expand All @@ -53,8 +45,6 @@ - (void)viewDidLoad {
[NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:
@"SCAddressBarDemoViewController",
@"SCSegmentedControlDemoViewController",
@"SCSwitchDemoViewController",
nil], kClassesKey,
@"Controls", kTitleKey,
nil],
Expand Down Expand Up @@ -95,7 +85,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; }
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; }

Class klass = [[NSBundle mainBundle] classNamed:[[[_viewControllers objectAtIndex:indexPath.section] objectForKey:kClassesKey] objectAtIndex:indexPath.row]];

Expand All @@ -119,7 +109,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
Class klass = [[NSBundle mainBundle] classNamed:[[[_viewControllers objectAtIndex:indexPath.section] objectForKey:kClassesKey] objectAtIndex:indexPath.row]];
UIViewController *viewController = [[klass alloc] init];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}

@end
15 changes: 0 additions & 15 deletions examples/SSCatalog/Classes/SCSegmentedControlDemoViewController.h

This file was deleted.

0 comments on commit 7d436e6

Please sign in to comment.