Skip to content

About

3D tilt with a dynamic shadow, like widget previews in iOS. UIKit and SwiftUI.

Topics

Resources

Stars

344 stars

Watchers

8 watching

Forks

Latest commit

 

History

139 Commits

Folders and files

Repository files navigation

PerspectiveKit

3D tilt with a dynamic shadow, like widget previews in iOS. SwiftUI & UIKit.

Installation

In Xcode: File → Add Package Dependencies → paste URL:

https://github.com/sparrowcode/PerspectiveKit

Usage

SwiftUI

WidgetPreview()
    .perspective(.widgetAnimatable)

UIKit

let perspectiveView = PerspectiveView(config: .widgetAnimatable)
perspectiveView.contentView.addSubview(widgetPreview)

Config

.widgetStatic tilts without animation. Every value is configurable:

var config = PerspectiveConfig.widgetAnimatable
config.angle = 14
config.corner = .topLeft
config.animation = PerspectiveAnimation(duration: 10, direction: .counterclockwise)
config.shadow?.opacity = 0.4

About

3D tilt with a dynamic shadow, like widget previews in iOS. UIKit and SwiftUI.

Topics

Resources

Stars

344 stars

Watchers

8 watching

Forks

Releases

Contributors

Languages