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
iOS 3.2 and later support this. Straight from the What's New in iPhone OS 3.2 doc: | |
Custom Font Support | |
Applications that want to use custom fonts can now include those fonts in their application bundle and register those fonts with the system by including the UIAppFonts key in their Info.plist file. The value of this key is an array of strings identifying the font files in the application’s bundle. When the system sees the key, it loads the specified fonts and makes them available to the application. | |
Once the fonts have been set in the Info.plist, you can use your custom fonts as any other font in IB or programatically. | |
There is an ongoing thread on Apple Developer Forums: | |
https://devforums.apple.com/thread/37824 (login required) |
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
<?php | |
// functions.php | |
function clippingContentInsertion() { | |
for ($x = 0; $x < 100; $x++): | |
$data = array( | |
'post_status' => 'publish', | |
'post_type' => 'clipping', | |
'post_author' => 1, |
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
+ (UIImage*)greenBubble | |
{ | |
if (sGreenBubble == nil) { | |
UIImage *i = [UIImage imageNamed:@"Balloon_1.png"]; | |
sGreenBubble = [[i stretchableImageWithLeftCapWidth:15 topCapHeight:13] retain]; | |
} | |
return sGreenBubble; | |
} | |
+ (UIImage*)grayBubble |
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)viewDidAppear:(BOOL)animated{ | |
[super viewDidAppear:YES]; | |
if ([[[UIDevice currentDevice] systemVersion] floatValue] > 4.9) { | |
UIImage *navBarImage = [UIImage imageNamed:@"imgnavbar.png"]; | |
[[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; | |
UIImage *barButton = [[UIImage imageNamed:@"navbar-icon.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 4, 0, 4)]; | |
[[UIBarButtonItem appearance] setBackgroundImage:barButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; | |
UIImage *backButton = [[UIImage imageNamed:@"back-button.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 14, -1, 4)]; | |
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; | |
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 (id subView in [webView subviews]) { | |
if ([subView respondsToSelector:@selector(flashScrollIndicators)]) { | |
[subView flashScrollIndicators]; | |
} | |
} |
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 ([[webView subviews] count] > 0) { | |
// hide the shadows | |
for (UIView* shadowView in [[[webView subviews] objectAtIndex:0] subviews]) { | |
[shadowView setHidden:YES]; | |
} | |
// show the content | |
[[[[[webView subviews] objectAtIndex:0] subviews] lastObject] setHidden:NO]; | |
} | |
webView.backgroundColor = [UIColor whiteColor]; |
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)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
// check indexPath... | |
myWebView = [[MyWebViewController alloc] init]; | |
myWebView.delegate = self; | |
[myWebView preLoadView]; | |
} | |
- (void)webViewDidFinishLoad:(UIWebView *)webView { | |
[self.navigationController pushViewController:myWebView animated:YES]; | |
[myWebView release]; |
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
Class TweetViewController = NSClassFromString(@"TWTweetComposeViewController"); | |
if (TweetViewController != nil) | |
{ | |
... | |
} | |
else | |
{ | |
... | |
} |
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
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
if ([paths count] > 0) | |
{ | |
NSLog(@"Path: %@", [paths objectAtIndex:0]); | |
NSError *error = nil; | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
// Remove all files in the documents directory | |
BOOL deleted = [fileManager removeItemAtPath:[paths objectAtIndex:0] error:&error]; |
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
+ (UIColor* ) colorWithHex:(int)color { | |
float red = (color & 0xff000000) >> 24; | |
float green = (color & 0x00ff0000) >> 16; | |
float blue = (color & 0x0000ff00) >> 8; | |
float alpha = (color & 0x000000ff); | |
return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:alpha/255.0]; | |
} |