Skip to content

Commit

Permalink
Merge branch 'EmergeTools:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mergesort authored May 23, 2024
2 parents a9603b2 + f0d0f3e commit 4787ea8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let package = Package(
platforms: [
.iOS(.v15),
.macOS(.v12),
.macCatalyst(.v15)
.macCatalyst(.v15),
.tvOS(.v15)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static func shine(angle: Angle, duration: Double = 1.0) -> AnyChangeEffect

Triggers a sound effect as feedback whenever a value changes.

This effect will not interrupt or duck any other audio that may currently playing. It may also not triggered based on the setting of the user's silent switch or playback device.
This effect will not interrupt or duck any other audio that may be currently playing. This effect is not guaranteed to be triggered; the effect running depends on the user's silent switch position and the current playback device.

To relay important information to the user, you should always accompany audio effects with visual cues.

Expand Down
6 changes: 3 additions & 3 deletions Sources/Pow/Effects/SmokeEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private struct SmokeEffect: ViewModifier, Continuous {
GeometryReader { proxy in
ZStack {
ForEach(Array(particles.enumerated()), id: \.element) { (offset, particle) in
#if os(iOS) || os(visionOS)
#if os(iOS) || os(visionOS) || os(tvOS)
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 @@ -70,7 +70,7 @@ private struct SmokeEffect: ViewModifier, Continuous {
}
}

#if os(iOS) || os(visionOS)
#if os(iOS) || os(visionOS) || os(tvOS)
private class EmitterView: UIView {
override class var layerClass : AnyClass {
return CAEmitterLayer.self
Expand Down Expand Up @@ -172,7 +172,7 @@ private struct SmokeLayerView: ViewRepresentable {
}
}

#if DEBUG
#if DEBUG && !os(tvOS)
struct ContinuousParticleEffect_Previews: PreviewProvider {
private struct Preview: View {
@State
Expand Down
1 change: 1 addition & 0 deletions Sources/Pow/Extensions/Duration+TimeInterval.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Foundation

@available(iOS 16.0, *)
@available(macOS 13.0, *)
@available(tvOS 16.0, *)
internal extension Duration {
var timeInterval: TimeInterval {
TimeInterval(components.seconds) + TimeInterval(components.attoseconds) / 1e18
Expand Down
2 changes: 2 additions & 0 deletions Sources/Pow/Infrastructure/AngleControl.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !os(tvOS)
import SwiftUI

struct AngleControl<Label: View>: View {
Expand Down Expand Up @@ -132,3 +133,4 @@ struct AngleControl_Previews: PreviewProvider {
.padding()
}
}
#endif
1 change: 1 addition & 0 deletions Sources/Pow/Infrastructure/WhileEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public struct AnyConditionalEffect {
/// - interval: The duration between each change effect.
@available(iOS 16.0, *)
@available(macOS 13.0, *)
@available(tvOS 16.0, *)
public static func `repeat`(_ effect: AnyChangeEffect, every interval: Duration) -> AnyConditionalEffect {
AnyConditionalEffect(guts: .repeating(effect, interval.timeInterval))
}
Expand Down

0 comments on commit 4787ea8

Please sign in to comment.