gontovnik / DGRunkeeperSwitch

Runkeeper design switch control
MIT License
1.88k stars 175 forks source link

Update to Swift 4 #47

Open stefanocali opened 7 years ago

stefanocali commented 7 years ago

with swift 4 does not work

kleber11 commented 7 years ago

@stefanocali If you have crashes on iOS 11 and Swift 4 you should change this line: "addObserver(self, forKeyPath: "selectedBackgroundView.frame", options: .new, context: nil)" on fileprivate "finishInit()" method to this: "addObserver(selectedBackgroundView, forKeyPath: "frame", options: .new, context: nil)". And it will work perfectly.

phoney commented 7 years ago

Also these lines don't compile

    tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapped))
    panGesture = UIPanGestureRecognizer(target: self, action: #selector(pan))

The funcs 'tapped' and 'pan' require the @objc decoration.

gontovnik commented 6 years ago

Will update it.

shardul89 commented 6 years ago

@gontovnik any updates here?

phoney commented 6 years ago

This is fixed by Pull Request #48, which should be merged.

AndriyGo commented 6 years ago

@gontovnik please merge #48 which addresses this.