UIFont+Inspector: Get Font Size

January 18, 2014

Header: UIFont+Inspector.h

//
//  UIFont+Inspector.h
//  Hint
//
//  Created by henrikelgemark on 2014-01-18.
//  Copyright (c) 2014 Henrik Elgemark. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIFont (Inspector)

-(NSNumber*)fontSize;

@end

Implementation: UIFont+Inspector.m

//
//  UIFont+Inspector.m
//  Hint
//
//  Created by henrikelgemark on 2014-01-18.
//  Copyright (c) 2014 Henrik Elgemark. All rights reserved.
//

#import "UIFont+Inspector.h"

@implementation UIFont (Inspector)

-(NSNumber*)fontSize{
    return  self.fontDescriptor.fontAttributes[UIFontDescriptorSizeAttribute];
}

@end

Tags: ,