-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBLIcon.swift
43 lines (34 loc) · 879 Bytes
/
BLIcon.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// BLIcon.swift need FontAwesome
// fourshaonian
//
// Created by FangYan on 16/5/23.
// Copyright © 2016年 yousi.inc. All rights reserved.
//
import UIKit
@IBDesignable
public class BLIcon: UILabel {
@IBInspectable var Icon : String = "fa-arrow-down" {
didSet {
commonInit()
}
}
@IBInspectable var Size : Int = 12 {
didSet {
commonInit()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
func commonInit (){
self.font = UIFont.fontAwesomeOfSize(CGFloat(self.Size))
let iconName = self.Icon
self.text = String.fontAwesomeIconWithName(FontAwesome.fromCode(iconName)!)
}
}