![IconLabel使用](/linshaolie/IconFontExtension/raw/master/Resources/storyboard%E4%B8%8AIconLabel%E4%BD%BF%E7%94%A8.gif)
![IconButton使用](/linshaolie/IconFontExtension/raw/master/Resources/storyboard%E4%B8%8AIconButton%E4%BD%BF%E7%94%A8.gif)
![IconImageView使用](/linshaolie/IconFontExtension/raw/master/Resources/storyboard%E4%B8%8AIconImageView%E4%BD%BF%E7%94%A8.gif)
IconLabel *iconLabel = [[IconLabel alloc] initWithIconName:@"灯泡" fontSize:30];
iconLabel.frame = CGRectMake(100, 400, iconLabel.frame.size.width, iconLabel.frame.size.height);
- (void)viewDidLoad {
[super viewDidLoad];
IconButton *iconBtn = [[IconButton alloc] initWithIcon:@"空红心" color:[UIColor yellowColor] selectedIcon:@"实红心" selectedColor:[UIColor redColor]];
iconBtn.frame = CGRectMake(160, 400, 40, 40);
[iconBtn addTarget:self action:@selector(touchBtn:) forControlEvents:UIControlEventTouchUpInside];
iconBtn.size = 30;
[self.view addSubview:iconBtn];
}
- (void)touchBtn:(UIButton *)btn {
btn.selected = !btn.selected;
}
IconImageView *imageView = [[IconImageView alloc] initWithImage:[UIImage iconWithInfo:[IconInfo iconInfoWithText:@"back" size:24 color:[UIColor blackColor]]]];
imageView.frame = CGRectMake(220, 400, 30, 30);
IconImageView *imageView2 = [[IconImageView alloc] init];
imageView2.tintColor = [UIColor purpleColor];
imageView2.frame = CGRectMake(260, 400, 30, 30);
imageView2.iconName = @"灯泡";