{"id":18880838,"url":"https://github.com/keenteam1990/ktplaybutton","last_synced_at":"2025-06-21T04:36:05.709Z","repository":{"id":107584239,"uuid":"102342980","full_name":"KeenTeam1990/KTPlayButton","owner":"KeenTeam1990","description":"🍉爱奇艺播放、暂停按钮动画效果","archived":false,"fork":false,"pushed_at":"2017-09-04T09:33:16.000Z","size":81,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T22:38:50.080Z","etag":null,"topics":["button","objective-c","play"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeenTeam1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-04T09:20:50.000Z","updated_at":"2018-07-06T11:23:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"feccd9f8-2e0f-4ac9-8d68-18686812fc5f","html_url":"https://github.com/KeenTeam1990/KTPlayButton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KeenTeam1990/KTPlayButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTPlayButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTPlayButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTPlayButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTPlayButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeenTeam1990","download_url":"https://codeload.github.com/KeenTeam1990/KTPlayButton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTPlayButton/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261064339,"owners_count":23104722,"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":["button","objective-c","play"],"created_at":"2024-11-08T06:46:14.294Z","updated_at":"2025-06-21T04:36:00.697Z","avatar_url":"https://github.com/KeenTeam1990.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KTPlayButton\n\n\n### 爱奇艺播放、暂停按钮动画效果\n\n![image](https://github.com/KeenTeam1990/KTPlayButton/blob/master/GIF/1.gif)\n\n### 优酷播放、暂停按钮动画效果\n\n![image](https://github.com/KeenTeam1990/KTPlayButton/blob/master/GIF/2.gif)\n\n### 实现原理\n\n实现原理是利用贝塞尔曲线和CAShapeLayer绘制出三角、圆弧、直线，然后通过核心动画实现的动态效果。\n\n### 使用方法\n\n* KTPlayButton 是继承UIButton的，只是创建方式和UIButton不同，其他的使用方法均一致。\n* 创建方法\n```objc\n_iQiYiPlayButton = [[iQiYiPlayButton alloc] initWithFrame:CGRectMake(0, 0, 60, 60) state:iQiYiPlayButtonStatePlay];\n```\n* 唯一属性\n```objc\n/**\n 通过setter方式控制按钮动画\n 设置KTPlayButtonStatePlay显示播放按钮\n 设置KTPlayButtonStatePause显示暂停按钮\n */\n@property (nonatomic, assign) KTPlayButtonState buttonState;\n```\n* 切换状态方法\n```objc\n- (void)iQiYiPlayMethod {\n    //通过判断当前状态 切换显示状态\n    if (_iQiYiPlayButton.buttonState == iQiYiPlayButtonStatePause) {\n        _iQiYiPlayButton.buttonState = iQiYiPlayButtonStatePlay;\n    }else {\n        _iQiYiPlayButton.buttonState = iQiYiPlayButtonStatePause;\n    }\n}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeenteam1990%2Fktplaybutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeenteam1990%2Fktplaybutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeenteam1990%2Fktplaybutton/lists"}