Skip to content

Commit 17e7cc1

Browse files
committed
# modifiy README.md example code
by swift 4.1 syntax * UIView.animate * CGAffineTransform
1 parent 8a5b935 commit 17e7cc1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonB
248248
newCell?.label.textColor = UIColor.white
249249

250250
if animated {
251-
UIView.animateWithDuration(0.1, animations: { () -> Void in
252-
newCell?.transform = CGAffineTransformMakeScale(1.0, 1.0)
253-
oldCell?.transform = CGAffineTransformMakeScale(0.8, 0.8)
251+
UIView.animate(withDuration: 0.1, animations: { () -> Void in
252+
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
253+
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
254254
})
255255
}
256256
else {
257-
newCell?.transform = CGAffineTransformMakeScale(1.0, 1.0)
258-
oldCell?.transform = CGAffineTransformMakeScale(0.8, 0.8)
257+
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
258+
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
259259
}
260260
}
261261
```

0 commit comments

Comments
 (0)