mkLabelNormal = MKLabel(frame: CGRect(x: 0, y: 90, width: self.view.frame.size.width, height: 100))
mkLabelNormal?.text = "Do any additional setup after loading the view, typically from a nib,Do any additional setup after loading the view, typically from a nib,"
mkLabelNormal?.beginFadeAnimation(isFadeIn: true, completionBlock: { (finished, text) in
print("animation finished")
})
enum MKLabelDisplayType {
case normal // Irregular fade in or fade out animation
case ascend // Begin animation from begin to the end
case descend // Begin animation from end to the begin
case middle // Begin animation from middle of labe text
case other // default animation
}
mkLabelAscend = MKLabel(frame: CGRect(x: 0, y: 210, width: self.view.frame.size.width, height: 100))
mkLabelAscend?.text = "Do any additional setup after loading the view, typically from a nib,Do any additional setup after loading the view, typically from a nib"
mkLabelAscend?.beginFadeAnimation(isFadeIn: true, displayType: .ascend, completionBlock: { (finished, text) in
print("animation finished")
})
mkLabelDescend = MKLabel(frame: CGRect(x: 0, y: 330 + baseY, width: self.view.frame.size.width, height: 100))
mkLabelDescend?.text = "swift,#topic# D#o @any additional setup after loading the view, typically nice from@gmail.com a nib,772078507@qq.com after loading the @view, typically from a nibd,Hello"
mkLabelDescend?.numberOfLines = 0
mkLabelDescend?.lineBreakMode = .byWordWrapping
mkLabelDescend?.textAlignment = .center
mkLabelDescend?.font = UIFont.systemFont(ofSize: 16.0)
mkLabelDescend?.backgroundColor = UIColor.purple
mkLabelDescend?.beginFadeAnimation(isFadeIn: true, displayType: .descend, completionBlock: { (finished, text) in
print("click Descend tag:\(text)")
})
mkLabelDescend?.mkAddAttributeTapAction(nil, highlightTapAction: { (text, range, index) in
print("click tag:\(text)")
})
mkLabelMiddle = MKLabel(frame: CGRect(x: 0, y: 450 + baseY, width: self.view.frame.size.width, height: 100))
mkLabelMiddle?.text = "swift,#topic# D#o @any additional setup after loading the view, typically nice from@gmail.com a nib,772078507@qq.com after loading the @view, typically from a nibd,Hello"
mkLabelMiddle?.numberOfLines = 0
mkLabelMiddle?.lineBreakMode = .byWordWrapping
mkLabelMiddle?.textAlignment = .left
mkLabelMiddle?.font = UIFont.systemFont(ofSize: 13.0)
mkLabelMiddle?.backgroundColor = UIColor.green
mkLabelMiddle?.beginFadeAnimation(isFadeIn: true, displayType: .middle, completionBlock: { (finished, text) in
})
mkLabelMiddle?.mkAddAttributeTapAction(["swift","topic","loading","nice","Hello"], highlightTapAction: { (text, range, index) in
print("tap text is:\(text)")
})