Category: Possibly useful
-
Using Swift’s map
In Day 39′s Moonshot tutorial app, Paul uses .map on an array without much comment about what’s going on. I assume this might be a common concept in modern languages, but it was new to me. First, here’s Paul’s code Mission here contains an array of crew which is a struct with two strings, one…
-
SwiftLint
I was watching a Tim Ruscica video about the things that highly effective developers do, and it called to mind a book I read years ago called Code Complete. It is the only book I ever owned that I immediately purchased the new edition when it came out. It was about the meta stuff around…
-
Testing, testing
I have unit testing in my list of goals, and if I’m going to throw this space trimming macOS utility up on the web, now might be a good time to figure out how to add unit tests to a project, how to write them, and how to run them. XCode is well set up…
-
Where’s My App?
The iOS apps I’ve been making, can only run in the simulator or on my tethered device (which I haven’t actually tried yet), but the MacOS app I made today, in theory could be zipped up and distributed to the world from my website. At the very least, I wanted to drop it into my…
-
Customizing the default About dialog for MacOS apps
The default Xcode MacOS targeted app has a built in “About” dialog called up from the “About <app name>” menu item in the Mac menu bar. It wasn’t immediately clear to me how to customise this, but after digging through some MacOS apps on GitHub, here’s the answer. When you app is being built, it…
-
Gitting Xcode to Push
I’m very comfortable with doing all the routine git stuff from the command line, but it was bugging me that I hadn’t for the Xcode integration working. I was able to commit locally with no problem from Xcode, but could not push up to Github. It works fine from the command line, so the error…
-
Protocols
The evolution of structs into class-like things that can hold properties and methods in Swift raised in my mind “what about inheritance?” – but no: structs in Swift can not use inheritance. Swift classes implement inheritance, but only from one class; there’s no multiple inheritance. Protocols neatly address both these concerns to a large extent,…
-
Simple MVVM
MVVM (Model-View-View Model) is an architectural pattern for apps that separates the data (Model) from the user interface (View). The communication between these two parts is facilitated by a View Model. Model <-> View Model <-> View Model The Model is platform independent – we should be able to pluck it out and add it…
-
Gitting the hang of it
I spent most of the day learning about, and practicing with git. I’ll list some of the resources at the bottom, but for the moment, this is my understandings / cheat sheet for git. Since this could conceivably turn up in someone’s google search, and slightly less conceivably be of some use, I will come…