This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | |
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (UIInterfaceOrientationIsPortrait(orientation)) { | |
} else if (UIInterfaceOrientationIsLandscape(orientation)) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (UIView *subView in self.uiGOButton.subviews) { | |
if (subView.tag == 10) { | |
[subView removeFromSuperview]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)keyboardWillBeShown:(NSNotification*)aNotification{ | |
CGFloat mainViewScrollUp; | |
NSDictionary* info = [aNotification userInfo]; | |
CGSize keyboardSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; | |
mainViewScrollUp = keyboardSize.height; | |
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, keyboardSize.height, 0.0); | |
self.uiTableView.contentInset = contentInsets; | |
self.uiTableView.scrollIndicatorInsets = contentInsets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)textFieldShouldReturn:(UITextField *)textField | |
{ | |
[textField resignFirstResponder]; | |
return YES; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)keyboardWillBeHidden:(NSNotification*)aNotification{ | |
UIEdgeInsets contentInsets = UIEdgeInsetsZero; | |
[UIView animateWithDuration:0.25f | |
animations:^{ | |
self.uiTableView.contentInset = contentInsets; | |
self.uiTableView.scrollIndicatorInsets = contentInsets; | |
} | |
]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_queue_t secondaryQueue = dispatch_queue_create("com.appname.object", NULL); | |
dispatch_async(secondaryQueue, ^{ | |
// execute code on non-UI thread | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// execute code on UI thread | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="openApp://">Open App</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { | |
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 18)]; | |
UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 3, tableView.frame.size.width, 18)]; | |
[headerLabel setFont:[UIFont boldSystemFontOfSize:12]]; | |
headerLabel.textColor = [UIColor darkGrayColor]; | |
headerLabel.text = @"Share with friends"; | |
[headerView addSubview:headerLabel]; | |
headerView.backgroundColor = [UIColor clearColor]; | |
return headerView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showFakePushNotificationAnimation:(NSNotification *)notification { | |
if (notification) { | |
NSString *message = [NSString stringWithFormat:@"%@", [[[notification object] objectForKey:@"aps"] objectForKey:@"alert"]]; | |
UIToolbar *newmessageBannerView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, -BANNER_HEIGHT, self.view.frame.size.width, BANNER_HEIGHT)]; | |
newmessageBannerView.translucent = YES; | |
newmessageBannerView.barTintColor = [UIColor colorWithWhite:0.074 alpha:0.550]; | |
UILabel *bannerLabel = [[UILabel alloc] initWithFrame:CGRectMake(44.0, 10.0, 320.0, 22.0)]; |
OlderNewer