Latest 0.1.0
Homepage https://github.com/iOS-AllProjects/EYSegmentedControl
License MIT
Platforms ios 10.0
Authors

Custom segmented control written in swift 3.
Fully customisable, comes in two styles radius and flat!

Demo


Install

Requirements
  • iOS 10.0+
  • Swift 3.0+
Manual

Copy & paste CustomSegmentedControl.swift in your project

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate EYSegmentedControl into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/iOS-AllProjects/EYSegmentedControl.git'

platform :ios, '10.0'
use_frameworks!

target '<Your Target Project Name>' do
pod 'EYSegmentedControl', '0.1.0'
end

Or

source 'https://github.com/iOS-AllProjects/EYSegmentedControl.git'

platform :ios, '10.0'
use_frameworks!

Usage

Drag a UIView into your storyboard! Change the class to CustomSegmentedControl. The view will be updated!

Edit / Add / Remove Labels according to preference!

  var items : [String] = ["Item1", "Item2"] 

In storyboard Edit the following properties!

For the UIView

Background Color.
Corner Radius.
Bottom Border.

For all Labels

Unselected Labels Color.
Highlighted Label Color.
Font Size.

For the Highlighted Label

Radius Style.
Flat Style.
Selected Label Background Color.
Selected Label Border Width.
Selected Label Border Color.

Create an Outlet for the Control!

    @IBOutlet weak var segmented: CustomSegmentedControl! 

Create a Target for your Outlet!

    func segmentedViewControllerValueChanged(_ sender: Any){
    //Logic goes here and is based on index selection
    }

Add your Target

  segmented.addTarget(self, action: #selector(ViewController.segmentedViewControllerValueChanged(_:)), for: .valueChanged)

And that’s it!

Latest podspec

{
    "name": "EYSegmentedControl",
    "version": "0.1.0",
    "summary": "Custom Segmented Control",
    "description": "Fully customisable, comes in two styles radius and flat!!",
    "homepage": "https://github.com/iOS-AllProjects/EYSegmentedControl",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "": ""
    },
    "source": {
        "git": "https://github.com/iOS-AllProjects/EYSegmentedControl.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "EYSegmentedControl/CustomSegmentedControl.swift",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This