Created
October 30, 2016 19:59
-
-
Save cjazz/51212e9186260f8de2d3c24162cd36f7 to your computer and use it in GitHub Desktop.
A Collection of common UI methods
This file contains hidden or 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
// | |
// GlobalUI.m | |
// | |
// Created by Adam Chin on 7/7/15. | |
// | |
#import "GlobalUI.h" | |
@implementation GlobalUI | |
+ (NSNumberFormatter *)currencyFormatter | |
{ | |
static NSNumberFormatter *formatter = nil; | |
if (!formatter) | |
{ | |
formatter = [[NSNumberFormatter alloc] init]; | |
formatter.numberStyle = NSNumberFormatterCurrencyStyle; | |
formatter.negativeFormat = @"(\u00A4#,##0.00)"; | |
} | |
return formatter; | |
} | |
+(CALayer*)bottomBorderFor:(UITextField*)textField | |
{ | |
CALayer *bottomBorder = [CALayer layer]; | |
bottomBorder.backgroundColor = [UIColor lightGrayColor].CGColor; | |
bottomBorder.frame = CGRectMake(0.0f, textField.frame.size.height -1,textField.frame.size.width, 1.0f); | |
return bottomBorder; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment