EmergeTools / Pow

Delightful SwiftUI effects for your app
https://movingparts.io/pow
MIT License
3.64k stars 153 forks source link

macOS Support #18

Closed brianmichel closed 1 year ago

brianmichel commented 1 year ago

Pow seems really rad, but I'd really like to use it in some macOS applications! This is just an issue to start the discussion around this potentially rather large feature request.

robb commented 1 year ago

Hi Brian, there's macOS support in Pow for everything but the most recent SoundEffects, even if it's poorly advertised. Of you just add the package to a mac target – it should work™.

I realize the Package.swift doesn't specify but we support macOS 12.6 and up, will try to get that fixed and add an macOS target to the Example app.

Let me know if there's anything else I can help with in the meantime!

robb commented 1 year ago

Here's a quick first pass at a macOS version of the Pow Example app: https://github.com/movingparts-io/Pow-Examples/pull/2.

brianmichel commented 1 year ago

Thanks Robb, I’ll take a peak, please consider this issue closed for the time being!

On Mon, Jan 23, 2023 at 12:00 PM Robb Böhnke @.***> wrote:

Here's a quick first pass at a macOS version of the Pow Example app: movingparts-io/Pow-Examples#2 https://github.com/movingparts-io/Pow-Examples/pull/2.

— Reply to this email directly, view it on GitHub https://github.com/movingparts-io/Pow/issues/18#issuecomment-1400674818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPTL73PW7GRJ5CAORLWRDWT22LPANCNFSM6AAAAAAUCPE6Z4 . You are receiving this because you authored the thread.Message ID: @.***>

robb commented 1 year ago

Cool, feel free to reopen if you have any questions!

robb commented 1 year ago

See #20

mergesort commented 1 year ago

I figured it would be better to add to this issue rather than create a new issue. I was wondering if it makes more sense in a cross-platform codebase to make code like this no-op rather than throwing an error, Type 'AnyChangeEffect' has no member 'feedbackHapticSelection'.

.changeEffect(.feedbackHapticSelection, value: self.isShuffling, isEnabled: self.isShuffling)

I'm porting an over to the Mac and while it's possible for me to add conditional compilation flags to solve this, there are a lot of call-sites (as I love Pow) and I figured it might be worth asking if the better approach was to have the API work but just not do anything on the Mac.

robb commented 1 year ago

Yeah, good call – I have done similar things for navigationBarTitleDisplayMode.