Skip to content

Instantly share code, notes, and snippets.

@cjazz
Created October 30, 2016 19:59
Show Gist options
  • Save cjazz/51212e9186260f8de2d3c24162cd36f7 to your computer and use it in GitHub Desktop.
Save cjazz/51212e9186260f8de2d3c24162cd36f7 to your computer and use it in GitHub Desktop.
A Collection of common UI methods
//
// 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