blob: b1d6c2323425d8d85c364bc1fd9d7598937a85a6 [file] [log] [blame]
{
"name": "MLSwitch",
"version": "1.0.2",
"summary": "Simple yet powerful and fast image cache.",
"description": "# MLSwitch\n## Fully customisable UISwitch replacement\n\nReimplementation of UISwitch using custom images for background and slider, with an option to have on and off buttons different from each other.\nOne needs to provide a background image and on/off images (can be the same). \n\nThe control sends \"Value Changed\" control events just like normal UISwitch does.\n\n## Installation\n \nUse CocoaPods or copy those 2 files directly into the project. \n\n pod 'MLSwitch'\n\n## How to use it?\n \n The only difference between MLSwitch and UISwitch is that you need to set on, off and background images and image offset. The off image is offset from left top corner, \n the on image is offset from right top corner.\n \n let switch = MLSwitch(frame: CGRectMake(0,0,100,100))\n \n switch.backgroundImage = UIImage(named:\"example_bg\")\n switch.offImage = UIImage(named:\"example_off\")\n switch.onImage = UIImage(named:\"example_on\")\n switch.switchOffset = CGPointMake(0, 0)\n \nIt can be used with autolayout, just pick a generic UIControl in a storyboard and assign it MLSwitch class. You can place the image initialization code in \ndidSet on the outlet like this: \n\n @IBOutlet private weak var switch: MLSwitch! {\n didSet {\n switch.backgroundImage = UIImage(named:\"example_bg\")\n switch.offImage = UIImage(named:\"example_off\")\n switch.onImage = UIImage(named:\"example_on\")\n switch.switchOffset = CGPointMake(0, 0)\n }\n }",
"homepage": "https://github.com/mll/MLSwitch",
"license": "MIT",
"authors": {
"Marek Lipert": "marek.lipert@gmail.com"
},
"platforms": {
"ios": "5.0"
},
"source": {
"git": "https://github.com/mll/MLSwitch.git",
"tag": "1.0.2"
},
"source_files": "*.{h,m}",
"requires_arc": true
}