Removing literals and self within block.

declaring constants instead of string literals
avoiding using self within block
removed unused method decleration from header file

Reviewed-by: @FredericJacobs
This commit is contained in:
Mert Buran 2015-07-10 16:00:14 +03:00 committed by Frederic Jacobs
parent 485748068f
commit 040e4c750b
3 changed files with 11 additions and 17 deletions

View file

@ -25,6 +25,11 @@
#include "TargetConditionals.h"
#endif
static NSString * const kStoryboardName = @"Storyboard";
static NSString * const kInitialViewControllerIdentifier = @"UserInitialViewController";
static NSString * const kURLSchemeSGNLKey = @"sgnl";
static NSString * const kURLHostVerifyPrefix = @"verify";
@interface AppDelegate ()
@property (nonatomic, retain) UIWindow *blankWindow;
@ -68,8 +73,8 @@
[DebugLogger.sharedInstance enableFileLogging];
}
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"UserInitialViewController"];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:kStoryboardName bundle:[NSBundle mainBundle]];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:kInitialViewControllerIdentifier];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = viewController;
@ -122,8 +127,8 @@
}
-(BOOL) application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
if ([url.scheme isEqualToString:@"sgnl"]) {
if ([url.host hasPrefix:@"verify"] && ![TSAccountManager isRegistered]) {
if ([url.scheme isEqualToString:kURLSchemeSGNLKey]) {
if ([url.host hasPrefix:kURLHostVerifyPrefix] && ![TSAccountManager isRegistered]) {
id signupController = [Environment getCurrent].signUpFlowNavigationController;
if ([signupController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navController = (UINavigationController*)signupController;

View file

@ -24,7 +24,4 @@
@property (nonatomic, retain) CallState* latestCall;
-(IBAction)selectedInbox:(id)sender;
-(IBAction)selectedArchive:(id)sender;
@end

View file

@ -108,15 +108,6 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow";
[self updateInboxCountLabel];
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
-(void)tableViewSetUp
{
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
@ -215,8 +206,9 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow";
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
TSThread *thread = [self threadForIndexPath:indexPath];
BOOL viewingThreadsIn = self.viewingThreadsIn;
[self.editingDbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
self.viewingThreadsIn == kInboxState ? [thread archiveThreadWithTransaction:transaction] : [thread unarchiveThreadWithTransaction:transaction];
viewingThreadsIn == kInboxState ? [thread archiveThreadWithTransaction:transaction] : [thread unarchiveThreadWithTransaction:transaction];
}];
[self checkIfEmptyView];