Wednesday 21 June 2017

Get all font name in ios

How to check if a font is available in version of iOS?



- (void) getAllFontName {
    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
    
    NSArray *fontNames;
    NSInteger indFamily, indFont;
    for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
    {
        NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
        fontNames = [[NSArray alloc] initWithArray:
                     [UIFont fontNamesForFamilyName:
                      [familyNames objectAtIndex:indFamily]]];
        for (indFont=0; indFont<[fontNames count]; ++indFont)
        {
            NSLog(@"Font name: %@", [fontNames objectAtIndex:indFont]);
        }
    }
}

Monday 13 March 2017

Failed to obtain a cell from its DataSource

Solutions for "Failed to obtain a cell from its DataSource" error

Swift 3.0

You just need to add UITableViewDelegate and UITableViewDataSource
import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource



stackoverflow link :
http://stackoverflow.com/questions/34250595/failed-to-obtain-a-cell-from-its-datasource/41566649#41566649