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+
|
||||
- macOS 12.0
|
||||
- Mac Catalyst 15.0+
|
||||
- visionOS beta 6 (requires Xcode 15.1 beta 3)
|
||||
|
||||
## Change Effects
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ private struct SmokeEffect: ViewModifier, Continuous {
|
|||
GeometryReader { proxy in
|
||||
ZStack {
|
||||
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!
|
||||
#elseif os(macOS)
|
||||
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 {
|
||||
override class var layerClass : AnyClass {
|
||||
return CAEmitterLayer.self
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import SwiftUI
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
#if os(iOS) || os(tvOS) || os(visionOS)
|
||||
protocol ViewRepresentable: UIViewRepresentable {
|
||||
associatedtype ViewType = UIViewType
|
||||
func makeView(context: Context) -> ViewType
|
||||
|
|
|
|||
Loading…
Reference in a new issue