Skip to content

Commit

Permalink
Fix compilation for visionOS (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanot authored Dec 3, 2023
1 parent 825e0f1 commit bf6f133
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

- Parameters:
- `shape`: The shape to use for the effect.
- `style`: The style to use for the effect.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Pow/Effects/SmokeEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)!
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pow/Infrastructure/ViewRepresentable.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit bf6f133

Please sign in to comment.