{"id":2328,"url":"https://github.com/fastred/AHKBendableView","last_synced_at":"2025-08-02T23:33:08.489Z","repository":{"id":46647942,"uuid":"21310999","full_name":"fastred/AHKBendableView","owner":"fastred","description":"UIView subclass that bends its edges when its position changes.","archived":false,"fork":false,"pushed_at":"2021-10-01T19:04:33.000Z","size":200,"stargazers_count":595,"open_issues_count":1,"forks_count":33,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-30T23:18:13.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://holko.pl/2014/06/28/action-sheet-follow-up/","language":"Swift","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/fastred.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":"2014-06-28T21:03:33.000Z","updated_at":"2024-06-20T00:47:35.000Z","dependencies_parsed_at":"2022-09-13T22:24:00.548Z","dependency_job_id":null,"html_url":"https://github.com/fastred/AHKBendableView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FAHKBendableView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FAHKBendableView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FAHKBendableView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FAHKBendableView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastred","download_url":"https://codeload.github.com/fastred/AHKBendableView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503188,"owners_count":17930531,"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-01-05T20:16:10.993Z","updated_at":"2024-12-06T17:31:00.900Z","avatar_url":"https://github.com/fastred.png","language":"Swift","funding_links":[],"categories":["UI","Animation"],"sub_categories":["Animation","Other free courses"],"readme":"# AHKBendableView\n\n[![CocoaPods](https://img.shields.io/cocoapods/v/AHKBendableView.svg?style=flat)](https://github.com/fastred/AHKBendableView)\n\n`BendableView` is a `UIView` subclass that bends its edges when its position change is animated. Internally, `BendableView` contains `CAShapeLayer`, which acts as its background. The layer's `path` changes during animations, creating an effect of bending. Subviews stay intact. You can find a more extensive description on my blog: [Recreating Skype's Action Sheet Animation](http://holko.pl/2014/06/26/recreating-skypes-action-sheet-animation/) and [Follow-Up Post](http://holko.pl/2014/06/28/action-sheet-follow-up/). \n\n![Demo GIF](https://raw.githubusercontent.com/fastred/AHKBendableView/master/demo.gif)\n\n## Usage\n\n`BendableView` contains three public properties:\n\n```swift\nvar damping: CGFloat // set to animate the view's edges differently than the whole view (used in an internal spring animation)\nvar initialSpringVelocity: CGFloat // same as above\nvar fillColor: UIColor // \"background\" color of the bendable layer\n```\n\nYou should set them before animating the position change of the view. I propose to use slightly lower values for `damping` and `initialSpringVelocity` than the values used when calling `+animateWithDuration:delay:usingSpringWithDamping:\ninitialSpringVelocity:options:animations:completion:`, just like in this example:\n\n```swift\nlet bv = BendableView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\nview.addSubview(bv)\n\n// bending setup\nbv.fillColor = UIColor.redColor()\nbv.damping = 0.7\nbv.initialSpringVelocity = 0.8\n\nUIView.animateWithDuration(0.5, delay: 0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.9, options: .BeginFromCurrentState | .AllowUserInteraction, animations: {\n        bv.frame.origin = CGPoint(x: 200, y: 300)\n        bv.frame.size = CGSize(width: 150, height: 150)\n    }, completion: nil)\n```\n\nHave fun!\n\n## Example project\n\nTo run the example project, clone the repo, and open `Example/AHKBendableView.xcodeproj`.\n\n## Requirements\n\n- iOS 7.0\n- ARC\n\n## Installation\n\nAHKBendableView is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n    pod \"AHKBendableView\"\n\n## Author\n\nArkadiusz Holko:\n\n* [Blog](http://holko.pl/)\n* [@arekholko on Twitter](https://twitter.com/arekholko)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastred%2FAHKBendableView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastred%2FAHKBendableView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastred%2FAHKBendableView/lists"}