Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thanks @krjw - much appreciated. CustomButton looks good but I can't see how I would turn it into a View to use with SwiftUI? Commented Oct 16, 2019 at 19:59
  • 1
    I'm also thinking that my bit o code in my question seems reasonable - would you agree this is effectively a bug? Commented Oct 16, 2019 at 20:00
  • To be honest I only have used SwiftUI on iOS and just tried your code on a new project to find out if it helps to apply the modifiers to the button itself... and I played around a little bit and thought this is not the correct behaviour. I would't say it's a bug because I don't know te expected behaviour, but for me it seems wrong at least Commented Oct 16, 2019 at 20:01
  • I also had been using Button in iOS and it worked fine. I was surprised that it didn't have the same or at least similar result on MacOS as part of the idea of SwiftUI is that you can move between platforms with the same code. Commented Oct 16, 2019 at 20:11
  • Do you know how I would get CustomButton to work with SwiftUI. I presume I need some sort of wrapper which conformed to View? Commented Oct 16, 2019 at 20:12