Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. @implementation RootView
  2.  
  3. - (void)drawRect:(CGRect)rect {
  4. self.highlighted ? [[UIColor whiteColor] set] : [[UIColor blackColor] set];
  5. [self.text drawAtPoint:CGPointMake(5, 10) withFont:[UIFont systemFontOfSize:15.0]];
  6. }
  7.  
  8. - (void)setText:(NSString *)t {
  9. [m_text release];
  10. m_text = nil;
  11.  
  12. m_text = [t retain];
  13. [self setNeedsDisplay];
  14. }
  15.  
  16. - (void)setHighlighted:(BOOL)h {
  17. m_highlighted = h;
  18. [self setNeedsDisplay];
  19. }
  20.  
  21. - (void)sizeToFit {
  22. self.frame = CGRectMake(0, 0, 0, 44);
  23. }
  24.  
  25. @synthesize text = m_text;
  26. @synthesize highlighted = m_highlighted;
  27. @end
Add Comment
Please, Sign In to add comment