{"id":21373915,"url":"https://github.com/itenfay/dyfassistivetouchview","last_synced_at":"2025-07-13T08:31:27.976Z","repository":{"id":56908112,"uuid":"185067469","full_name":"itenfay/DYFAssistiveTouchView","owner":"itenfay","description":"在iOS应用内的悬浮按钮和工具条。(The suspension button and toolbar for iOS in APP.)","archived":false,"fork":false,"pushed_at":"2023-06-27T08:51:37.000Z","size":3036,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-02T10:13:52.207Z","etag":null,"topics":["assistive","assistivetouch","float-button","ios","ios-tools","objective-c","toolbar","touch"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itenfay.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,"governance":null}},"created_at":"2019-05-05T18:26:20.000Z","updated_at":"2024-06-02T10:13:52.208Z","dependencies_parsed_at":"2023-07-13T23:15:45.931Z","dependency_job_id":null,"html_url":"https://github.com/itenfay/DYFAssistiveTouchView","commit_stats":null,"previous_names":["dgynfi/dyfassistivetouchview","itenfay/dyfassistivetouchview"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFAssistiveTouchView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFAssistiveTouchView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFAssistiveTouchView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2FDYFAssistiveTouchView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itenfay","download_url":"https://codeload.github.com/itenfay/DYFAssistiveTouchView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868140,"owners_count":17536974,"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":["assistive","assistivetouch","float-button","ios","ios-tools","objective-c","toolbar","touch"],"created_at":"2024-11-22T08:29:35.398Z","updated_at":"2024-11-22T08:29:54.276Z","avatar_url":"https://github.com/itenfay.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"如果能帮助到你，请你给[一颗星](https://github.com/itenfay/DYFAssistiveTouchView)，谢谢！(If this can help you, please give it a [star](https://github.com/itenfay/DYFAssistiveTouchView), Thanks!)\n\n## DYFAssistiveTouchView\n\n实现应用内悬浮按钮和辅助工具条，可以增加/修改 Item 项，通过事件索引完成各种场景页面的跳转。\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/v/DYFAssistiveTouchView.svg?style=flat)](http://cocoapods.org/pods/DYFAssistiveTouchView)\u0026nbsp;\n![CocoaPods](http://img.shields.io/cocoapods/p/DYFAssistiveTouchView.svg?style=flat)\u0026nbsp;\n\n## Installation\n\nUsing [CocoaPods](https://cocoapods.org):\n\n```\npod 'DYFAssistiveTouchView'\n```\n\nOr\n\n```\n pod 'DYFAssistiveTouchView', '~\u003e 4.3.1'\n```\n\n## Group (ID:614799921)\n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/itenfay/DYFAssistiveTouchView/raw/master/images/g614799921.jpg\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Priview\n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/itenfay/DYFAssistiveTouchView/raw/master/images/AssistiveTouchViewPreview.gif\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Usage\n\n1. 实例化\n\n```ObjC\n// Lazy load\n- (DYFAssistiveTouchView *)touchView {\n    if (!_touchView) {\n        _touchView = [[DYFAssistiveTouchView alloc] init];\n        _touchView.frame = CGRectMake(0, 0, 50, 50);\n    }\n    return _touchView;\n}\n```\n\n2. 设置属性\n\n- 设置悬浮按钮的各种状态的图片\n\n```ObjC\nUIImage        *leftHidenImage = [UIImage imageNamed:@\"atv_hide_left\"];\nUIImage       *rightHidenImage = leftHidenImage;\nUIImage       *leftNormalImage = [UIImage imageNamed:@\"atv_normal_left\"];\nUIImage      *rightNormalImage = leftNormalImage;\nUIImage  *leftHighlightedImage = [UIImage imageNamed:@\"atv_normal_left\"];\nUIImage *rightHighlightedImage = leftHighlightedImage;\n\nself.touchView.touchObject.leftNormalImage       = leftNormalImage;\nself.touchView.touchObject.rightNormalImage      = rightNormalImage;\nself.touchView.touchObject.leftHighlightedImage  = leftHighlightedImage;\nself.touchView.touchObject.rightHighlightedImage = rightHighlightedImage;\nself.touchView.touchObject.leftTranslucentImage  = leftHidenImage;\nself.touchView.touchObject.rightTranslucentImage = rightHidenImage;\n```\n\n- 设置Unit对象\n\n```ObjC\nUIImage  *leftUint1Image = [UIImage imageNamed:@\"atv_unit1_left\"];\nUIImage *rightUint1Image = [UIImage imageNamed:@\"atv_unit1_right\"];\nUIImage  *leftUint2Image = [UIImage imageNamed:@\"atv_unit2_left\"];\nUIImage *rightUint2Image = [UIImage imageNamed:@\"atv_unit2_right\"];\n\nself.touchView.unitObject.leftTouchImage           = leftUint1Image;\nself.touchView.unitObject.rightTouchImage          = rightUint1Image;\nself.touchView.unitObject.leftItemBackgroundImage  = leftUint2Image;\nself.touchView.unitObject.rightItemBackgroundImage = rightUint2Image;\n```\n\n- 设置Item对象\n\n```ObjC\nUIImage *userImage = [UIImage imageNamed:@\"atv_item_user\"];\nUIImage *cafeImage = [UIImage imageNamed:@\"atv_item_cafe\"];\nUIImage   *csImage = [UIImage imageNamed:@\"atv_item_cs\"];\n\nDYFAssistiveTouchItem *item  = [[DYFAssistiveTouchItem alloc] init];\nitem.image  = userImage;\nDYFAssistiveTouchItem *item1 = [[DYFAssistiveTouchItem alloc] init];\nitem1.image = cafeImage;\nDYFAssistiveTouchItem *item2 = [[DYFAssistiveTouchItem alloc] init];\nitem2.image = csImage;\n\nself.touchView.items = @[item, item1, item2];\n```\n\n3. 是否显示\n\n```ObjC\n[self.touchView isShowing]\n```\n\n4. 显示\n\n```ObjC\n[self.touchView show];\n```\n\n5. 隐藏\n\n```ObjC\n[self.touchView hide];\n```\n\n6. 隐藏一半至屏幕\n\n```ObjC\n[self.touchView setShouldShowHalf:YES];\n```\n\n7. 设置初始显示位置\n\n```ObjC\n[self.touchView setTouchViewPlace:DYFTouchViewAtMiddleRight];\n```\n\n8. 响应事件(二选一)\n\n```ObjC\n- (void)presentAtIndex:(NSInteger)index {\n    NSString *url = @\"https://support.apple.com/zh-cn\";\n\n    if (index == 0) {\n        url = @\"https://github.com/itenfay\";\n    } \n    else if (index == 1) {\n        url = @\"https://github.com/itenfay/Awesome\";\n    } \n    else {\n        url = @\"https://www.jianshu.com/u/7fc76f1179cc\";\n    }\n\n    SFSafariViewController *safariVC = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:url]];\n    [self presentViewController:safariVC animated:YES completion:NULL];\n}\n```\n\n - Block实现\n \n```ObjC\n- (IBAction)configureAction:(id)sender {\n    if (!_touchView) {\n        [self configTouchViewDotImages];\n        [self configTouchViewUnits];\n        [self configTouchViewItems];\n\n        [self.touchView setShouldShowHalf:YES];\n        [self.touchView setTouchViewPlace:DYFTouchViewAtMiddleRight];\n        \n        __weak typeof(self) weakSelf = self;\n        [self.touchView touchViewItemDidClickedAtIndex:^(DYFAssistiveTouchView *touchView) {\n            NSInteger index = touchView.indexOfItem;\n            NSLog(@\"Index of item: %zi\", index);\n            [weakSelf presentAtIndex:index];\n        }];\n    }\n}\n```\n\n- 代理实现\n\n```ObjC\n// 协议\nProtocol: \u003cDYFAssistiveTouchViewDelegate\u003e\n\n// 设置代理 \nself.touchView.delegate = self;\n\n// 代理实现\n- (void)touchViewItemDidClickedAtIndex:(DYFAssistiveTouchView *)touchView {\n    NSInteger index = touchView.indexOfItem;\n    NSLog(@\"Index of item: %zi\", index);\n    [self presentAtIndex:index]; \n}\n```\n\n## Sample\n\n- [Code Sample Portal](https://github.com/itenfay/DYFAssistiveTouchView/blob/master/Basic%20Files/ViewController.m)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fdyfassistivetouchview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitenfay%2Fdyfassistivetouchview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fdyfassistivetouchview/lists"}