MagicKit is a lightweight and easy-to-use framework for adding stunning transition effects to your SwiftUI views.
With MagicKit, you can create beautiful and dynamic user interfaces that will captivate your users and enhance their experience.
- Easy to use
- Multiple built-in transitions to choose from
- Fully customizable transitions
- Lightweight and optimized for performance
- iOS 14+
- Xcode 12+
- Swift 5.7+
You can install MagicKit using Swift Package Manager. To integrate MagicKit into your Xcode project, follow these steps:
- Open your project in Xcode.
- Click on
File
>Swift Packages
>Add Package Dependency...
- Paste the following URL in the search bar:
https://github.com/mrcreatoor/MagicKit
- Click
Next
and select the version you want to use. - Click
Finish
.
Using MagicKit is easy. Simply apply the magic modifier to your SwiftUI view and specify the transition effect, duration, and show parameter:
import MagicKit
struct ContentView: View {
@State var isShowing = false
var body: some View {
GeometryReader { proxy in
LinearGradient(gradient: Gradient(colors: [.orange, .pink]),
startPoint: .topLeading,
endPoint: .bottomTrailing)
.onTapGesture {
isShowing = true
}
.magic(transition: .pageCurl(inverted: isShowing), duration: 1, show: $isShowing) {
LinearGradient(gradient: Gradient(colors: [.purple, .blue]),
startPoint: .topLeading,
endPoint: .bottomTrailing)
.onTapGesture {
isShowing = false
}
}
}
}
}
To try out the MagicKit example:
- Clone the repo
https://github.com/mrcreatoor/MagicKit.git
- Open
Example/Example.xcodeproj
in the Xcode - Run it!
For more detailed information on how to use MagicKit in your projects, check out our documentation.
You can also download the documentation to your local machine as a DocC archive by clicking on this link. Once downloaded, you can import it into Xcode.
To import the documentation into Xcode, follow these steps:
- Double click on the
MagicKit.doccarchive
file to import it into Xcode. - Once imported, you can access the documentation from the
Help
>Developer Documentation
menu in Xcode.
MagicKit is available under the MIT license. See the LICENCE file for more information.
This framework makes use of the amazing GL-Transitions library, which provides a collection of beautiful and highly customizable transitions. The library is created and maintained by contributors.
We would like to thank the GL-Transitions team for their hard work and dedication in creating such a wonderful library and making it available to the community. We highly recommend checking out the original library and showing your support by giving it a star on GitHub.