{"id":18917785,"url":"https://github.com/oyvinddd/ohcirclesegue","last_synced_at":"2025-04-15T09:32:09.163Z","repository":{"id":62449304,"uuid":"49533459","full_name":"oyvinddd/ohcirclesegue","owner":"oyvinddd","description":"Custom UIStoryBoardSegue with circular animation","archived":false,"fork":false,"pushed_at":"2019-09-14T18:40:50.000Z","size":151,"stargazers_count":103,"open_issues_count":5,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T19:39:15.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/oyvinddd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-12T22:36:30.000Z","updated_at":"2023-01-22T18:53:36.000Z","dependencies_parsed_at":"2022-11-01T23:17:15.002Z","dependency_job_id":null,"html_url":"https://github.com/oyvinddd/ohcirclesegue","commit_stats":null,"previous_names":["oyvind-hauge/ohcirclesegue"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Fohcirclesegue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Fohcirclesegue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Fohcirclesegue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Fohcirclesegue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oyvinddd","download_url":"https://codeload.github.com/oyvinddd/ohcirclesegue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249042987,"owners_count":21203392,"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-11-08T10:28:08.926Z","updated_at":"2025-04-15T09:32:08.809Z","avatar_url":"https://github.com/oyvinddd.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OHCircleSegue\nCustom UIStoryBoardSegue with circular transition/animation\n\n![Demo](/Resources/segue_demo.gif)\n\n## Installation\n\n### Manual\nDrag the OHCircleSegue.swift class into you project and you're done.\n\n## Usage\n\n- 1. In your storyboard, create a segue between two view controllers\n- 2. Go to the attributes inspector for the newly created segue and set it up like shown below (note that 'Kind' can be set to anything)\n\n![Usage 1](/Resources/usage_1.png)\n\n- 3. Repeat step 1 and 2 for the unwind segue\n\nIn this example, the performSegueWithIdentifier method is called from touchesBegan. To determine where on the screen animation should originate from, override the prepareForSegue function:\n\n```swift\noverride func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {\n        \n    // sender object is an instance of UITouch in this case \n    let touch = sender as! UITouch\n        \n    // Access the circleOrigin property and assign preferred CGPoint\n    (segue as! OHCircleSegue).circleOrigin = touch.locationInView(view)\n}\n```\n\n### UIButton example\n\nStarting the transition from a UIButton (note that this will aslo work for other UIKit components as long as user interactions are enabled).\n\n1. Add a button the view controller you want to transition from and hook it up with an IBAction like shown below\n\n```swift\n@IBAction func buttonTapped(sender: AnyObject) {\n    \n    // Call method to perform our OHCircleSegue, using our button as the sender\n    performSegueWithIdentifier(\"Segue\", sender: sender)\n}\n```\n    \n2. In the prepareForSegue method, unwrap the button and use it to determine the origin of our transition\n    \n```swift\noverride func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {\n        \n    // No problem to force unwrap in this case, since we know sender is an instance of UIButton\n    let button = sender as! UIButton\n        \n    // Set the circleOrigin property of the segue to the center of the button\n    (segue as! OHCircleSegue).circleOrigin = button.center\n}\n```\n\n## License\n\nOHCircleSegue is available under the MIT license. See the LICENSE.md file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyvinddd%2Fohcirclesegue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foyvinddd%2Fohcirclesegue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyvinddd%2Fohcirclesegue/lists"}