This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/joehewitt/three20
- Loading branch information
Showing
42 changed files
with
863 additions
and
544 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#import "Three20/TTBadgeView.h" | ||
#import "Three20/TTDefaultStyleSheet.h" | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
@implementation TTBadgeView | ||
|
||
@synthesize message = _message; | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// NSObject | ||
|
||
- (id)initWithMessage:(NSString*)message { | ||
if (self = [self initWithFrame:CGRectZero]) { | ||
self.message = message; | ||
self.userInteractionEnabled = NO; | ||
} | ||
return self; | ||
} | ||
|
||
- (id)initWithFrame:(CGRect)frame { | ||
if (self = [super initWithFrame:frame]) { | ||
_message = nil; | ||
|
||
self.style = TTSTYLE(badge); | ||
self.backgroundColor = [UIColor clearColor]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)dealloc { | ||
[_message release]; | ||
[super dealloc]; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// TTStyleDelegate | ||
|
||
- (NSString*)textForLayerWithStyle:(TTStyle*)style { | ||
return _message; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// public | ||
|
||
- (void)setMessage:(NSString*)message { | ||
if (message != _message) { | ||
[_message release]; | ||
_message = [message copy]; | ||
[self setNeedsDisplay]; | ||
} | ||
} | ||
|
||
@end |
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
Oops, something went wrong.