Ohcirclesegue
Custom UIStoryBoardSegue with circular animation
Install / Use
/learn @oyvinddd/OhcirclesegueREADME
OHCircleSegue
Custom UIStoryBoardSegue with circular transition/animation

Installation
Manual
Drag the OHCircleSegue.swift class into you project and you're done.
Usage
-
- In your storyboard, create a segue between two view controllers
-
- 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)

-
- Repeat step 1 and 2 for the unwind segue
In this example, the performSegueWithIdentifier method is called from touchesBegan. To determine where on the screen animation should originate from, override the prepareForSegue function:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// sender object is an instance of UITouch in this case
let touch = sender as! UITouch
// Access the circleOrigin property and assign preferred CGPoint
(segue as! OHCircleSegue).circleOrigin = touch.locationInView(view)
}
UIButton example
Starting the transition from a UIButton (note that this will aslo work for other UIKit components as long as user interactions are enabled).
- Add a button the view controller you want to transition from and hook it up with an IBAction like shown below
@IBAction func buttonTapped(sender: AnyObject) {
// Call method to perform our OHCircleSegue, using our button as the sender
performSegueWithIdentifier("Segue", sender: sender)
}
- In the prepareForSegue method, unwrap the button and use it to determine the origin of our transition
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// No problem to force unwrap in this case, since we know sender is an instance of UIButton
let button = sender as! UIButton
// Set the circleOrigin property of the segue to the center of the button
(segue as! OHCircleSegue).circleOrigin = button.center
}
License
OHCircleSegue is available under the MIT license. See the LICENSE.md file for more info.
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
