Vote count: 0 I am trying to subclass a UILabel so that it has a default keing set to 1.5 then i am going to use that in my app with multiple labels. goal is to have default ke set out of the box so i can avoid repeated code all over the place also labels are set as mix of attributed and regular text Exapmple: @IBoutlet weak var myLabel: CustomeLabelWithKe! myLabel.attributedText = myAttributedText @IBOutlet weak var myOtherLabelInADifferentViewController: CustomeLabelWithKe! myOtherLabelInADifferentViewController.text "Foo Bar" both of these label should have ke of 1.5 asked 14 secs agoSwift_Leaer Let's block ads!...
ادامه مطلبVote count: 0 I have a subclass of UIControl what I want to achieve is a UISlider with 2 UIButton-like thumbs but I'm coufused if should I use touchesBegan(::) or beginTrackingWithTouch(::) and how could i force my button follow touch events What I've only achieved is highlighting a button with overriding its @highlighted property like this : class RangeSliderThumbLayer: UIButton { override var highlighted: Bool { didSet { //print("did set (highlighted)") setNeedsDisplay() if highlighted { self.backgroundColor = UIColor.redColor() } else { self.backgroundColor = UIColor.greenColor() } } } here how I've tried to move my button : override func beginTrackingWithTouch(touch: UITouch, withEvent e...
ادامه مطلب