Skip to content

Commit

Permalink
Update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil Gontovnik committed Sep 19, 2016
1 parent f8c3b73 commit 1269b65
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# DGRunkeeperSwitch
Runkeeper design switch control (two part segment control) developed in Swift 2.0

![alt tag](https://raw.githubusercontent.com/gontovnik/DGRunkeeperSwitch/master/DGRunkeeperSwitch.png)
![alt tag](https://raw.githubusercontent.com/gontovnik/DGRunkeeperSwitch/master/DGRunkeeperSwitch.gif)
![Preview 1](https://raw.githubusercontent.com/gontovnik/DGRunkeeperSwitch/master/DGRunkeeperSwitch.png)
![Preview 2](https://raw.githubusercontent.com/gontovnik/DGRunkeeperSwitch/master/DGRunkeeperSwitch.gif)

## Requirements
* Xcode 7-beta or higher
* iOS 8.0 or higher (May work on previous versions, just did not test it. Feel free to edit it).
* ARC
* Swift 2.0
* Swift 3.0 (old versions are in different releases)

## Demo

Expand All @@ -23,21 +23,21 @@ All you need to do is drop DGRunkeeperSwitch.swift file into your project
### CocoaPods

``` ruby
pod "DGRunkeeperSwitch", "~> 1.1"
pod "DGRunkeeperSwitch", "~> 1.1.4"
```

## Example usage

``` swift
let runkeeperSwitch = DGRunkeeperSwitch(leftTitle: "Feed", rightTitle: "Leaderboard")
runkeeperSwitch.backgroundColor = UIColor(red: 239.0/255.0, green: 95.0/255.0, blue: 49.0/255.0, alpha: 1.0)
runkeeperSwitch.selectedBackgroundColor = .whiteColor()
runkeeperSwitch.titleColor = .whiteColor()
runkeeperSwitch.selectedTitleColor = UIColor(red: 239.0/255.0, green: 95.0/255.0, blue: 49.0/255.0, alpha: 1.0)
let runkeeperSwitch = DGRunkeeperSwitch(titles: ["Feed", "Leaderboard"])
runkeeperSwitch.backgroundColor = UIColor(red: 229.0/255.0, green: 163.0/255.0, blue: 48.0/255.0, alpha: 1.0)
runkeeperSwitch.selectedBackgroundColor = .white
runkeeperSwitch.titleColor = .white
runkeeperSwitch.selectedTitleColor = UIColor(red: 255.0/255.0, green: 196.0/255.0, blue: 92.0/255.0, alpha: 1.0)
runkeeperSwitch.titleFont = UIFont(name: "HelveticaNeue-Medium", size: 13.0)
runkeeperSwitch.frame = CGRect(x: 50.0, y: 20.0, width: view.bounds.width - 100.0, height: 30.0)
runkeeperSwitch.autoresizingMask = [.FlexibleWidth]
view.addSubview(runkeeperSwitch)
runkeeperSwitch.frame = CGRect(x: 30.0, y: 40.0, width: 200.0, height: 30.0)
runkeeperSwitch.addTarget(self, action: #selector(ViewController.switchValueDidChange(sender:)), for: .touchUpInside)
navigationItem.titleView = runkeeperSwitch
```

## Contribution
Expand Down

0 comments on commit 1269b65

Please sign in to comment.