GFMagicUI 0.1.2

GFMagicUI 0.1.2

Fanfa 维护。



GFMagicUI 0.1.2

GFMagicUI

CI Status Version License Platform

示例

Alt Text

一个快速工具,用于定位和自定义您的Storyboard。您可以快速定位Storyboard。您可以自定义字体名称、大小和颜色。

要运行示例项目,请克隆仓库,然后从示例目录运行pod install

安装

GFMagicUI可通过CocoaPods获取。要安装,只需在Podfile中添加以下行

pod 'GFMagicUI'

如何使用

字体名称/大小@implementation GFFont (CustomFont)

+ (bool)isSystemFont {
	return false;
}

+ (NSString*)fontRegularName {
	return @"RobotoSlab-Regular";
}

+ (NSString*)fontBoldName {
	return @"RobotoSlab-Bold";
}

+ (UIFont*)smallFont:(UIView *)view {
	return [GFFont forGeneralView:view fontSize:UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 19 : 17];
}

+ (UIFont*)normalFont:(UIView *)view {
	return [self forGeneralView:view fontSize:UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 21 : 19];
}

+ (UIFont*)bigFont:(UIView *)view {
	return [self forGeneralView:view fontSize:UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 23 : 21];
}

@end

颜色typedef NS_ENUM(int, CustomColorFanfa) { TEXT_COLOR_DARK_GREY_FANFA = 1, TEXT_COLOR_LIGHT_GREY_FANFA = 2, MAIN_COLOR_FANFA = 3, TEXT_COLOR_WHITE_FANFA = 4, TEXT_COLOR_BLACK_FANFA = 5, BACKGROUND_COLOR_LIGHT_GREY_FANFA = 6, TEXT_COLOR_PLACEHOLDER_FANFA = 7, TEXT_COLOR_CLEAR_FANFA = 8, BACKGROUND_COLOR_DARK_GREY_FANFA = 9, TEXT_COLOR_RED_FANFA = 10, GRADIENT_START_FANFA = 11, GRADIENT_END_FANFA = 12, RED_COLOR_FANFA = 13, BLUE_COLOR_FANFA = 14, GREEN_COLOR_FANFA = 15, BLACK_COLOR_FANFA = 16, ORANGE_COLOR_FANFA = 17, YELLOW_COLOR_FANFA = 18 }

@implementation GFUI (CustomUI)

+ (UIColor*)getCustomColor:(NSInteger)value {
	switch (value) {
		case TEXT_COLOR_DARK_GREY_FANFA:
			return [UIColor darkGrayColor];
		case TEXT_COLOR_LIGHT_GREY_FANFA:
			return [UIColor grayColor];
		case MAIN_COLOR_FANFA:
			return [UIColor greenColor];
		case TEXT_COLOR_WHITE_FANFA:
			return [UIColor whiteColor];
		case TEXT_COLOR_BLACK_FANFA:
			return [UIColor blackColor];
		case BACKGROUND_COLOR_LIGHT_GREY_FANFA:
			return [UIColor groupTableViewBackgroundColor];
		case TEXT_COLOR_PLACEHOLDER_FANFA:
			return [UIColor lightGrayColor];
		case TEXT_COLOR_CLEAR_FANFA:
			return [UIColor clearColor];
		case BACKGROUND_COLOR_DARK_GREY_FANFA:
			return [UIColor darkGrayColor];
		case TEXT_COLOR_RED_FANFA:
			return [UIColor redColor];
		case GRADIENT_START_FANFA:
			return [UIColor greenColor];
		case GRADIENT_END_FANFA:
			return [UIColor yellowColor];
		case RED_COLOR_FANFA:
			return [UIColor colorWithRed:226.0f/255.0f green:0.0f/255.0f blue:29.0f/255.0f alpha:1.0f];
		case BLUE_COLOR_FANFA:
			return [UIColor colorWithRed:0.0f/255.0f green:26.0f/255.0f blue:220.0f/255.0f alpha:1.0f];
		case GREEN_COLOR_FANFA:
			return [UIColor colorWithRed:76.0f/255.0f green:175.0f/255.0f blue:80.0f/255.0f alpha:1.0f];
		case BLACK_COLOR_FANFA:
			return [UIColor blackColor];
		case ORANGE_COLOR_FANFA:
			return [UIColor orangeColor];
		case YELLOW_COLOR_FANFA:
			return [UIColor yellowColor];

		default:
			return [UIColor blackColor];
	}
}

@end

作者

guidosette, [email protected]

许可证

的GFMagicUI可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。