Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Commit

Permalink
Updated readme file to include sample for content colors and appearan…
Browse files Browse the repository at this point in the history
…ce proxy additions.
  • Loading branch information
GocePetrovski committed Mar 23, 2017
1 parent 181a645 commit 4535e16
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,31 @@ override func viewDidLoad() {
segmentedControl.underlineSelected = true

segmentedControl.addTarget(self, action: #selector(TableViewController.segmentSelected(sender:)), for: .valueChanged)

// change some colors
segmentedControl.segmentContentColor = UIColor.white
segmentedControl.selectedSegmentContentColor = UIColor.yellow
segmentedControl.backgroundColor = UIColor.black
}

func segmentSelected(sender:ScrollableSegmentedControl) {
print("Segment at index \(sender.selectedSegmentIndex) selected")
}
```

Using appearance proxy to change some colors

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let segmentedControlAppearance = ScrollableSegmentedControl.appearance()
segmentedControlAppearance.segmentContentColor = UIColor.white
segmentedControlAppearance.selectedSegmentContentColor = UIColor.yellow
segmentedControlAppearance.backgroundColor = UIColor.black

return true
}
```

See the Demo project for example on how to use it.


Expand Down

0 comments on commit 4535e16

Please sign in to comment.