Saturday 15 November 2014

Find the Fonts in your App and added into Array

Find the font and Stored into array. The array is used in Tableview to show the Font List. 


ViewController.h File

NSMutableArray *font_names;


ViewController.m File

-(void)fontfamily
{
    font_names = [[NSMutableArray alloc]init];
    
    for (NSString* family in [UIFont familyNames])
    {
        NSLog(@"%@", family);
        
        for (NSString* name in [UIFont fontNamesForFamilyName:family])
        {
            NSLog(@"  %@", name);
            [font_names addObject:name];
        }
    }
}


No comments: