Skip to content

Commit 8a5b935

Browse files
committed
# modifiy README.md example code
by swift 4.1 syntax * UIColor.whiteColor() -> UIColor.white * UIFont.systemFontOfSize(18) -> UIFont.systemFont(ofSize: 18)
1 parent 1619ad4 commit 8a5b935

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 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,7 +245,7 @@ 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 {
251251
UIView.animateWithDuration(0.1, animations: { () -> Void in
@@ -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)