-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.2.0 #15
0.2.0 #15
Conversation
I noticed there's a usability difference between code I have and the code that your variant of try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: [.mixWithOthers])
try AVAudioSession.sharedInstance().setActive(true) This may not always be the right option so the current way the framework chooses to play a sound is likely a sensible default to provide, but it is something I'd like to have control over. If it helps the way I'm currently checking the audio source and the user's preference before setting the audio category like this, and then based on a preference deciding whether to play it (or in Pow parlance to set var audioSourceIsHeadphones: Bool {
AVAudioSession.sharedInstance()
.currentRoute
.outputs
.map(\.portType)
.contains(where: { $0 == .headphones || $0 == .bluetoothA2DP })
}
var audioSourceIsSpeakers: Bool {
AVAudioSession.sharedInstance()
.currentRoute
.outputs
.map(\.portType)
.contains(where: { $0 == .builtInSpeaker })
}
var audioSourceIsOutputDevice: Bool {
return self.audioSourceIsHeadphones || self.audioSourceIsSpeakers
} |
Thanks for testing this out. Yeah I agree, this would be good have some control over. I think we can add an option to let you set the |
Sounds great, thanks a lot! I also realized in my earlier message that I said the current version could be a sensible default, but after giving it some more thought I realized that this |
Great to hear! And I also think defaulting to |
Ok, after looking into this we decided on our approach for
Part of this is motivated by the internal use of This also gives us the most option to integrate with an @mergesort: let me know if this makes sense to you, we're happy to revisit this in the future if this compromise proves too simplistic. Also, do you happen to know if problems like these are why refreshing the main feed in the twitter app sometimes pauses audio playback? 😬 Footnotes
|
New in 0.2.0
sound
change effect.particleLayer(name:)
view modifier..glare
and.vanish
now display with increased brightness.delay(_:)
modifier to change effects.Haptics
In addition to notification haptics, you can now trigger also selection and impact haptics.
Sound Effects
This version of Pow introduces Sound Effects.
Play sound effects using the
.feedback(_:)
change effect.The sounds are looked up in the main
Bundle
by default. Common audio formats likeaiff
,wav
,caf
, andm4a
are found automatically but you can also use other formats by specifying the type and if supported by the OS.A set of sounds can be found in the Pow Example repo and are free to use with any licensed copy of Pow.
Our thanks to @mergesort for the feature requests to add more haptic feedback types and sound change effects 🙇
Particle Layer
Particle effects such as
AnyChangeEffect.spray
can now render their particles in a different position in the view tree to avoid being clipped by their immediate ancestor.For example, certain
List
styles may clip their rows. UseparticleLayer(_:)
to render particles on top of the entireList
or even its enclosingNavigationStack
.Brighter
.glare
&.vanish
.glare
and.vanish
transitions now display with increased brightness giving a bit more punch to the effect. And for.glare
it makes the shine show even on white backgrounds.Delay
You can now add a delay to change effects to change the timing of the change effects. This works well with the
.shine
effect for example where you might want the shine highlight to show some time after the button becomes enabled.If you're interested in using Pow in your app, you can purchase a license on our site. ✨
Thank you for your support!