Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Always use Gotham for interaface items
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Sep 4, 2012
1 parent 4707f08 commit f330c96
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 33 deletions.
6 changes: 6 additions & 0 deletions Cheddar for iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
B26AE9BA15C5D0100008AB1F /* CDISettingsFontPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B26AE9B915C5D0100008AB1F /* CDISettingsFontPickerViewController.m */; };
B26AE9BD15C5D25E0008AB1F /* CDIGroupedTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B26AE9BC15C5D25E0008AB1F /* CDIGroupedTableViewController.m */; };
B26AE9C015C5D52D0008AB1F /* CDIPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B26AE9BF15C5D52D0008AB1F /* CDIPickerViewController.m */; };
B2711F0F15F58398000D6C09 /* CDIHUDView.m in Sources */ = {isa = PBXBuildFile; fileRef = B2711F0E15F58398000D6C09 /* CDIHUDView.m */; };
B28F84DB15C37E1D003E4595 /* SSToolkitResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B208C1E315BF63E30080705D /* SSToolkitResources.bundle */; };
B28FD2BE15BF730100365CD6 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B28FD2BD15BF730100365CD6 /* CFNetwork.framework */; };
B28FD2C015BF731100365CD6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B28FD2BF15BF731000365CD6 /* CoreGraphics.framework */; };
Expand Down Expand Up @@ -442,6 +443,8 @@
B26AE9BC15C5D25E0008AB1F /* CDIGroupedTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDIGroupedTableViewController.m; sourceTree = "<group>"; };
B26AE9BE15C5D52D0008AB1F /* CDIPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDIPickerViewController.h; sourceTree = "<group>"; };
B26AE9BF15C5D52D0008AB1F /* CDIPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDIPickerViewController.m; sourceTree = "<group>"; };
B2711F0D15F58398000D6C09 /* CDIHUDView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDIHUDView.h; sourceTree = "<group>"; };
B2711F0E15F58398000D6C09 /* CDIHUDView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDIHUDView.m; sourceTree = "<group>"; };
B28FD2BD15BF730100365CD6 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
B28FD2BF15BF731000365CD6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
B28FD2C115BF731B00365CD6 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -1008,6 +1011,8 @@
B208BBBF15BF63A80080705D /* CDITableViewCellDeleteConfirmationControl.m */,
B208BBC015BF63A80080705D /* CDITagView.h */,
B208BBC115BF63A80080705D /* CDITagView.m */,
B2711F0D15F58398000D6C09 /* CDIHUDView.h */,
B2711F0E15F58398000D6C09 /* CDIHUDView.m */,
);
name = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -1361,6 +1366,7 @@
B26AE9C015C5D52D0008AB1F /* CDIPickerViewController.m in Sources */,
B2AD656B15E907870073BBC5 /* CDIPlaceholderView.m in Sources */,
B2AD656F15E907C50073BBC5 /* CDIListsPlaceholderView.m in Sources */,
B2711F0F15F58398000D6C09 /* CDIHUDView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
3 changes: 2 additions & 1 deletion Classes/CDICreateListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "CDICreateListViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"

Expand Down Expand Up @@ -101,7 +102,7 @@ - (void)create:(id)sender {
}

// Create list
SSHUDView *hud = [[SSHUDView alloc] initWithTitle:@"Creating..." loading:YES];
CDIHUDView *hud = [[CDIHUDView alloc] initWithTitle:@"Creating..." loading:YES];
[hud show];

CDKList *list = [[CDKList alloc] init];
Expand Down
11 changes: 11 additions & 0 deletions Classes/CDIHUDView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// CDIHUDView.h
// Cheddar for iOS
//
// Created by Sam Soffes on 9/3/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//

@interface CDIHUDView : SSHUDView

@end
21 changes: 21 additions & 0 deletions Classes/CDIHUDView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// CDIHUDView.m
// Cheddar for iOS
//
// Created by Sam Soffes on 9/3/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//

#import "CDIHUDView.h"
#import "UIFont+CheddariOSAdditions.h"

@implementation CDIHUDView

- (id)initWithTitle:(NSString *)aTitle loading:(BOOL)isLoading {
if ((self = [super initWithTitle:aTitle loading:isLoading])) {
self.textLabel.font = [UIFont cheddarInterfaceFontOfSize:15.0f];
}
return self;
}

@end
3 changes: 2 additions & 1 deletion Classes/CDIListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "CDIRenameTaskViewController.h"
#import "CDIWebViewController.h"
#import "CDISettingsTapPickerViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"

Expand Down Expand Up @@ -481,7 +482,7 @@ - (void)addTaskView:(CDIAddTaskView *)addTaskView didReturnWithTitle:(NSString *
[task createWithSuccess:nil failure:^(AFJSONRequestOperation *remoteOperation, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
addTaskView.textField.text = title;
SSHUDView *hud = [[SSHUDView alloc] init];
CDIHUDView *hud = [[CDIHUDView alloc] init];
[hud failQuicklyWithTitle:@"Failed to create task"];
});
}];
Expand Down
3 changes: 2 additions & 1 deletion Classes/CDIListsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "CDIUpgradeViewController.h"
#import "CDIListsPlaceholderView.h"
#import "CDIAddListTableViewCell.h"
#import "CDIHUDView.h"
#import "SMTEDelegateController.h"
#import <SSToolkit/UIScrollView+SSToolkitAdditions.h>

Expand Down Expand Up @@ -289,7 +290,7 @@ - (void)_createList:(id)sender {
return;
}

SSHUDView *hud = [[SSHUDView alloc] initWithTitle:@"Creating..." loading:YES];
CDIHUDView *hud = [[CDIHUDView alloc] initWithTitle:@"Creating..." loading:YES];
[hud show];

CDKList *list = [[CDKList alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion Classes/CDIPullToRefreshContentView.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ @implementation CDIPullToRefreshContentView

- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
self.statusLabel.font = [UIFont cheddarFontOfSize:15.0f];
self.statusLabel.font = [UIFont cheddarInterfaceFontOfSize:15.0f];
self.statusLabel.textColor = [UIColor cheddarTextColor];
self.statusLabel.backgroundColor = [UIColor whiteColor];
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/CDISessionsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (UITextField *)usernameTextField {
_usernameTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
_usernameTextField.delegate = self;
_usernameTextField.returnKeyType = UIReturnKeyNext;
_usernameTextField.font = [UIFont cheddarFontOfSize:18.0f];
_usernameTextField.font = [UIFont cheddarInterfaceFontOfSize:18.0f];
}
return _usernameTextField;
}
Expand All @@ -39,7 +39,7 @@ - (UITextField *)passwordTextField {
_passwordTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
_passwordTextField.delegate = self;
_passwordTextField.returnKeyType = UIReturnKeyGo;
_passwordTextField.font = [UIFont cheddarFontOfSize:18.0f];
_passwordTextField.font = [UIFont cheddarInterfaceFontOfSize:18.0f];
}
return _passwordTextField;
}
Expand Down
3 changes: 2 additions & 1 deletion Classes/CDISettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "CDISettingsViewController.h"
#import "CDIUpgradeViewController.h"
#import "CDISettingsTableViewCell.h"
#import "CDIHUDView.h"
#import "TTTAttributedLabel.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIButton+CheddariOSAdditions.h"
Expand Down Expand Up @@ -177,7 +178,7 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller didFinis
[controller dismissModalViewControllerAnimated:YES];

if (result == MFMailComposeResultSent) {
SSHUDView *hud = [[SSHUDView alloc] init];
CDIHUDView *hud = [[CDIHUDView alloc] init];
[hud completeQuicklyWithTitle:@"Sent!"];
}
}
Expand Down
7 changes: 4 additions & 3 deletions Classes/CDISignInViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "CDISignInViewController.h"
#import "CDISignUpViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"

Expand All @@ -26,15 +27,15 @@ - (void)viewDidLoad {
[footer setTitleColor:[UIColor cheddarBlueColor] forState:UIControlStateNormal];
[footer setTitleColor:[UIColor cheddarTextColor] forState:UIControlStateHighlighted];
[footer addTarget:self action:@selector(forgot:) forControlEvents:UIControlEventTouchUpInside];
footer.titleLabel.font = [UIFont cheddarFontOfSize:16.0f];
footer.titleLabel.font = [UIFont cheddarInterfaceFontOfSize:16.0f];
self.tableView.tableFooterView = footer;
}


#pragma mark - Actions

- (void)signIn:(id)sender {
SSHUDView *hud = [[SSHUDView alloc] initWithTitle:@"Signing in..." loading:YES];
CDIHUDView *hud = [[CDIHUDView alloc] initWithTitle:@"Signing in..." loading:YES];
[hud show];

[[CDKHTTPClient sharedClient] signInWithLogin:self.usernameTextField.text password:self.passwordTextField.text success:^(AFJSONRequestOperation *operation, id responseObject) {
Expand Down Expand Up @@ -70,7 +71,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.textColor = [UIColor cheddarTextColor];
cell.textLabel.font = [UIFont cheddarFontOfSize:18.0f];
cell.textLabel.font = [UIFont cheddarInterfaceFontOfSize:18.0f];
}

if (indexPath.row == 0) {
Expand Down
11 changes: 6 additions & 5 deletions Classes/CDISignUpViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
//

#import "CDISignUpViewController.h"
#import "CDISignInViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"
#import "CDISignInViewController.h"

@interface CDISignUpViewController ()
@property (nonatomic, strong, readonly) UITextField *emailTextField;
Expand All @@ -30,7 +31,7 @@ - (UITextField *)emailTextField {
_emailTextField.delegate = self;
_emailTextField.returnKeyType = UIReturnKeyNext;
_emailTextField.placeholder = @"Your email address";
_emailTextField.font = [UIFont cheddarFontOfSize:18.0f];
_emailTextField.font = [UIFont cheddarInterfaceFontOfSize:18.0f];
}
return _emailTextField;
}
Expand All @@ -49,7 +50,7 @@ - (void)viewDidLoad {
[footer setTitleColor:[UIColor cheddarBlueColor] forState:UIControlStateNormal];
[footer setTitleColor:[UIColor cheddarTextColor] forState:UIControlStateHighlighted];
[footer addTarget:self action:@selector(signIn:) forControlEvents:UIControlEventTouchUpInside];
footer.titleLabel.font = [UIFont cheddarFontOfSize:16.0f];
footer.titleLabel.font = [UIFont cheddarInterfaceFontOfSize:16.0f];
self.tableView.tableFooterView = footer;
}

Expand All @@ -62,7 +63,7 @@ - (void)signIn:(id)sender {


- (void)signUp:(id)sender {
SSHUDView *hud = [[SSHUDView alloc] initWithTitle:@"Signing up..." loading:YES];
CDIHUDView *hud = [[CDIHUDView alloc] initWithTitle:@"Signing up..." loading:YES];
[hud show];

[[CDKHTTPClient sharedClient] signUpWithUsername:self.usernameTextField.text email:self.emailTextField.text password:self.passwordTextField.text success:^(AFJSONRequestOperation *operation, id responseObject) {
Expand Down Expand Up @@ -93,7 +94,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.textColor = [UIColor cheddarTextColor];
cell.textLabel.font = [UIFont cheddarFontOfSize:18.0f];
cell.textLabel.font = [UIFont cheddarInterfaceFontOfSize:18.0f];
}

if (indexPath.row == 0) {
Expand Down
3 changes: 2 additions & 1 deletion Classes/CDIUpgradeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "CDIUpgradeViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"
#import "UIButton+CheddariOSAdditions.h"
Expand Down Expand Up @@ -196,7 +197,7 @@ - (void)_purchaseProductIdentifier:(NSString *)identifier {
}
_purchasing = YES;

SSHUDView *hud = [[SSHUDView alloc] initWithTitle:@"Upgrading..."];
CDIHUDView *hud = [[CDIHUDView alloc] initWithTitle:@"Upgrading..."];
[hud show];

NSDictionary *products = [[CDITransactionObserver defaultObserver] products];
Expand Down
3 changes: 2 additions & 1 deletion Classes/CDIWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "CDIWebViewController.h"
#import "CDIHUDView.h"
#import "UIColor+CheddariOSAdditions.h"

@interface CDIWebViewController ()
Expand Down Expand Up @@ -208,7 +209,7 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller didFinis
[controller dismissModalViewControllerAnimated:YES];

if (result == MFMailComposeResultSent) {
SSHUDView *hud = [[SSHUDView alloc] init];
CDIHUDView *hud = [[CDIHUDView alloc] init];
[hud completeQuicklyWithTitle:@"Sent!"];
}
}
Expand Down
18 changes: 2 additions & 16 deletions Classes/UIFont+CheddariOSAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,12 @@ + (UIFont *)boldItalicCheddarFontOfSize:(CGFloat)fontSize {
#pragma mark - Interface

+ (UIFont *)cheddarInterfaceFontOfSize:(CGFloat)fontSize {
NSString *fontName = nil;
NSString *key = [CDISettingsFontPickerViewController selectedKey];
if ([key isEqualToString:kCDIFontHoeflerKey]) {
fontName = kCDIRegularFontName;
} else {
fontName = [self cheddarFontNameForFontKey:key style:kCDIFontRegularKey];
}
return [self fontWithName:fontName size:fontSize];
return [self fontWithName:kCDIRegularFontName size:fontSize];
}


+ (UIFont *)boldCheddarInterfaceFontOfSize:(CGFloat)fontSize {
NSString *fontName = nil;
NSString *key = [CDISettingsFontPickerViewController selectedKey];
if ([key isEqualToString:kCDIFontHoeflerKey]) {
fontName = kCDIBoldFontName;
} else {
fontName = [self cheddarFontNameForFontKey:key style:kCDIFontBoldKey];
}
return [self fontWithName:fontName size:fontSize];
return [self fontWithName:kCDIBoldFontName size:fontSize];
}

@end

0 comments on commit f330c96

Please sign in to comment.