2 "name": "YSSegmentedControl",
4 "summary": "Android style segmented control written in swift. Fully customisable.",
5 "description": "YSSegmentedControl\n==================\n\nAndroid style segmented control written in swift.\nFully customisable.\n\nDemo\n----\n\n![alt tag](https://raw.githubusercontent.com/yemeksepeti/YSSegmentedControl/master/demo.gif)\n\nInstall\n-------\n\n##### Manual\n\nCopy & paste `YSSegmentedControl.swift` in your project\n\n##### Cocoapods\n\n``` ruby\nuse_frameworks!\npod 'YSSegmentedControl'\n```\n\nUsage\n-----\n\nCreate `YSSegmentedControl` with frame and titles.\nYou can either use delegation or callback initilization\n\n##### With callback\n\n``` swift\nlet segmented = YSSegmentedControl(\nframe: CGRect(\nx: 0,\ny: 64,\nwidth: view.frame.size.width,\nheight: 44),\ntitles: [\n\"First\",\n\"Second\",\n\"Third\"\n],\naction: {\ncontrol, index in\nprintln (\"segmented did pressed (index)\")\n})\n\n```\n\n##### With delegation\n\n``` swift\nlet segmented = YSSegmentedControl(\nframe: CGRect(\nx: 0,\ny: 64,\nwidth: view.frame.size.width,\nheight: 44),\ntitles: [\n\"First\",\n\"Second\",\n\"Third\"\n])\n```\n\nSetup the delegate and you are ready to go !\n\n``` swift\nsegmented.delegate = self\n```\n\n### YSSegmentedControlDelegate\n\n``` swift\n@objc protocol YSSegmentedControlDelegate {\noptional func segmentedControlWillPressItemAtIndex (segmentedControl: YSSegmentedControl, index: Int)\noptional func segmentedControlDidPressedItemAtIndex (segmentedControl: YSSegmentedControl, index: Int)\n}\n\n```\n\n### YSSegmentedControlAppearance\n\n``` swift\nstruct YSSegmentedControlAppearance {\n\nvar backgroundColor: UIColor\nvar selectedBackgroundColor: UIColor\n\nvar textColor: UIColor\nvar font: UIFont\n\nvar selectedTextColor: UIColor\nvar selectedFont: UIFont\n\nvar bottomLineColor: UIColor\nvar selectorColor: UIColor\n\nvar bottomLineHeight: CGFloat\nvar selectorHeight: CGFloat\n}\n```\n\nThe default appearance is\n\n``` swift\nappearance = YSSegmentedControlAppearance(\n\nbackgroundColor: UIColor.clearColor(),\nselectedBackgroundColor: UIColor.clearColor(),\n\ntextColor: UIColor.grayColor(),\nfont: UIFont.systemFontOfSize(15),\n\nselectedTextColor: UIColor.blackColor(),\nselectedFont: UIFont.systemFontOfSize(15),\n\nbottomLineColor: UIColor.blackColor(),\nselectorColor: UIColor.blackColor(),\n\nbottomLineHeight: 0.5,\nselectorHeight: 2)\n```\n\nYou can change appearance by\n\n``` swift\nsegmented.appearance = YSSegmentedAppearance (...)\n\n// or\n\nsegmented.appearance.titleColor = ...\n```",
6 "homepage": "https://github.com/yemeksepeti/YSSegmentedControl",
9 "cemolcay": "ccemolcay@gmail.com"
15 "git": "https://github.com/yemeksepeti/YSSegmentedControl.git",
18 "source_files": "YSSegmentedControl/YSSegmentedControl/*.swift",