mirror of
https://github.com/EmergeTools/Pow.git
synced 2026-03-25 08:55:50 +00:00
Fix compilation for visionOS (#44)
This commit is contained in:
parent
825e0f112a
commit
bf6f133381
3 changed files with 5 additions and 4 deletions
|
|
@ -41,6 +41,7 @@ If you still have a question, enhancement, or a way to improve Pow, this project
|
||||||
- iOS 15.0+
|
- iOS 15.0+
|
||||||
- macOS 12.0
|
- macOS 12.0
|
||||||
- Mac Catalyst 15.0+
|
- Mac Catalyst 15.0+
|
||||||
|
- visionOS beta 6 (requires Xcode 15.1 beta 3)
|
||||||
|
|
||||||
## Change Effects
|
## Change Effects
|
||||||
|
|
||||||
|
|
@ -136,7 +137,7 @@ The shape will be colored by the current tint style.
|
||||||
```
|
```
|
||||||
|
|
||||||
An effect that adds one or more shapes that slowly grow and fade-out behind the view.
|
An effect that adds one or more shapes that slowly grow and fade-out behind the view.
|
||||||
|
|
||||||
- Parameters:
|
- Parameters:
|
||||||
- `shape`: The shape to use for the effect.
|
- `shape`: The shape to use for the effect.
|
||||||
- `style`: The style to use for the effect.
|
- `style`: The style to use for the effect.
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ private struct SmokeEffect: ViewModifier, Continuous {
|
||||||
GeometryReader { proxy in
|
GeometryReader { proxy in
|
||||||
ZStack {
|
ZStack {
|
||||||
ForEach(Array(particles.enumerated()), id: \.element) { (offset, particle) in
|
ForEach(Array(particles.enumerated()), id: \.element) { (offset, particle) in
|
||||||
#if os(iOS)
|
#if os(iOS) || os(visionOS)
|
||||||
let image = UIImage(named: particle, in: .module, with: nil)!.cgImage!
|
let image = UIImage(named: particle, in: .module, with: nil)!.cgImage!
|
||||||
#elseif os(macOS)
|
#elseif os(macOS)
|
||||||
let image = Bundle.module.image(forResource: particle)!.cgImage(forProposedRect: nil, context: nil, hints: nil)!
|
let image = Bundle.module.image(forResource: particle)!.cgImage(forProposedRect: nil, context: nil, hints: nil)!
|
||||||
|
|
@ -67,7 +67,7 @@ private struct SmokeEffect: ViewModifier, Continuous {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS) || os(visionOS)
|
||||||
private class EmitterView: UIView {
|
private class EmitterView: UIView {
|
||||||
override class var layerClass : AnyClass {
|
override class var layerClass : AnyClass {
|
||||||
return CAEmitterLayer.self
|
return CAEmitterLayer.self
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
#if os(iOS) || os(tvOS)
|
#if os(iOS) || os(tvOS) || os(visionOS)
|
||||||
protocol ViewRepresentable: UIViewRepresentable {
|
protocol ViewRepresentable: UIViewRepresentable {
|
||||||
associatedtype ViewType = UIViewType
|
associatedtype ViewType = UIViewType
|
||||||
func makeView(context: Context) -> ViewType
|
func makeView(context: Context) -> ViewType
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue