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
From 10d435690793854734c1e343491d3525ecb86745 Mon Sep 17 00:00:00 2001 | |
From: Jeff Verkoeyen <[email protected]> | |
Date: Sat, 13 Feb 2010 18:14:08 -0500 | |
Subject: [PATCH] Older SDKs (pre 3.2) seem to flip the shadow y offset, but 3.2 doesn't. | |
This fixes the TTStyle for shadows on 3.2. | |
--- | |
src/TTStyle.m | 10 +++++++++- | |
1 files changed, 9 insertions(+), 1 deletions(-) |
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
diff --git a/samples/TTCatalog/Classes/TableControlsTestController.m b/samples/TTCatalog/Classes/TableControlsTestController.m | |
index 19b7380..08501fd 100644 | |
--- a/samples/TTCatalog/Classes/TableControlsTestController.m | |
+++ b/samples/TTCatalog/Classes/TableControlsTestController.m | |
@@ -13,41 +13,45 @@ | |
self.autoresizesForKeyboard = YES; | |
self.variableHeightRows = YES; | |
- UITextField* textField = [[[UITextField alloc] init] autorelease]; |
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)updateTitle { | |
self.title = [NSString stringWithFormat:@"Custom formatting."]; | |
} | |
- (void)photoAlbumScrollViewDidChangePages:(NIPhotoAlbumScrollView *)photoAlbumScrollView { | |
[super photoAlbumScrollViewDidChangePages:photoAlbumScrollView]; | |
[self updateTitle]; | |
} |
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
typedef enum { | |
NIOpenAuthenticationStateFetchingToken, | |
NIOpenAuthenticationStateAuthorized, | |
} NIOpenAuthenticationState; | |
// Step 1: Create an auth object that will capture the token. | |
self.auth = [[[NISoundCloudOpenAuthenticator alloc] | |
initWithClientIdentifier:@"xxxxxx" | |
clientSecret:@"xxxxxx"] autorelease]; |
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
// We create an NIAttributedLabel the same way we would a UILabel. | |
NIAttributedLabel* label = [[NIAttributedLabel alloc] initWithFrame:CGRectZero]; | |
// In practice we set the text before applying any CoreText style. Modifying the text after | |
// setting the styles will clear any existing CoreText-specific styles. | |
// | |
// Peeking under the hood: NIAttributedLabel creates an NSMutableAttributedString object when we | |
// set this text. The NSMutableAttributedString object is initially styled with whatever values | |
// were set on the UILabel. For example, if we set the textColor to blue and then set the text to | |
// @"Nimbus", the label would correctly display the text as blue. This allows you to treat |
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
NSString* string = | |
@"For 20 years she has ventured into the dark horizon. " | |
@"At long last, a planet grows in the distance. " | |
@"\"Hello world!\" she exclaims."; | |
// We're going to customize the words "hello" and "world" in the string above to make them stand | |
// out in our text. | |
NSRange rangeOfHello = [string rangeOfString:@"Hello"]; | |
NSRange rangeOfWorld = [string rangeOfString:@"world!"]; |
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
NIAttributedLabel* label = [[NIAttributedLabel alloc] initWithFrame:CGRectZero]; | |
label.numberOfLines = 0; | |
label.lineBreakMode = UILineBreakModeWordWrap; | |
label.autoresizingMask = UIViewAutoresizingFlexibleDimensions; | |
label.frame = CGRectInset(self.view.bounds, 20, 20); | |
label.font = [UIFont fontWithName:@"AmericanTypewriter" size:15]; | |
// In order to handle the events generated by the user tapping a link we must implement the | |
// delegate. | |
label.delegate = self; |
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
NIAttributedLabel* label = [[NIAttributedLabel alloc] initWithFrame:CGRectZero]; | |
label.numberOfLines = 0; | |
label.lineBreakMode = UILineBreakModeWordWrap; | |
label.autoresizingMask = UIViewAutoresizingFlexibleDimensions; | |
label.frame = CGRectInset(self.view.bounds, 20, 20); | |
label.font = [UIFont fontWithName:@"Optima-Regular" size:20]; | |
label.delegate = self; | |
label.autoDetectLinks = YES; | |
// Turn on all available data detectors. This includes phone numbers, email addresses, and |
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
// We don't know what the initial frame will be, so pass the empty rect. | |
NIBadgeView* badgeView = [[NIBadgeView alloc] initWithFrame:CGRectZero]; | |
// The badgeView backgroundColor is black by default. | |
badgeView.backgroundColor = self.view.backgroundColor; | |
// We can set any arbitrary text to the badge view. | |
badgeView.text = @"7"; | |
// Once we've set the text we allow the badge view to size itself to fit the contents of the |
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
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { | |
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { | |
// Load the Nimbus app icon. | |
NSString* imagePath = NIPathForBundleResource(nil, @"Icon.png"); | |
UIImage* image = [[Nimbus imageMemoryCache] objectWithName:imagePath]; | |
if (nil == image) { | |
image = [UIImage imageWithContentsOfFile:imagePath]; | |
[[Nimbus imageMemoryCache] storeObject:image withName:imagePath]; | |
} |
OlderNewer