RobW, (edited ) Using MusicKit how can I get a tracks release year?
As far as I can tell releaseDate is always nil, do I need to make a further request to populate this property?
A track always contains a releaseYear property so far as I can tell, but this is not exposed, as in I can't domyTrack.releaseYear
This is for a personal project, so I don't mind a hacky solution if that's what it takes.
#swift #musickit
younata, I tested the advice that marking classes in #swift as final improves build times. I generated 2 swift files that each have 1000 (trivial) classes: one with each marked as final, the other without. I built each file 10 times, recording the build time for that file.
Marking classes as final does improve build times. By about 7%. The difference is just outside 1 standard deviation, so I think it’s statistically significant. But I’m not a trained statistician.
I used Xcode 15.2/swift 5.9 for this.
davidbures, OH MY GOD I CAN'T BELIEVE I FINALLY FIGURED IT OUT!! The next Cork release will be fucking EPIC
(Cork now supports packages that require sudo during install/uninstall)
#swift #swiftUI #macOS #opensource #buildinpublic #macdev #homebrew #CorkApp
A demo showing new support for packages requiring sudo in Cork
jonathantrott, @davidbures Seems to have got stuck afterwards though....
davidbures, @jonathantrott That strange, did you try any other package? I know the zulu JDKs and Microsoft teams also require sudo
davidbures, What, in your opinion, is the worst page in Apple's developer docs?
For me, it's LocalizedError:
https://developer.apple.com/documentation/foundation/localizederrorIt's not completely empty, but it has absolutely no useful info, which makes it even worse than if it was completely empty.
swiftly, @davidbures this one is not THE worst, but it’s pretty poor https://developer.apple.com/documentation/coreaudio
davidbures, @swiftly Oh yeah, I can see why
thatvirtualboy, App Review rejected my macOS menu bar app, Done, because the “app menu is missing the required Quit option.“
However, the app allows a quit operation by right clicking the menu bar app icon and choosing quit. Do menu bar apps usually support other methods to quit? Is it possible they didn’t try this?
JTostitos, @thatvirtualboy annoying, but probably just explaining and including that screenshot will solve it. Unless they wanted you to upload a new binary… 🫠
thatvirtualboy, @JTostitos Hopefully that’s all it’ll take! If so, we could be seeing Done on the App Store reeaaaaaaal soon
Krupp, If you are looking for a weather app that is simple and does not track your location, try Ducky Weather! One thing I have found in our research group is that the most popular free weather applications send your location to trackers and I wanted to create an app that does not do that. Because it uses NWS data, it is only available in the US.
More features to come but suggestions are welcome!
https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=6474254666
finestructure,
finestructure, The main obstacle to make this happen was to trick myself into buying a Windows machine by rekindling my love for video games via a very delightful detour called the #GamePortingToolkit.
dandylyons, @finestructure Sounds like the game porting toolkit accidentally ported you to Windows.
nicoreese, If I want to use String(localized:) to localize a variable, is this the best way? I can’t put it in directly like I used to with NSLocalizedString. In this case, the variable comes from Core Data, otherwise I could probably declare it directly as LocalizedStringResource. #Swift #SwiftUI #UIKit #Localization
MuseumShuffle, @nicoreese would this approach help?
ktoso, Want to with me and the rest of the language team to make #swift the hottest thing since sliced bread? New job posting is up: https://jobs.apple.com/en-us/details/200553215/swift-compiler-engineer
Sadly remote is not an option, California only.
Feel free to DM me with questions.
davidbures, Update on Cork Shortcuts support:
I have added a shortcut for refreshing packages. Next step, I'll see if I can add a separate button to Cork itself for only refreshing packages without updating them!
(also, does anyone know why Shortcuts is showing the key for each LocalizedStringResource instead of the actual string? 🤔 see pic #2 for code)
#swift #swiftUI #macOS #opensource #buildinpublic #macdev #homebrew #CorkApp
mattiem, @davidbures I’d try it outside of the AppIntent context to try to eliminate some variables. I’ve never used that type anywhere else.
davidbures, @mattiem Using it outside the intent works fine 😅 I'll give it a day or two, maybe it will start working on its own
finestructure, “With the increased limit of the acceptance queue, and a patched version of wrk, we can now conclude that swift is a good competitor speed-wise as a web application server.
Memory wise it blows all the other technologies away, using only 2.5% of the amount of memory that the java implementation needs, and 10% of node-js.”
opticalaberration, @finestructure always seemed to me to be a weird benchmark where the endpoint has a heavy CPU load. Not very typical of a standard server. Some interesting discussion though. Not sure the decision to accept more connections when server is overloaded is very clever though.
finestructure, @opticalaberration Yeah, the Swift forums thread goes into that in detail and was very interesting.
davidbures, I'm not promising anything for the next version of Cork just yet, but I'm trying to cook here…
#swift #swiftUI #macOS #opensource #buildinpublic #macdev #homebrew #CorkApp
kiwix, French A talented #swift developer to implement the (WiFi) HTTP Server for Kiwix iOS/macOS? All the HTTP daemon part exists already and the feature already exists on #Android, #Linux and #Windows so this can be taken as example for the UI. https://github.com/kiwix/kiwix-apple/issues/170
JTostitos, Swift/SwiftUI Question: App Store Connect API provides a gzip when the response is successful for a particular endpoint I am accessing.
How do I take this gzip and save the contents of it to a files app / sandbox directory / swift data, so that I can read it and view the contents? From what I understand, gzip is similar to a zip file?
So far my attempts to save it to files to read the contents have failed. It says “Inappropriate file type or format”.
mattiem, @JTostitos You would definitely uncompress it. But after that, it is whatever type it is. If the data actually is CSV then yes.
JTostitos, @mattiem Awesome thanks! It worked.
davidbures, How would you go about implementing a popup search menu like this? :think_bread:
Suppose I have a NSSearchField and want to make such popup menu to let the user choose some details about their search - for example, if they want to search by a package's name or description.
Or would there be a more appropriate, and completely different, solution? What do you think?
Bryan, @davidbures
Look for autocomplete coding examples like this?https://iosexample.com/autocomplete-for-a-text-field-in-swiftui-using-async-await/
davidbures, @Bryan The main problem is showing that menu with the options. I'm not sure how to do that in SwiftUI, but there might be a way in AppKit that I'm not aware of since I'm using NSSearchField
CorkApp, Cork version 1.4 is out.
This update includes way too many things to list here, so head over to the blow and read about them!
#swift #swiftUI #macOS #opensource #buildinpublic #macdev #homebrew #CorkApp
QuietMisdreavus, okay so i'm legit proud of this work
so i've been working on combining overloaded methods into a single “overload group" in curation and navigation. the work is currently landed on main and release/6.0, but right now it will just list all the overloaded symbol declarations on the page without showing you what's actually distinct between them
pixel, I didn’t know about this Swift feature. nice.
#Swift #Programming #iOS #macOS #visionOS
https://paul-samuels.com/blog/2023/09/29/swift-parameter-packs/
davidbures, It will be my birthday soon on June 1st, and to celebrate, I’ll be offering a super special discount on Cork! 🎉
Starting on June 1st until June 8th, Cork will be discounted 60 percent! Yes, SIXTY, the largest discount ever.
I’ll be sharing the discount code later, so be sure to keep an eye on my profile or @CorkApp (or even follow me if you want to, I’d really appreciate that!)
#swift #swiftui #BuildInPublic #homebrew #CorkApp #apps #indieappsales #macos
dhanish,
davidbures,
jonathantrott, @davidbures Seems to be working ok?
davidbures, @jonathantrott Amazing, thanks a lot for testing it 👏
natpanferova, I was invited to Vincent Pradeille's YouTube channel to share some advanced Swift tips and insights from my new book "Swift Gems" 📘✨ The video is now live, check it out: https://www.youtube.com/watch?v=557nJYhPb7Y
davidbures, Swift experts, I'm in need of assistance again
I have this code: https://gist.github.com/buresdv/aa1fa04f8d0c6bcd42cef1a361d7e0a1
It checks if a specified URL is a symlink, which works fine. But I'm having problems actually resolving the symlink using
resolvingSymlinksInPath()
In the testing part at the bottom, I'm getting this:
Resolved symlink result: file:///Users/david/Developer/Testing/folderThatIsSymlink | expected /Users/david/Developer/Testing/folderThatIsSymlinkTarget
Why is the resolved symlink wrong?
cocoaphony, @davidbures I can't reproduce this. Posted some comments. How did you setup the directories and links?
davidbures, @cocoaphony You're right, it was an error in the way I set up the links :nkoFacepalm2: It works as expected now, thank you 🙃
ctietze, Are there any #Swift API design best practices about error handling?
So far, I sketched everything with
Result<Value,Error>
so I get typed errors.But both stack unwinding and the lack of ceremony of
throws
is appealing, too. API consumers probably don't need fine grained detail which of the 20 error cases occurred.
mattiem, @ctietze I think in practice, there are very few reasons why callers should care about error types. The binary worked/failed is so applicable to so many situations, and I think you have to have a very compelling reason to not use it.
icanzilb, @ctietze yes, I get it - type checking this way is handy 👍🏼
mstankiewicz, Polish
parpok, Polish @mstankiewicz rel
parpok, Polish @mstankiewicz dodać jeszcze legendarne Suzuki Swift