Skip to content

Commit f664c9c

Browse files
author
Martin Barreto
authored
Merge pull request #580 from dotkebi/readme
# modifiy `README.md` example code
2 parents f0a0c37 + 17e7cc1 commit f664c9c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ settings.style.buttonBarLeftContentInset: CGFloat?
204204
settings.style.buttonBarRightContentInset: CGFloat?
205205

206206
// selected bar view is created programmatically so it's important to set up the following 2 properties properly
207-
settings.style.selectedBarBackgroundColor = UIColor.blackColor()
207+
settings.style.selectedBarBackgroundColor = UIColor.black
208208
settings.style.selectedBarHeight: CGFloat = 5
209209

210210
// each buttonBar item is a UICollectionView cell of type ButtonBarViewCell
211211
settings.style.buttonBarItemBackgroundColor: UIColor?
212-
settings.style.buttonBarItemFont = UIFont.systemFontOfSize(18)
212+
settings.style.buttonBarItemFont = UIFont.systemFont(ofSize: 18)
213213
// helps to determine the cell width, it represent the space before and after the title label
214214
settings.style.buttonBarItemLeftRightMargin: CGFloat = 8
215215
settings.style.buttonBarItemTitleColor: UIColor?
@@ -223,7 +223,7 @@ public var buttonBarHeight: CGFloat?
223223
```swift
224224
override func viewDidLoad() {
225225
self.settings.style.selectedBarHeight = 2
226-
self.settings.style.selectedBarBackgroundColor = UIColor.whiteColor()
226+
self.settings.style.selectedBarBackgroundColor = UIColor.white
227227

228228
super.viewDidLoad()
229229
}
@@ -245,17 +245,17 @@ changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonB
245245
guard changeCurrentIndex == true else { return }
246246

247247
oldCell?.label.textColor = UIColor(white: 1, alpha: 0.6)
248-
newCell?.label.textColor = .whiteColor()
248+
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
```
@@ -273,10 +273,10 @@ settings.style.barHeight: CGFloat = 5
273273

274274
```swift
275275
settings.style.dotColor = UIColor(white: 1, alpha: 0.4)
276-
settings.style.selectedDotColor = UIColor.whiteColor()
277-
settings.style.portraitTitleFont = UIFont.systemFontOfSize(18)
278-
settings.style.landscapeTitleFont = UIFont.systemFontOfSize(15)
279-
settings.style.titleColor = UIColor.whiteColor()
276+
settings.style.selectedDotColor = UIColor.white
277+
settings.style.portraitTitleFont = UIFont.systemFont(ofSize: 18)
278+
settings.style.landscapeTitleFont = UIFont.systemFont(ofSize: 15)
279+
settings.style.titleColor = UIColor.white
280280
```
281281

282282
### Segmented Type Customization

0 commit comments

Comments
 (0)