{"id":13696914,"url":"https://github.com/zhengwenming/WMDragView","last_synced_at":"2025-05-03T17:32:41.614Z","repository":{"id":56410577,"uuid":"76854514","full_name":"zhengwenming/WMDragView","owner":"zhengwenming","description":"WMDragView致力于让任意View都可以自由悬浮拖曳（可拖动，悬浮按钮），类似于iOS的AssistiveTouch效果，微信浮窗。","archived":false,"fork":false,"pushed_at":"2022-12-15T15:19:43.000Z","size":19528,"stargazers_count":900,"open_issues_count":4,"forks_count":161,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-04-24T08:29:27.395Z","etag":null,"topics":[],"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/zhengwenming.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-12-19T10:59:15.000Z","updated_at":"2024-04-19T08:37:10.000Z","dependencies_parsed_at":"2022-08-15T18:10:42.580Z","dependency_job_id":null,"html_url":"https://github.com/zhengwenming/WMDragView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengwenming%2FWMDragView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengwenming%2FWMDragView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengwenming%2FWMDragView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengwenming%2FWMDragView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhengwenming","download_url":"https://codeload.github.com/zhengwenming/WMDragView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224369822,"owners_count":17299961,"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":[],"created_at":"2024-08-02T18:00:49.773Z","updated_at":"2025-05-03T17:32:41.587Z","avatar_url":"https://github.com/zhengwenming.png","language":"Objective-C","funding_links":[],"categories":["UI Components","Objective-C","Other"],"sub_categories":["General Purpose Libraries"],"readme":"# WMDragView\nWMDragView致力于让任意View都可以自由移动、悬浮、拖动、拖曳。WMDragView是可以自由拖曳的view，可以悬浮移动，也可以设置内部的图片，轻量级的控件。\n\n## 功能\n- [x] 可设置拖动的范围rect\n- [x] 可获得拖曳回调和点击回调\n- [x] 可选择是否有黏贴边缘的动画效果\n- [x] 可设置网络图片\n- [x] 支持自定义view\n\n## 注意,添加到window上的全局dragView不建议使用masonry添加约束，否则会在新的其他VC加载的时候，dragView被复位到初始化位置\n\ndemo效果图：\n---\n![image](https://github.com/zhengwenming/WMDragView/blob/master/WMDragView/WMDragView.gif)  应用场景1：![image](https://github.com/zhengwenming/WMDragView/blob/master/WMDragView/WMPlayer.gif) 应用场景2：![image](https://github.com/zhengwenming/WMDragView/blob/master/WMDragView/douyu.gif) \n\n\n\n#WMDragView：用法和API\n\n1、把需要拖曳view的父类从原本继承UIView，改成继承WMDragView就OK了。\n\n2、dragEnable=YES，可拖曳\n\n   dragEnable=NO，不可拖曳\n   \n3、freeRect可以任意设置活动范围，默认为活动范围为父视图大小frame，\n\n4、回调block\n\n\t点击的回调\t\tclickDragViewBlock\n\t\n\t开始拖动的回调\t\tbeginDragBlock\n\t\n\t拖动中回调\t\tduringDragBlock\n\t\n\t结束拖动的回调 \tendDragBlock\n\t\n5、isKeepBounds是不是又自动黏贴边界效果\n\n isKeepBounds = YES，自动黏贴边界，而且是最近的边界\n isKeepBounds = NO， 不会黏贴在边界，它是free(自由)状态，跟随手指到任意位置，但是也不可以拖出规定的范围\n\n6、可以设置网络图片\n\n7、可以自定义view加到dragView中，比如一个视频，一个自定义按钮等等。\n\n\n\n欢迎加入微信开发技术支持群，18824905363，备注：iOS或者前端\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengwenming%2FWMDragView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhengwenming%2FWMDragView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengwenming%2FWMDragView/lists"}