Commit ee704471 authored by Eloy Duran's avatar Eloy Duran

Import the SSToolkit example. Last thing to do is add a way to copy resources.

parent 18f6fe20
//
// SCAddressBarDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 2/8/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
@interface SCAddressBarDemoViewController : UIViewController <UITextFieldDelegate, SSWebViewDelegate>
+ (NSString *)title;
@end
//
// SCAddressBarDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 2/8/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
#import "SCAddressBarDemoViewController.h"
@implementation SCAddressBarDemoViewController {
SSGradientView *_headerView;
UILabel *_titleLabel;
SSAddressBarTextField *_addressBar;
SSWebView *_webView;
}
#pragma mark - Class Methods
+ (NSString *)title {
return @"Address bar";
}
#pragma mark - NSObject
- (void)dealloc {
_webView.delegate = nil;
[_webView release];
[_headerView release];
[_titleLabel release];
[_addressBar 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];
CGSize size = self.view.frame.size;
_headerView = [[SSGradientView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, size.width, 58.0f)];
_headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_headerView.topColor = [UIColor colorWithWhite:0.957f alpha:1.0f];
_headerView.bottomColor = [UIColor colorWithWhite:0.827f alpha:1.0f];
_headerView.bottomBorderColor = [UIColor colorWithWhite:0.369f alpha:1.0f];
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 0.0f, size.width - 20.0f, 21.0f)];
_titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_titleLabel.backgroundColor = [UIColor clearColor];
_titleLabel.textColor = [UIColor colorWithWhite:0.404f alpha:1.0f];
_titleLabel.textAlignment = UITextAlignmentCenter;
_titleLabel.font = [UIFont boldSystemFontOfSize:12.0f];
_titleLabel.shadowColor = [UIColor whiteColor];
_titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[_headerView addSubview:_titleLabel];
_addressBar = [[SSAddressBarTextField alloc] initWithFrame:CGRectMake(10.0f, 21.0f, size.width - 20.0f, 31.0f)];
_addressBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_addressBar.delegate = self;
[_headerView addSubview:_addressBar];
[self.view addSubview:_headerView];
_webView = [[SSWebView alloc] initWithFrame:CGRectMake(0.0f, 58.0f, size.width, size.height - 58.0f)];
_webView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_webView.scalesPageToFit = YES;
_webView.delegate = self;
[self.view addSubview:_webView];
[_addressBar.reloadButton addTarget:_webView action:@selector(reload) forControlEvents:UIControlEventTouchUpInside];
[_addressBar.stopButton addTarget:_webView action:@selector(stopLoading) forControlEvents:UIControlEventTouchUpInside];
[_webView loadURLString:@"http://samsoff.es"];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - UITextFieldDelegate
- (void)textFieldDidBeginEditing:(UITextField *)textField {
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(_removeGrayView) object:nil];
// Gray Button
// UIButton *aGrayButton = [UIButton buttonWithType:UIButtonTypeCustom];
// aGrayButton.frame = _webView.frame;
// aGrayButton.backgroundColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.5f];
// aGrayButton.alpha = 0.0f;
// aGrayButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
// [aGrayButton addTarget:textField action:@selector(resignFirstResponder) forControlEvents:UIControlEventTouchDown];
// self.grayButton = aGrayButton;
// [self.view addSubview:grayButton];
// [grayButton fadeIn];
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
// [self performSelector:@selector(_removeGrayView) withObject:nil afterDelay:0.1];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[_webView loadURLString:textField.text];
[textField resignFirstResponder];
return YES;
}
#pragma mark - SSWebViewDelegate
- (void)webViewDidStartLoadingPage:(SSWebView *)aWebView {
_addressBar.loading = YES;
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
NSString *urlString = [[[_webView lastRequest] mainDocumentURL] absoluteString];
static NSRegularExpression *regularExpression = nil;
if (!regularExpression) {
regularExpression = [[NSRegularExpression alloc] initWithPattern:@"^https?://" options:NSRegularExpressionCaseInsensitive error:nil];
}
NSString *addressBarUrlString = [regularExpression stringByReplacingMatchesInString:urlString options:0 range:NSMakeRange(0, [urlString length]) withTemplate:@""];
_addressBar.text = addressBarUrlString;
_titleLabel.text = urlString;
}
- (void)webViewDidFinishLoadingPage:(SSWebView *)aWebView {
_addressBar.loading = NO;
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
NSString *title = [_webView stringByEvaluatingJavaScriptFromString:@"document.title"];
if (title) {
_titleLabel.text = title;
}
}
- (void)webView:(SSWebView *)aWebView didFailLoadWithError:(NSError *)error {
_addressBar.loading = NO;
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}
@end
//
// SCAppDelegate.h
// SSCatalog
//
// Created by Sam Soffes on 9/21/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCAppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) UINavigationController *navigationController;
@end
//
// SCAppDelegate.m
// SSCatalog
//
// Created by Sam Soffes on 9/21/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCAppDelegate.h"
#import "SCRootViewController.h"
@implementation SCAppDelegate {
UIWindow *_window;
UINavigationController *_navigationController;
}
#pragma mark - Accessors
@synthesize window = _window;
@synthesize navigationController = _navigationController;
#pragma mark - NSObject
- (void)dealloc {
[_navigationController release];
[_window release];
[super dealloc];
}
#pragma mark - UIApplicationDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SCRootViewController *viewController = [[SCRootViewController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
self.navigationController = aNavigationController;
[viewController release];
[aNavigationController release];
[_window addSubview:_navigationController.view];
[_window makeKeyAndVisible];
}
@end
//
// SCBadgeTableViewCellDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 01/29/11.
// Copyright 2011 Sam Soffes, Inc. All rights reserved.
//
@interface SCBadgeTableViewCellDemoViewController : UITableViewController
+ (NSString *)title;
@end
//
// SCBadgeTableViewCellDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 01/29/11.
// Copyright 2011 Sam Soffes, Inc. All rights reserved.
//
#import "SCBadgeTableViewCellDemoViewController.h"
@implementation SCBadgeTableViewCellDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Badge Table View Cell";
}
#pragma mark - NSObject
- (id)init {
return self = [super initWithStyle:UITableViewStyleGrouped];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView reloadData];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return (section == 0) ? 4 : 12;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"cell";
SSBadgeTableViewCell *cell = (SSBadgeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[SSBadgeTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier] autorelease];
}
if (indexPath.section == 0) {
switch (indexPath.row) {
case 0: {
cell.textLabel.text = @"Default Badge View";
cell.badgeView.textLabel.text = @"0";
cell.badgeView.badgeColor = [SSBadgeView defaultBadgeColor];
break;
}
case 1: {
cell.textLabel.text = @"Unread Count";
cell.badgeView.textLabel.text = @"3";
cell.badgeView.badgeColor = [UIColor colorWithRed:0.969f green:0.082f blue:0.078f alpha:1.0f];
break;
}
case 2: {
cell.textLabel.text = @"Text Badge";
cell.badgeView.textLabel.text = @"New";
cell.badgeView.badgeColor = [UIColor colorWithRed:0.388f green:0.686f blue:0.239f alpha:1.0f];
break;
}
case 3: {
cell.textLabel.text = @"Nil value";
cell.badgeView.textLabel.text = nil;
cell.badgeView.badgeColor = [SSBadgeView defaultBadgeColor];
break;
}
}
} else {
NSNumber *number = [NSNumber numberWithInteger:indexPath.row * 256];
cell.textLabel.text = [[NSNumberFormatter localizedStringFromNumber:number numberStyle:NSNumberFormatterSpellOutStyle] capitalizedString];
cell.badgeView.textLabel.text = [NSNumberFormatter localizedStringFromNumber:number numberStyle:NSNumberFormatterDecimalStyle];
cell.badgeView.badgeColor = [SSBadgeView defaultBadgeColor];
}
return cell;
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
@end
//
// SCCollectionViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 8/24/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
@interface SCCollectionViewDemoViewController : SSCollectionViewController
+ (NSString *)title;
@end
//
// SCCollectionViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 8/24/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
#import "SCCollectionViewDemoViewController.h"
#import "SCImageCollectionViewItem.h"
@implementation SCCollectionViewDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Collection View";
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
self.collectionView.extremitiesStyle = SSCollectionViewExtremitiesStyleScrolling;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - SSCollectionViewDataSource
- (NSUInteger)numberOfSectionsInCollectionView:(SSCollectionView *)aCollectionView {
return 10;
}
- (NSUInteger)collectionView:(SSCollectionView *)aCollectionView numberOfItemsInSection:(NSUInteger)section {
return 50;
}
- (SSCollectionViewItem *)collectionView:(SSCollectionView *)aCollectionView itemForIndexPath:(NSIndexPath *)indexPath {
static NSString *const itemIdentifier = @"itemIdentifier";
SCImageCollectionViewItem *item = (SCImageCollectionViewItem *)[aCollectionView dequeueReusableItemWithIdentifier:itemIdentifier];
if (item == nil) {
item = [[[SCImageCollectionViewItem alloc] initWithReuseIdentifier:itemIdentifier] autorelease];
}
CGFloat size = 80.0f * [[UIScreen mainScreen] scale];
NSInteger i = (50 * indexPath.section) + indexPath.row;
item.imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.gravatar.com/avatar/%i?s=%0.f&d=identicon", i, size]];
return item;
}
- (UIView *)collectionView:(SSCollectionView *)aCollectionView viewForHeaderInSection:(NSUInteger)section {
SSLabel *header = [[SSLabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 40.0f)];
header.autoresizingMask = UIViewAutoresizingFlexibleWidth;
header.text = [NSString stringWithFormat:@"Section %i", section + 1];
header.textEdgeInsets = UIEdgeInsetsMake(0.0f, 19.0f, 0.0f, 19.0f);
header.shadowColor = [UIColor whiteColor];
header.shadowOffset = CGSizeMake(0.0f, 1.0f);
header.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.8f];
return [header autorelease];
}
#pragma mark - SSCollectionViewDelegate
- (CGSize)collectionView:(SSCollectionView *)aCollectionView itemSizeForSection:(NSUInteger)section {
return CGSizeMake(80.0f, 80.0f);
}
- (void)collectionView:(SSCollectionView *)aCollectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *title = [NSString stringWithFormat:@"You selected item %i in section %i!",
indexPath.row + 1, indexPath.section + 1];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:nil delegate:nil
cancelButtonTitle:@"Oh, awesome!" otherButtonTitles:nil];
[alert show];
[alert release];
}
- (CGFloat)collectionView:(SSCollectionView *)aCollectionView heightForHeaderInSection:(NSUInteger)section {
return 40.0f;
}
@end
//
// SCGradientViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 10/27/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCGradientViewDemoViewController : UIViewController
+ (NSString *)title;
- (void)changeColor:(id)sender;
- (void)updateScale:(id)sender;
@end
//
// SCGradientViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 10/27/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCGradientViewDemoViewController.h"
@implementation SCGradientViewDemoViewController {
BOOL _blue;
SSGradientView *_gradientView;
}
#pragma mark - Class Methods
+ (NSString *)title {
return @"Gradient View";
}
#pragma mark - NSObject
- (void)dealloc {
[_gradientView release];
[super dealloc];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
self.view.backgroundColor = [UIColor whiteColor];
// Gradient view
_gradientView = [[SSGradientView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 280.0f, 280.0f)];
_gradientView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_gradientView.topBorderColor = [UIColor colorWithRed:0.558f green:0.599f blue:0.643f alpha:1.0f];
_gradientView.topInsetColor = [UIColor colorWithWhite:1.0f alpha:0.3f];
_gradientView.colors = [NSArray arrayWithObjects:
[UIColor colorWithRed:0.676f green:0.722f blue:0.765f alpha:1.0f],
[UIColor colorWithRed:0.514f green:0.568f blue:0.617f alpha:1.0f],
nil];
_gradientView.bottomBorderColor = [UIColor colorWithRed:0.428f green:0.479f blue:0.520f alpha:1.0f];
[self.view addSubview:_gradientView];
// Change color button
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(20.0f, 320.0f, 280.0f, 37.0f);
[button setTitle:@"Change Color" forState:UIControlStateNormal];
[button addTarget:self action:@selector(changeColor:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
// Scale slider
UISlider *scaleSlider = [[UISlider alloc] initWithFrame:CGRectMake(20.0f, 377.0f, 280.0f, 20.0f)];
scaleSlider.value = 1.0f;
scaleSlider.minimumValue = 0.0f;
scaleSlider.maximumValue = 1.0f;
[scaleSlider addTarget:self action:@selector(updateScale:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:scaleSlider];
[scaleSlider release];
_blue = YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - Actions
- (void)changeColor:(id)sender {
if (_blue) {
_gradientView.colors = [NSArray arrayWithObjects:
[UIColor redColor],
[UIColor orangeColor],
nil];
} else {
_gradientView.colors = [NSArray arrayWithObjects:
[UIColor colorWithRed:0.676f green:0.722f blue:0.765f alpha:1.0f],
[UIColor colorWithRed:0.514f green:0.568f blue:0.617f alpha:1.0f],
nil];
}
_blue = !_blue;
}
- (void)updateScale:(id)sender {
_gradientView.gradientScale = [(UISlider *)sender value];
}
@end
//
// SCHUDViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 11/18/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCHUDViewDemoViewController : UIViewController
+ (NSString *)title;
- (void)complete:(id)sender;
- (void)pop:(id)sender;
@end
//
// SCHUDViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 11/18/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCHUDViewDemoViewController.h"
@implementation SCHUDViewDemoViewController {
SSHUDView *_hud;
}
#pragma mark - Class Methods
+ (NSString *)title {
return @"HUD View";
}
#pragma mark - NSObject
- (void)dealloc {
[_hud release];
[super dealloc];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
self.view.backgroundColor = [UIColor whiteColor];
// Show HUD
_hud = [[SSHUDView alloc] initWithTitle:@"Loading..."];
// _hud.hudSize = CGSizeMake(60.0f, 60.0f);
// _hud.textLabelHidden = YES;
// _hud.hidesVignette = YES;
[_hud show];
// After 2 seconds, complete action
[self performSelector:@selector(complete:) withObject:nil afterDelay:2.0];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - Actions
- (void)complete:(id)sender {
[_hud completeWithTitle:@"Finished"];
[self performSelector:@selector(pop:) withObject:nil afterDelay:0.7];
}
- (void)pop:(id)sender {
[_hud dismiss];
[self.navigationController popViewControllerAnimated:YES];
}
@end
//
// SCImageCollectionViewItem.h
// SSCatalog
//
// Created by Sam Soffes on 5/3/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
@interface SCImageCollectionViewItem : SSCollectionViewItem
@property (nonatomic, retain) NSURL *imageURL;
- (id)initWithReuseIdentifier:(NSString *)aReuseIdentifier;
@end
//
// SCImageCollectionViewItem.m
// SSCatalog
//
// Created by Sam Soffes on 5/3/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
#import "SCImageCollectionViewItem.h"
#import "UIImageView+AFNetworking.h"
@implementation SCImageCollectionViewItem
#pragma mark - Accessors
@synthesize imageURL = _imageURL;
- (void)setImageURL:(NSURL *)url {
[url retain];
[_imageURL release];
_imageURL = url;
if (_imageURL) {
[self.imageView setImageWithURL:url placeholderImage:nil];
} else {
self.imageView.image = nil;
}
}
#pragma mark - NSObject
- (void)dealloc {
[_imageURL release];
[super dealloc];
}
#pragma mark - Initializer
- (id)initWithReuseIdentifier:(NSString *)aReuseIdentifier {
if ((self = [super initWithStyle:SSCollectionViewItemStyleImage reuseIdentifier:aReuseIdentifier])) {
self.imageView.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.0f];
}
return self;
}
- (void)prepareForReuse {
[super prepareForReuse];
self.imageURL = nil;
}
@end
//
// SCLineViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 4/19/10.
// Copyright 2010 Sam Soffes, Inc. All rights reserved.
//
@interface SCLineViewDemoViewController : UIViewController
+ (NSString *)title;
@end
//
// SCLineViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 4/19/10.
// Copyright 2010 Sam Soffes, Inc. All rights reserved.
//
#import "SCLineViewDemoViewController.h"
@implementation SCLineViewDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Line View";
}
#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];
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];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
@end
//
// SCLoadingViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 11/15/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
@interface SCLoadingViewDemoViewController : UIViewController
+ (NSString *)title;
@end
//
// SCLoadingViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 11/15/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
#import "SCLoadingViewDemoViewController.h"
@implementation SCLoadingViewDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Loading View";
}
#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];
CGSize size = self.view.frame.size;
SSLoadingView *loadingView = [[SSLoadingView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, size.width, size.height)];
[self.view addSubview:loadingView];
[loadingView release];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
@end
//
// SCPickerDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCPickerDemoViewController : UITableViewController
@property (nonatomic, retain) NSString *selectedAbbreviation;
+ (NSString *)title;
@end
//
// SCPickerDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCPickerDemoViewController.h"
#import "SCPickerDetailViewController.h"
@implementation SCPickerDemoViewController
#pragma mark - Accessors
@synthesize selectedAbbreviation = _selectedAbbreviation;
#pragma mark - Class Methods
+ (NSString *)title {
return @"Settings Picker";
}
#pragma mark - NSObject
- (id)init {
return self = [super initWithStyle:UITableViewStyleGrouped];
}
- (void)dealloc {
[_selectedAbbreviation release];
[super dealloc];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
self.selectedAbbreviation = [[NSTimeZone defaultTimeZone] abbreviation];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView reloadData];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier] autorelease];
}
cell.textLabel.text = @"Picker Value";
cell.detailTextLabel.text = [[NSTimeZone timeZoneWithAbbreviation:self.selectedAbbreviation] name];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SCPickerDetailViewController *viewController = [[SCPickerDetailViewController alloc] initWithStyle:UITableViewStyleGrouped];
viewController.selectedKey = self.selectedAbbreviation;
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
@end
//
// SCPickerDetailViewController.h
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCPickerDetailViewController : SSPickerViewController
@end
//
// SCPickerDetailViewController.m
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCPickerDetailViewController.h"
#import "SCPickerDemoViewController.h"
@implementation SCPickerDetailViewController
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Choose";
}
#pragma mark - SSPickerViewController
- (void)loadKeys {
self.keys = [[NSTimeZone abbreviationDictionary] allKeys];
}
- (NSString *)cellTextForKey:(NSString *)key {
return [[NSTimeZone timeZoneWithAbbreviation:key] name];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
// Notify the parent view controller of the change
SCPickerDemoViewController *viewController = (SCPickerDemoViewController *)[self.navigationController.viewControllers objectAtIndex:([self.navigationController.viewControllers count] - 2)];
viewController.selectedAbbreviation = [self.keys objectAtIndex:indexPath.row];
[self.navigationController popViewControllerAnimated:YES];
}
@end
//
// SCPieProgressViewDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 4/22/10.
// Copyright 2010 Sam Soffes, Inc. All rights reserved.
//
@interface SCPieProgressViewDemoViewController : UIViewController
+ (NSString *)title;
- (void)incrementProgress:(NSTimer *)timer;
@end
//
// SCPieProgressViewDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 4/22/10.
// Copyright 2010 Sam Soffes, Inc. All rights reserved.
//
#import "SCPieProgressViewDemoViewController.h"
@implementation SCPieProgressViewDemoViewController {
SSPieProgressView *_progressView7;
NSTimer *_timer;
}
#pragma mark - Class Methods
+ (NSString *)title {
return @"Pie Progress View";
}
#pragma mark - NSObject
- (void)dealloc {
[_progressView7 release];
[_timer invalidate];
[_timer 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];
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];
}
- (void)viewDidUnload {
[super viewDidUnload];
[_timer invalidate];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - Timer
- (void)incrementProgress:(NSTimer *)timer {
_progressView7.progress = _progressView7.progress + 0.01;
if (_progressView7.progress == 1.0f) {
_progressView7.progress = 0.0;
}
}
@end
//
// SCRootViewController.h
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
@interface SCRootViewController : UITableViewController
@end
//
// SCRootViewController.m
// SSCatalog
//
// Created by Sam Soffes on 10/9/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCRootViewController.h"
#import "SCPickerDemoViewController.h"
#import "SCGradientViewDemoViewController.h"
static NSString *const kTitleKey = @"title";
static NSString *const kClassesKey = @"classes";
@interface UIViewController (SCRootViewControllerAdditions)
+ (id)setup;
@end
@implementation SCRootViewController {
NSArray *_viewControllers;
}
#pragma mark - NSObject
- (void)dealloc {
[_viewControllers release];
[super dealloc];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"SSCatalog";
_viewControllers = [[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:
@"SCBadgeTableViewCellDemoViewController",
@"SCCollectionViewDemoViewController",
@"SCGradientViewDemoViewController",
@"SCHUDViewDemoViewController",
@"SCLineViewDemoViewController",
@"SCLoadingViewDemoViewController",
@"SCPieProgressViewDemoViewController",
nil], kClassesKey,
@"Views", kTitleKey,
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:
@"SCAddressBarDemoViewController",
@"SCSegmentedControlDemoViewController",
@"SCSwitchDemoViewController",
nil], kClassesKey,
@"Controls", kTitleKey,
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:
@"SCPickerDemoViewController",
@"SSRatingDemoViewController",
nil], kClassesKey,
@"View Controllers", kTitleKey,
nil],
nil];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [_viewControllers count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [[[_viewControllers objectAtIndex:section] objectForKey:kClassesKey] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; }
Class klass = [[NSBundle mainBundle] classNamed:[[[_viewControllers objectAtIndex:indexPath.section] objectForKey:kClassesKey] objectAtIndex:indexPath.row]];
cell.textLabel.text = [klass title];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return [[_viewControllers objectAtIndex:section] objectForKey:kTitleKey];
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
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
//
// SCSegmentedControlDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 2/14/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
@interface SCSegmentedControlDemoViewController : UIViewController
+ (NSString *)title;
- (void)valueChanged:(id)sender;
@end
//
// SCSegmentedControlDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 2/14/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
#import "SCSegmentedControlDemoViewController.h"
@implementation SCSegmentedControlDemoViewController {
UISegmentedControl *_systemSegmentedControl;
SSSegmentedControl *_customSegmentedControl;
}
#pragma mark - Class Methods
+ (NSString *)title {
return @"Segmented Control";
}
#pragma mark - NSObject
- (void)dealloc {
[_systemSegmentedControl release];
[_customSegmentedControl 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];
UIFont *labelFont = [UIFont boldSystemFontOfSize:15.0f];
NSArray *items = [NSArray arrayWithObjects:@"Apples", @"Oranges", [UIImage imageNamed:@"SamLogo.png"], nil];
// System segmented control
UILabel *systemLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 280.0f, 20.0f)];
systemLabel.text = @"UISegmentedControl";
systemLabel.font = labelFont;
systemLabel.backgroundColor = self.view.backgroundColor;
systemLabel.shadowColor = [UIColor whiteColor];
systemLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[self.view addSubview:systemLabel];
[systemLabel release];
_systemSegmentedControl = [[UISegmentedControl alloc] initWithItems:items];
_systemSegmentedControl.frame = CGRectMake(20.0f, 50.0f, 280.0f, 32.0f);
_systemSegmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
_systemSegmentedControl.selectedSegmentIndex = 0;
[_systemSegmentedControl setEnabled:NO forSegmentAtIndex:1];
[_systemSegmentedControl addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_systemSegmentedControl];
// Custom segmented control
UILabel *customLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 107.0f, 280.0f, 20.0f)];
customLabel.text = @"SSSegmentedControl";
customLabel.font = labelFont;
customLabel.backgroundColor = self.view.backgroundColor;
customLabel.shadowColor = [UIColor whiteColor];
customLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[self.view addSubview:customLabel];
[customLabel release];
_customSegmentedControl = [[SSSegmentedControl alloc] initWithItems:items];
_customSegmentedControl.frame = CGRectMake(20.0f, 137.0f, 280.0f, 32.0f);
_customSegmentedControl.selectedSegmentIndex = 0;
[_customSegmentedControl setEnabled:NO forSegmentAtIndex:1];
[_customSegmentedControl addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_customSegmentedControl];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
#pragma mark - Actions
- (void)valueChanged:(id)sender {
NSLog(@"Value changed to %i", [sender selectedSegmentIndex]);
if (sender == _systemSegmentedControl) {
_customSegmentedControl.selectedSegmentIndex = _systemSegmentedControl.selectedSegmentIndex;
} else {
_systemSegmentedControl.selectedSegmentIndex = _customSegmentedControl.selectedSegmentIndex;
}
}
@end
//
// SCSwitchDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 11/19/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
@interface SCSwitchDemoViewController : UIViewController
+ (NSString *)title;
@end
//
// SCSwitchDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 11/19/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
#import "SCSwitchDemoViewController.h"
@implementation SCSwitchDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Switch";
}
#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];
UIFont *labelFont = [UIFont boldSystemFontOfSize:15.0f];
// System switch
UILabel *systemLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 280.0f, 20.0f)];
systemLabel.text = @"Standard UISwitch";
systemLabel.font = labelFont;
systemLabel.backgroundColor = self.view.backgroundColor;
systemLabel.shadowColor = [UIColor whiteColor];
systemLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[self.view addSubview:systemLabel];
[systemLabel release];
UISwitch *systemOffSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(20.0f, 50.0f, 94.0f, 27.0f)];
[self.view addSubview:systemOffSwitch];
[systemOffSwitch release];
UISwitch *systemOnSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(134.0f, 50.0f, 94.0f, 27.0f)];
systemOnSwitch.on = YES;
[self.view addSubview:systemOnSwitch];
[systemOnSwitch release];
// Default style
UILabel *defaultLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 107.0f, 280.0f, 20.0f)];
defaultLabel.text = @"SSSwitchStyleDefault";
defaultLabel.font = labelFont;
defaultLabel.backgroundColor = self.view.backgroundColor;
defaultLabel.shadowColor = [UIColor whiteColor];
defaultLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[self.view addSubview:defaultLabel];
[defaultLabel release];
SSSwitch *defaultOffSwitch = [[SSSwitch alloc] initWithFrame:CGRectMake(20.0f, 137.0f, 94.0f, 27.0f)];
[self.view addSubview:defaultOffSwitch];
[defaultOffSwitch release];
SSSwitch *defaultOnSwitch = [[SSSwitch alloc] initWithFrame:CGRectMake(134.0f, 137.0f, 94.0f, 27.0f)];
defaultOnSwitch.on = YES;
[self.view addSubview:defaultOnSwitch];
[defaultOnSwitch release];
// Airplane mode style
UILabel *airplaneLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0f, 194.0f, 280.0f, 20.0f)];
airplaneLabel.text = @"SSSwitchStyleAirplane";
airplaneLabel.font = labelFont;
airplaneLabel.backgroundColor = self.view.backgroundColor;
airplaneLabel.shadowColor = [UIColor whiteColor];
airplaneLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
[self.view addSubview:airplaneLabel];
[airplaneLabel release];
SSSwitch *airplaneOffSwitch = [[SSSwitch alloc] initWithFrame:CGRectMake(20.0f, 224.0f, 94.0f, 27.0f)];
airplaneOffSwitch.style = SSSwitchStyleAirplane;
[self.view addSubview:airplaneOffSwitch];
[airplaneOffSwitch release];
SSSwitch *airplaneOnSwitch = [[SSSwitch alloc] initWithFrame:CGRectMake(134.0f, 224.0f, 94.0f, 27.0f)];
airplaneOnSwitch.style = SSSwitchStyleAirplane;
airplaneOnSwitch.on = YES;
[self.view addSubview:airplaneOnSwitch];
[airplaneOnSwitch release];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
return YES;
}
@end
//
// SSRatingDemoViewController.h
// SSCatalog
//
// Created by Sam Soffes on 2/3/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
@interface SSRatingDemoViewController : SSRatingPickerViewController
+ (NSString *)title;
@end
//
// SSRatingDemoViewController.m
// SSCatalog
//
// Created by Sam Soffes on 2/3/11.
// Copyright 2011 Sam Soffes. All rights reserved.
//
#import "SSRatingDemoViewController.h"
@implementation SSRatingDemoViewController
#pragma mark - Class Methods
+ (NSString *)title {
return @"Rating Picker";
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = [[self class] title];
}
@end
//
// SSCatalog_Prefix.pch
// SSCatalog
//
// Created by Sam Soffes on 9/21/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
// Prefix header for all source files of the 'SSCatalog' target in the 'SSCatalog' project
//
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <SSToolkit/SSToolkit.h>
#endif
//
// main.m
// SSCatalog
//
// Created by Sam Soffes on 9/21/09.
// Copyright 2009 Sam Soffes, Inc. All rights reserved.
//
#import "SCAppDelegate.h"
int main(int argc, char *argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([SCAppDelegate class]));
}
}
Pod::File.new do |f|
f.platform = :ios
f.dependency 'SSToolkit'
f.dependency 'AFNetworking'
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleDocumentTypes</key>
<array/>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon-29.png</string>
<string>Icon-48.png</string>
<string>Icon-72.png</string>
<string>Icon-114.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.samsoffes.sscatalog</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array/>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchImageFile~iphone</key>
<string>Default.png</string>
<key>UIPrerenderedIcon</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array/>
<key>UTImportedTypeDeclarations</key>
<array/>
</dict>
</plist>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
<FileRef
location = "group:SSCatalog.xcodeproj">
</FileRef>
</Workspace>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment