{"id":13512073,"url":"https://github.com/lilei644/LLSwitch","last_synced_at":"2025-03-30T22:31:55.451Z","repository":{"id":48144761,"uuid":"58993755","full_name":"lilei644/LLSwitch","owner":"lilei644","description":"This is a funny switch for iOS - 一个有趣的switch","archived":false,"fork":false,"pushed_at":"2017-11-02T08:00:16.000Z","size":474,"stargazers_count":585,"open_issues_count":5,"forks_count":60,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-03-14T19:03:36.071Z","etag":null,"topics":["switch"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lilei644.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-17T05:44:15.000Z","updated_at":"2024-03-05T03:04:40.000Z","dependencies_parsed_at":"2022-09-11T02:51:11.401Z","dependency_job_id":null,"html_url":"https://github.com/lilei644/LLSwitch","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilei644%2FLLSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilei644%2FLLSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilei644%2FLLSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilei644%2FLLSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lilei644","download_url":"https://codeload.github.com/lilei644/LLSwitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390896,"owners_count":20769475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["switch"],"created_at":"2024-08-01T03:01:27.985Z","updated_at":"2025-03-30T22:31:54.327Z","avatar_url":"https://github.com/lilei644.png","language":"Objective-C","readme":"LLSwitch\n==================\n\n\nThis is a funny switch for iOS\u003cbr\u003e\n一个有趣的switch\n\nThank [Dribbble](https://dribbble.com/shots/2706143-Dribbble-Debut-Boring-Funny-Slider-Animation) for providing inspiration\n\n----------\n\n\nPreview  预览\n-------------\n![LLSwitchDemo](https://github.com/lilei644/LLSwitch/blob/master/Preview/LLSwitchDemo.gif)\n\n## Installation \u0026nbsp;安装\n* pod\n```\n1.pod \"LLSwitch\"\n2.pod install       // 若获取失败请重新 pod setup\n3.#import \"LLSwitch.h\"\n```\n* Common\n```\n1.Add \"LLSwitch\" files to your Project   // 直接导入“LLSwitch”文件夹到项目中\n2.#import \"LLSwitch.h\"\n```\n\n## Usage \u0026nbsp;用法\n* Init \u0026nbsp;初始化\n```\nLLSwitch *llSwitch = [[LLSwitch alloc] initWithFrame:CGRectMake(100, 100, 120, 60)];\n[self.view addSubview:llSwitch];\n```\n* Reset Base Property \u0026nbsp;重设基本属性\n```\nllSwitch.onColor = [UIColor blueColor];    // switch is open color    开关打开的颜色\nllSwitch.offColor = [UIColor grayColor];    // switch is close color    开关关闭的颜色\nllSwitch.faceColor = [UIColor whiteColor];    // switch face color    圆脸的颜色\nllSwitch.animationDuration = 1.2f;    // switch open or close animation time    开关的动画时间\n\n[llSwitch setOn:YES];                 // set on and off     设置开关\n[llSwitch setOn:YES animated:YES];\n```\n\n* delegate \u0026nbsp;代理监听\n```\n\u003cLLSwitchDelegate\u003e\nllSwitch.delegate = self;\n\n-(void)didTapLLSwitch:(LLSwitch *)llSwitch {\nNSLog(@\"start\");\n}\n\n- (void)animationDidStopForLLSwitch:(LLSwitch *)llSwitch {\nNSLog(@\"stop\");\n}\n\n- (void)valueDidChanged:(LLSwitch *)llSwitch on:(BOOL)on {\nNSLog(@\"stop --- on:%hhd\", on);\n}\n```\n* support xib and storyboard\u0026nbsp;支持xib和storyboard\n![LLSwitchForXib](https://github.com/lilei644/LLSwitch/blob/master/Preview/LLSwitchForXib.png)\n\n## Requirements \u0026nbsp;版本要求\nIOS 6.0 Above\n\n## License\nLLSwitch is provided under the MIT license. See LICENSE file for details.\n","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilei644%2FLLSwitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilei644%2FLLSwitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilei644%2FLLSwitch/lists"}