Swift
Swift is a programming language created by Apple and it’s the recommended way to develop apps for Apple devices. I’ve used it to write a couple of small tools for my personal use.
1 article
Creating a Safari webarchive from the command line
We can use the
createWebArchiveDatamethod onWKWebViewto write a Swift script that creates Safari webarchive files.
4 notes
How to get a macOS file/folder icon in Swift
Use
NSWorkspace.shared.iconto get the icon as anNSImage, then you can save it to disk or do something else with it.How to check the quality of a network connection
Using an
NWPathMonitorand inspecting the value ofNWPath.status,NWPath.isExpensiveandNWPath.isConstrainedcan tell you what sort of connection you’re running on.Writing a file in Swift, but only if it doesn’t already exist
Adding
.withoutOverwritingto yourwrite()call will prevent you from overwriting a file that already exists.How to profile Swift code