Comments (9)
Hey @jverkoey, thanks a lot for the PR π Very much appreciated :)
I was just yesterday thinking about it after I restructured the files more logically into those separate folders. In the end I didn't go into that direction for these thoughts I had:
- Given the small overall size, I subjectively felt the actual benefit would likely be dubious at best
- I wasn't sure what one would gain in terms of reduced size footprint if one only needed one target but assumed it would be minimal
- It would be "more complicated" to use for most people, as most would at least need "Core" and either "SwiftUI" or "UIKit" targets
- The added build time for now needing two targets probably outweighs the organizational benefit
- For most people now needing two targets, they'd probably increase their final binary size
Those are mostly gut feeling based thoughts / conclusions, so I'd generally be open to being swayed into that direction after all. I'd need to better understand the exact benefits of going this direction vs keeping it as is in a more "founded" pro vs con comparison though.
Please feel free to share your thoughts on the reasons here.
from dswaveformimage.
Ah wait, or are we talking slightly different things? You actually mean creating two separate macOS / iOS targets?
If that's the case: doesn't the current target actually work already for macOS? Or does it not, because it's "Catalyst only"? Tbh I haven't done any macOS development myself yet, so I'm a little unfamiliar here. But if there's issues with macOS I'll be more than happy to make the library work better for all platforms.
from dswaveformimage.
You actually mean creating two separate macOS / iOS targets?
Yep! I'm working on a macCatalyst app, but (prepare for semi-long story π ) I'm placing the waveform visualizers in the toolbar and, unfortunately, catalyst toolbars don't support custom views. Sooo I'm using a hack from @steventroughtonsmith (context: https://twitter.com/featherless/status/1569144875769303042) that allows you to bridge an AppKit framework into a Catalyst app so that you can build custom views. Unfortunately, this means they have to be written in AppKit! I could transport the rendered images over from the Catalyst portion of the app, but it was conceptually more immediately obvious to pass the URL over the framework bridge and let the player handle the async behaviors.
Now that I explain all of that though, I suppose I could just try rendering the image in the catalyst portion of the app and pass it over the framework bridge as a CGImageRef or something π .
Alas, I already got it working by forking your code and updating all of the UI- prefixes to NS-prefixes and one small logical change in the image rendering :)
Happy to propose a pull request if supporting AppKit is something you'd be open to doing!
from dswaveformimage.
Great track in the image btw π
So yeah, I've just started playing around with macOS and realized a few culprits around shared classes around UIColor, UIScreen etc. Now that I understand what the issue is, I definitely think it would be sensible to either have a dedicated macOS target OR just have the one target work on both platforms via preprocessor directives etc.
Not sure what would be best tbh, but I think I'm leaning towards your splitting suggestion and adding a new DSWaveformImage-macOS
framework target which contains the core classes (those would use compiler directives to swap out UI* for NS* classes) and the SwiftUI views.
I think I have some energy at the moment to do get this done relatively soon, possibly even today already. Given there are no unforeseen issues that I don't know about yet.
What are those logical changes in the image rendering about you're referring to? Is this just something that you need custom for your app or is this also platform related? If it's the former, I'd be curious to see if this could be achieved by making the library more flexible to be extensible without the need of forking.
from dswaveformimage.
Let me push up a very rough PR with the deltas so you can see! Inbound...
from dswaveformimage.
from dswaveformimage.
^ Pull request. Note I took the straightest path to getting things building π I'd be happy to clean it up and get it good for merging if you like the direction it's going.
from dswaveformimage.
Great track in the image btw π
πΊπ
from dswaveformimage.
I'll consider this closed now, as #44 has just been merged and v11.0.0 been released.
from dswaveformimage.
Related Issues (20)
- Wavefrom form Data in SwiftUI HOT 7
- WaveformLiveView for Local Path HOT 13
- There's many different ways this could be achieved. HOT 3
- Fatal error HOT 3
- Current amplitude HOT 1
- Empty audio not displayed even with Should Draw Silence HOT 6
- Compile error in Xcode 15 beta. HOT 2
- Missing Pause Functionality HOT 1
- -11800 Error code when generation samples on iOS 17 beta HOT 10
- mp3 File not support HOT 8
- xcode 15 not support. Stored properties cannot be marked unavailable with '@available' HOT 1
- Striped style with gradient HOT 2
- Stored properties cannot be marked unavailable with '@available' HOT 3
- Stored properties cannot be marked unavailable with '@available' HOT 1
- Thread 1: EXC_BAD_ACCESS (code=2, address=0x2829857c4) HOT 1
- WaveForm Flickering HOT 2
- Extra argument position in call error in MacOS HOT 1
- I need to show loader till complete image generating from audio URL. HOT 2
- Update version in cocoapod HOT 2
- crash in iOS 17 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dswaveformimage.