<![CDATA[jsorge.net]]> https://jsorge.net https://jsorge.net/favicon.pngjsorge.nethttps://jsorge.net Maverick v0.7 Sun, 03 Jun 2018 21:19:23 GMT 60 <![CDATA[Meet Baseplate]]> https://jsorge.net/2024/12/20/introducing-baseplate LzIwMjQvMTIvMjAvaW50cm9kdWNpbmctYmFzZXBsYXRl Fri, 20 Dec 2024 18:01:45 UTC I have a new app: Baseplate, which helps you organize your LEGO collection! I love indie software. It's one of the things that I love about Apple's platforms. And being an indie is something that I've wanted to do for a long time (no this isn't a post where I say I'm quitting my job). So when a really cool opportunity crossed my path to acquire an exsiting app I decided to take the leap.

Meet Baseplate! It's a fun app for LEGO collectors to manage their collections. Over the past few years I've gotten pretty heavy into collecting and building and I've had a great time getting to know Baseplate. I hope you love it too. Check it out on the App Store!

Screenshot of Baseplate

Baseplate was originally developed by Shihab Mehboob and released earlier this year. I'm super impressed at how he was able to build the app so quickly – and for all of Apple's platforms (save tvOS). It's been a lot of fun to dig in to the app and learn from a developer who did the thing that I've constantly struggled with: shipping the app!

The whole process of taking the app over has reinvigorated me for my own apps. I have put Scorebook back on the store and am working on updates to it too. I was able to rebuild my Taphouse website using Tailwind CSS as well as the newer version of Vapor. I've sorted out some of the things that slow me down such as build and deployment processes and have attempted to take the friction out of building apps as much as I can.

I'm also going to try and market Baseplate better than before. I created a Mastodon profile for it and will be working on features to let users post about their collection super easily.

So go give the app a whirl. I hope you like it!

]]>
<![CDATA[SwiftData Suprises]]> https://jsorge.net/2023/06/30/swiftdata-surprises LzIwMjMvMDYvMzAvc3dpZnRkYXRhLXN1cnByaXNlcw== Sat, 01 Jul 2023 05:11:53 UTC I'm playing with SwiftData and got suprised by a couple of things. I've started working on a new app as a side project and because WWDC was just a few weeks ago decided to play with some of the new APIs introduced – namely SwiftData. Consider this class:

@Model
final class Company {
    var name: String

    @Relationship(inverse: \Person.company)
    var employees: [Employee] // `Employee` is also a class annotated with @Model
}

My surprises came when I started adding some tests around my new models. For somewhat contrived reasons, let's say that when a company gets created there is 1 employee.

func test_newCompany_hasEmployeeAttached() throws {
    let company = Company(name: "Great Co.")
    XCTAssertEqual(1, company.employees.count)
}

This test fails in 2 ways:

  1. I get a crash at the init on the first line because there is no configured container.
  2. I get a crash when accessing the array (which should have 1 auto-inserted value).

I fix the test by adding the container, and then inserting the company in to the container's context:

func test_newCompany_hasEmployeeAttached() throws {
    let context = // create the container

    let company = Company(name: "Great Co.")
    context.insert(company)

    XCTAssertEqual(1, company.employees.count)
}

What stands out to me is that it sure feels like SwiftData classes are your own classes. But they're not. They gain a conformance to PersistentModel and have all of their persisted properties rewritten with generated getters and setters. So yeah the class does not inherit from NSManagedObject but it's also not a class that is unencumbered from implicit behavior to be aware of.

I think this is teaching me that there are nuances to using SwiftData and macros in general.

]]>
<![CDATA[self.employer = Adobe()]]> https://jsorge.net/2022/03/04/adobe LzIwMjIvMDMvMDQvYWRvYmU= Fri, 04 Mar 2022 16:31:51 UTC I got a new job as an iOS engineer at Adobe! Just under 2 years ago, after being laid off from Lyft, I got to rejoin Zulily. During my time at Lyft I learned very much about the craft of app making. Especially at the lower levels. Build systems, tooling, app architecture. And while I was at Lyft I couldn't help but think over and over "if only I knew this when I was at Zulily...". So rejoining Zulily was a great opportunity to apply what I had learned from Lyft and help take Zulily's iOS app to the next level. Well, I've accomplished much of what I sought to do there.

Now there's a new journey ahead of me. Today is my last day at Zulily and on Monday I start a new one with Adobe.

A good friend of mine joined Adobe back in September and told me many times that I should apply. I took his advice and my first day is Monday. I'm super pumped that I'll be working a bunch in SwiftUI – I have much to learn! Everyone I spoke with during my interviews were fantastic. I asked everyone what they liked most about working at Adobe and they all said the people. That everyone is willing to lend a hand when it's needed. Egos are checked at the door and you work to help your coworkers ship something great. I'm so here for that kind of place.

I'll miss my colleagues at Zulily but I'm so pleased with how I've been able to help out that project over the past couple of years. I know I'm leaving it better than I found it, and that's not nothing.

Onwards to Adobe!

]]>
<![CDATA[Powered by Tailwind]]> https://jsorge.net/2021/09/03/powered-by-tailwind LzIwMjEvMDkvMDMvcG93ZXJlZC1ieS10YWlsd2luZA== Fri, 03 Sep 2021 21:34:40 UTC I got to play with Tailwind CSS this week, and updated my layout to use it. I've been able to take time off from my normal duties at Zulily and learn something new. That thing has been Tailwind CSS. I originally heard about it from Jordan Morgan's exploration of it from the perspective of an iOS developer and was intrigued. I'm not any CSS wizard by any stretch and Tailwind looked like a cool way to simplify what I've done before and maybe even make some things better.

The week went well over all! It took me what felt like a long time to get used to some of the core concepts like using all the utilities it gives me, but I'm happy with the outcome – even though the results don't look much different from the previous layout. Once I got my mind around using the configuration file, and then processing my input CSS into my final output things really started clicking. I could use my same fonts, and using the typography plugin I was able to easily just let the system lay out m text way better than I ever could by hand.

I'd be remiss too if I didn't mention the wonderful Tailwind UI templates that helped me along my way too. They are a really nice way to get started and piece together some super functional sites. I'm not using Vue or React so I had to do some adapting of the HTML templates (and if I need to, I'll have to write any JavaScript to interact with them by hand).

I also did a bit of refactoring of my leaf templates to simplify them a bit, wrote a couple of new command line utilities to help me make & publish new posts, and put in my first GitHub Action which will publish new posts as I commit them to the repository.

On the whole it's been a very productive week. My next task will be to upate my Taphouse using Tailwind as well – and I'll be making heavy use of those Tailwind UI components to get that done.

]]>
<![CDATA[Tenets of iOS Phased Releases]]> https://jsorge.net/2021/06/16/tenets-of-ios-phased-releases LzIwMjEvMDYvMTYvdGVuZXRzLW9mLWlvcy1waGFzZWQtcmVsZWFzZXM= Wed, 16 Jun 2021 17:23:35 UTC Things I've learned about phased releases on the iOS App Store. One of the more confusing aspects of releasing iOS apps on the App Store has to be phased releases. There is pretty sparse (and confusing at that) documentation which leaves much room for questions – which in turn lead to more questions still. My aim with this post is to help clarify some core tenets of this process and hopefully spare you and your team the confusion that has come to myself and my team.

Let's start by establishing some principles:

  1. Only one version of your app can be on the App Store at any given time.
  2. A phased release lets you slowly allow users to auto-update to a new version at a slow percentage.
  3. New users and manual updaters can always get your newest version from the App Store.

When you decide to phase a release (Apple Documentation), you're specifying the percentage of users who will be auto-updated to that release. The cadence is over 7 phases (1%, 2%, 5%, 10%, 20%, 50%, and 100%). Generally one phase equates to one day, but the release can be paused on a phase for up to 30 days. The happy path is making a release that gets phased without problem over 7 days and you're done.

Let's run through a scenario where things go on the not-so-happy path and see what happens.

Say we have an app and version 5.1 which is at 100%; new users and all updates will get this version. On Monday we release 5.2 using the phased release. This means that 1% of automatic updates will receive v5.2, but new downloads and manual updates can be performed to get 5.2 as well.

On Tuesday (phase 2, which is 2%) we identify an issue with 5.2 and decide to pause the rollout. This will stop the automatic updates from happening to 5.2 (but again, new users and manual updaters can get it). We identify a fix and submit it with version 5.2.1. That release also gets phased. So what happens now? We've had 5.1 available to everyone, 5.2 at a 2% automatic update, and now 5.2.1. Here's what happens:

  • 5.2 gets replaced on the App Store with 5.2.1: new users and manual updaters can only get to 5.2.1.
  • 5.2 also completes its phasing, but no additional users can get to it (see principle #1 above).
  • 5.2.1 begins a new phase – it does not replace the phasing of 5.2 that we had in place already – and it is at 1% at release.
  • There will be some subset of users on version 5.2 who will not be auto-updated to 5.2.1 for "some amount of time".
    • It is likely possible for a user to have been in the first 1% of 5.2, and also to be in the final 50% of 5.2.1 (the documentation is very unclear about this).

Phased releases can be a great tool to help control the rollout of new versions of your app. Before we had them we just had to make a release that went to everyone and had no control over that cadence at all. But there are some nuances that can easily trip up app developers and their teams alike. I hope this has been a helpful walkthrough in the life of a phased app release and brings clarity to questions that you may have encountered along the way.

]]>
<![CDATA[Xcode Project Generation: A Primer]]> https://jsorge.net/2021/03/15/xcode-project-generation-a-primer LzIwMjEvMDMvMTUveGNvZGUtcHJvamVjdC1nZW5lcmF0aW9uLWEtcHJpbWVy Mon, 15 Mar 2021 16:05:37 UTC Xcode project generation is pretty great – here's how you can get started! My first day at Lyft a few years ago delivered quite a shock: Our iOS repositories didn’t have Xcode projects checked in. Instead, we relied on manifest files that would define each of our targets and handed those to a tool which would create the projects for us. While this seemed really weird to me at first – and admittedly took some getting used to – I quickly game around to this being a great way to work. It shifted the source of truth in the Xcode project from the Xcode project file itself to these manifests as well as the arrangements of files on disk. And there was the added benefit of no more conflicts to resolve when merging project changes from the main branch.

At Zulily I have been able to bring the same philosophy (with a few twists, but more on that another time). Our project was started in 2012 and we still have much Objective-C laying around. Since ours is an established project I had to answer the question: Where do I start?

My aim in this post is to answer that question with a few helpful tips that I picked up along the way (with a shout out to the Tuist docs.

Extract Your Build Settings

The first step in de-emphasizing your project file is to remove as much from it as possible. The lowest-hanging fruit are build settings. Thankfully the wonderful BuildSettingsExtractor by James Dempsey is there to help you out. It will examine each target you have and create xcconfig files for each of your target configurations, as well as a shared file that each configuration file imports.

Once you have these files extracted you can attach each file to its correct target configuration using Xcode. I’d even suggest taking this one step further and having a script run to verify no build settings creep back in to your project file.

Clean Up Your Files

The manifest files I described earlier point to globs of files in your repository which will be come sources & resources for Xcode to assemble your targets in their final product form. If you have files strewn all about the repository then it will be difficult to pinpoint exactly what files are contained in any given target. It’s a good idea to determine how you want your target directories to be organized at the end of this project, and start implementing that now.

Here’s how I went about this cleanup at Zulily:

  1. The first thing I did was to run the excellent Synx tool on our repo. Our project file version was old enough that Xcode did not move files on disk when we moved them in the project, so things had gotten way out of whack. This tool ensured that we were working with files in their proper places from the start (for the most part).
  2. Using Xcode I created the directory structure for each target and started moving files & resources around. Most of our files & folders were a single level deep in their target’s hierarchy so I started by creating the top level Sources directory and moving our sources in there. I would then look back in the Finder and see what files were left over. 95% of the time I could just delete them straight away – if Xcode didn’t know about them then they weren’t affecting our app.
  3. Start building the project manifests in parallel to the file reorg. By building the manifests for each target (defining where to find the sources, resources, target build phases, etc) I could ensure that at the end of the day I would have a buildable project from our collective manifests.
  4. One of the big things I got from the Tuist docs was to order my operations by target dependency count. I started with targets that had 0 dependencies, got their files organized, and was able to have a project and a building target right away. This helped me gain momentum in the project.
  5. Once a target was organized, able to build using the generated project and still in my Xcode project, I made a PR changing just that target in our main branch. I wanted to keep all this churn as incremental as possible rather than dumping a PR that touched literally every file in our repo. So instead of one massive PR I had many smaller (but still big) PRs that landed in sequence before the one which generates our project file landed.

Evaluate Your Options

There are a couple of main tools that can be used to make Xcode project files (without also affecting things like your build system): XcodeGen and Tuist. I’ve now used both, and each has their merits and drawbacks. For Zulily’s project I went with Tuist. The main reason was because of its support for Test Plans (XcodeGen’s support hadn’t landed yet). For my personal projects I’m still using XcodeGen though and don’t have any real plans to make a change at this point. Here’s a rundown of some benefits & drawbacks that I’ve found for each:

XcodeGen

  • ↔️ Manifests are all defined in yml or json files.
  • ✅ Super fast project generation.
  • ✅ Templates greatly enhance flexibility & reuse of things like target definitions.
  • ✅ Lightweight app built in Swift with binary releases available for download. It’s super easy to integrate into your repository.
  • ❗️ Manifests only have so much flexibility because they aren’t defined in code.
  • ❗️ Errors can be hard to debug (yml is a good but somewhat picky format).

Tuist

  • ↔️ Manifests are all written in Swift.
  • ✅ It’s extremely opinionated but uses those opinions mostly helpfully.
  • ✅ You get a framework called ProjectDescriptionHelpers which lets you add whatever helpful code or additions you want to make your manifests as simple as possible.
  • ✅ There’s a fantastic community building up around it.
  • ✅ Can bundle itself and all of its dependencies with one command, making pinning to any given version (or commit hash) super simple.
  • ❗️ Generation is much slower than XcodeGen. This is because Tuist is attempting to do more for you, but sometimes I found that it gets in the way and I have to work around it when the Tuist way of doing things differs from my own.
  • ❗️ Errors can also still be hard to debug, because you can’t (currently) pause the debugger when running the manifest generator.

It’s hard for me to prescribe which tool is right for your particular environment. I’ve been an XcodeGen user for a few years now – that’s what Lyft used – and it’s been great. I’ve been diving more into its advanced features and putting more weight on my manifest files and it doesn’t bat an eye. My project generates incredibly fast. My personal projects will likely stay on XcodeGen for a long time.

I’ve also found Tuist to be really nice to work in, and in a future post I want to talk about my Tuist-centered approach to how I’m breaking the Zulily codebase into modules and what that API looks like that I’ve built out in Tuist. I’ve found that having running code, being able to define functions, and the extra things that Tuist gives us at Zulily delivers the power of something like bazel’s BUILD files without the hassle of switching build systems. It’s been the right call for Zulily.

Wrapping Up

Putting in some work at the beginning of your project can pay major dividends. By slimming down your existing project file, and getting your repository structure in place before (or while) building out the manifests to generate your project you are setting yourself up for success. I hope this has been a helpful primer to get you started down the road of generating your Xcode projects!

]]>
<![CDATA[Working From My iPad]]> https://jsorge.net/2021/03/12/working-from-my-ipad LzIwMjEvMDMvMTIvd29ya2luZy1mcm9tLW15LWlwYWQ= Sat, 13 Mar 2021 05:29:55 UTC I've been working from the iPad Pro for the last couple of months. It's going kind of okay! Since the beginning of the year, I’ve been MacBook-free. The M1 Macs that came out at the end of last year blew my socks off (I’m far from alone here, I know) and I knew that when the new MacBook Pros came out with the Apple Silicon updates inside that I would immediately want to get one. The 16” machine that I had been using for the year prior was really good, but I knew that its resale value would crater immediately when the new models came out.

So I did something fairly rash. I sold it, and all this year I’ve been doing any “real work” from my 11” iPad Pro.

Honestly the whole thing has gone pretty well. Better than I had expected it to. I did get an M1 Mac mini for my office desk (which is outside of my house) and I access it remotely using the wonderful Screens apps by Edovia. I’ve been working on a new cross-platform Mac & iOS app and the lion’s share of that work has happened from my iPad connected to that Mac mini.

None of this would have been possible without last year’s introduction of the Magic Keyboard for iPad Pro. Having a very good keyboard coupled with the fantastic pointer support on the iPad is a game changer. I really do love this accessory. The only thing that I wish was different about this setup would be the front camera. Why is it still on the “top” side, when we all know that these iPads are used in landscape nowadays. The camera should be on the top side when docked in the Magic Keyboard. Oh well.

This is definitely an experiment that I’m happy to have undertaken. I’m excited for new Apple Silicon-powered MacBook Pros (and I’m actually considering getting the much-rumored 14” model instead of another 16” after experiencing the 11” iPad) and this little iPad has been a great companion along the way of that transition.

]]>
<![CDATA[Apple Silicon Macs: Who Goes First?]]> https://jsorge.net/2020/07/17/apple-silicon-macs:-who-goes-first? LzIwMjAvMDcvMTcvYXBwbGUtc2lsaWNvbi1tYWNzOi13aG8tZ29lcy1maXJzdD8= Fri, 17 Jul 2020 21:36:25 UTC Let's speculate about which Macs will get Apple silicon first. With Apple's announcement last month of a processor transition from Intel CPUs to "Apple silicon" CPUs (please don't let that be the real name for these things, Apple) we are entering a new phase for the Mac. While there are many things we know about how this transition is going to go down we don't actually know what Apple silicon Macs will look like or which Macs will come first this fall. So what I want to do here is speculate about which Mac(s) might get blessed with the new hardware later this year.

Let's start by looking at the existing lineup, shall we?

Desktops

  • Mac Pro: Just introduced last year, not often updated in general, and likely the model with the most outstanding questions about what an Apple silicon version might look like.
  • iMac: New models were announced last year but they've sported the same case design since late 2012 – and even that was a very mild redesign of the 2007 redesign, which itself was a very mild redesign that harkens back to 2004. There are rumors of new iMacs imminently and some evidence of them showing up in benchmarks.
  • iMac Pro: Introduced at the end of 2017 with nary an update since, the iMac Pro is an oddity in the current lineup. I hope it's not a one-hit wonder but an iMac update may fold it in to the more broad lineup.
  • Mac mini: It was "updated" this year but that was just a storage bump (having just purchased a new one, it lists itself as a 2018 model). Mac minis are not updated very frequently but it's due for a bump.

Laptops

  • MacBook Pro: MacBook Pro's have been revised fairly recently, with the 16" model coming at the end of last year, and 13" models coming just a couple of months ago. There are rumors of a 14" MacBook Pro to replace the 13" but I wouldn't say that these computers are screaming for an update (especially since the butterfly keyboard fiasco is now behind us).
  • Macbook Air: These may be the best MacBook Air's that Apple has ever shipped. They are now retina, with the good keyboard, and at a good price for a configuration suitable for most people. The Air was just updated a couple months ago alongside the MacBook Pro.

So, with that landscape in mind, which is the best candidate for Apple silicon? That's actually really complicated.

  • Apple could wait until this fall and revamp the iMac, bringing its case design forward to the modern age and giving it new life. It's worth noting that when the Intel transition came about the iMac was the first machine to get the new CPUs – a mere 3 months after its previous revision. If Apple brings out new Intel iMacs this summer don't be surprised if they revise them again in the Fall with Apple silicon chips.
  • One of the big gains from this new architecture is battery life, making the new chips perfect for the MacBook Air. I mean, who wouldn't want to see an Air with a legit 20 hours of battery life? That seems like a reasonable computer we can see after the transition.
  • Apple also in all likelihood wants to show off the power of their new Mac CPUs. The DTK that many developers are playing around with right now has the 2018-era A12z inside, and in emulation mode that is benchmarking comparable to 2015-era Macs. Once we start seeing apps built for Apple silicon and running on 2020-era CPUs I'm guessing the performance is going to be stunning. Even the MacBook Air I just talked about may get performance close to today's MacBook Pro. Apple surely wouldn't want its Pro laptops being outperformed by its consumer notebook.

So here's my prediction:

Apple is going to revise every Mac this fall with Apple silicon – save the Mac Pro. Yes, even the Mac mini will come along for the ride (it's the chassis for the DTK after all, so it seems simple enough for Apple to put a different board in it with production-ready CPUs on it). I think that Apple becoming their own Mac CPU vendor is going to lend itself to even more secrecy and it seems like they have a lot up their collective sleeves.

Will this happen? I don't know, and honestly I doubt it. But it's fun to speculate nonetheless. And it's also a really fun time to be a Mac user.

]]>
<![CDATA[Back to the Zu]]> https://jsorge.net/2020/06/26/back-to-the-zu LzIwMjAvMDYvMjYvYmFjay10by10aGUtenU= Fri, 26 Jun 2020 22:46:46 UTC I got a job! I'm officially off the market! As of this Monday, June 29, I'm rejoining the team at zulily as an iOS engineer. Things have changed a wee bit since I left and instead of having one mobile team to handle the app's duties they have started implementing vertical "squads". So with all that said, I'll be on the Discover Squad. What that means exactly, I'm not sure. I'll start to find out on Monday!

It's going to be fun going back to a place where I already have many friends – and I've gotten to meet some of the newer folks over the past couple years of Xcoders meetings. I'm excited to take some of the good things I learned at Lyft and bring them back to zulily.

I'm excited to start this new chapter. Onward!

]]>
<![CDATA[On the Market]]> https://jsorge.net/2020/05/04/on-the-market LzIwMjAvMDUvMDQvb24tdGhlLW1hcmtldA== Mon, 04 May 2020 18:16:19 UTC I got laid off last week, which puts me square in the middle of the job market. TL;DR: I got laid off last Wednesday and am on the job market for an iOS developer job. Here is my résumé 🙂

Last week started like any other work-from-pandemic kind of week, but then came Wednesday. Lyft laid off 17% of its workforce including me. It was pretty shocking – especially at first – but there was actually a calm that came over me pretty quickly about what was happening. Don't get me wrong: the situation itself was incredibly chaotic between sorting out logistics of what comes next, talking things over with my now-former team (who was entirely blindsided by this), and still having the regular day-to-day things happening around the house like Atticus's therapies. Life goes on.

In the days since the layoff I've come to realize how amazingly blessed I am by the community that Jesus has put around me. Many friends have said incredibly nice things about me in re-tweeting my original post about being laid off. My email inbox blew up from 3 messages on Wednesday morning to over 55 at its peak late Thursday. I've already had a few recruiter calls and have more lined up this week. I hope and pray that a new job will come along soon.

In the meantime I've got a short contract project to work on with a couple of good friends that I'm super excited about, a calendar that suddenly has become a lot more complicated, and a few things that I need to get listed for sale. Onward to my next adventure!

]]>
<![CDATA[Thinking About Default iOS Apps]]> https://jsorge.net/2020/02/28/thinking-about-default-ios-apps LzIwMjAvMDIvMjgvdGhpbmtpbmctYWJvdXQtZGVmYXVsdC1pb3MtYXBwcw== Sat, 29 Feb 2020 04:32:06 UTC Apple's rumored to be allowing default iOS apps in a future version of iOS. I've got some questions about that. There's a report that came out this week from Bloomberg that says Apple is "considering" the idea of allowing users to pick third-party apps to be their default for things like email, music, and web browsing. This really does feel like a good thing for Apple to do, though I do laugh a bit at the "considering" word. If they are truly considering it then it's likely to miss iOS 14 which I imagine has been feature-locked for some time. The question is: what does setting a default app mean?

  • In Messages, tapping an http or https link would presumably take you to the browser you've set as default. This could be Safari, Chrome, or iCab.
  • Tapping a mailto link would open up your email app. There are plenty out there which could supplant the default Mail.app (which is what I use and personally find to be fine).
  • Asking Siri to play some music could launch Spotify without having to add "with Spotify" to the end of your query.

And there are many other possibilites here that I won't bother listing. As a user I think the time is definitely right for Apple to introduce a feature like this. But what about as a developer?

The big question that I have revolves around code that would normally put Safari in your app. The class to do this is SFSafariViewController and it literally puts a Safari view in your app. This allows for the system to use your content blockers and other installed extensions. It also locks the domain to the one provided by the developer when they brought it on screen.

If one of the benefits of setting your default browser to (let's say) Chrome so you have access to all the Chrome things all the time would it be jarring for a user to see Safari inside of their Twitter app when they tap on a link? Would Apple provide some kind of hook inside of SFSafariViewController to actually show the content of a third-party app like this? If I've purposefully gone and set Chrome as my default browser then I sure don't want Safari ever getting in my way.

There's also similar code around MFMailComposeViewController for sending emails in apps (I use that in Scorebook) as well as MFMessageComposeViewController for sending iMessage or SMS messages. Would they allow users to pick their email or message client and slide up those experiences as well?

If Apple does allow these third-party apps then it will be the result of a mountain of work touching who knows how many parts of iOS. I'm excited to see what we get in iOS 14 come WWDC this year. We should be hearing logistical details about the conference in just a few weeks. 🍿

]]>
<![CDATA[Apps I Love: Kaleidoscope]]> https://jsorge.net/2020/02/22/apps-i-love:-kaleidoscope LzIwMjAvMDIvMjIvYXBwcy1pLWxvdmU6LWthbGVpZG9zY29wZQ== Sun, 23 Feb 2020 04:21:38 UTC Kaleidoscope is my diff tool of choice on macOS. Several years ago I had a series of posts here called "Apps I Love". Many of the apps I loved back then I still do, but right now I want to highlight a special part of my tool bag. It's my diff tool of choice: Kaleidoscope. I freaking love this thing, and it's just received its first update in a while to v2.3.

If you've never seen a diff tool in action (or even heard the term), basically what it does is can take 2 things and tell you the difference between them. Kaleidoscope can diff text files, folder contents in the Finder, git branches, and even images. I use it most frequently in my development workflow when resolving conflicts during code merges but have definitely used its folder support before too. It plugs nicely in to my git app of choice Tower (which I should probably write about too).

I do have a funny story to share about Kaleidoscope in closing. Version 2.0 came out 7 years ago, in early 2013. At that point I was barely writing any code and definitely not professionally. I heard about v2's release somehow (probably from one of the tech-related Twitter accounts I was following) and Black Pixel was doing some Twitter contests for free copies. I'm a sucker for stuff like that even if I have no idea how to use what I'm winning. I ended up winning a copy and being lost as to what it did. Fast forward a year or so and I'm learning development and see in Tower that it has a way to trigger Kaleidoscope as the diff tool! That was my gateway to a bigger world 🙂

I really hope this new version is a harbinger of things to come and that some day they'll release a version that I need to pay for. So go check out Kaleidoscope and come to love it as much as I do!

]]>
<![CDATA[🔗 iOS Performance Tips]]> https://jsorge.net/2020/02/18/ios-performance-tips LzIwMjAvMDIvMTgvaW9zLXBlcmZvcm1hbmNlLXRpcHM= Tue, 18 Feb 2020 15:55:09 UTC This is a good collection of tips to increase performance of your iOS app. iOS Performance tips you probably didn't know (from an ex-Apple engineer)

A common anti-pattern is leaving UITableView/UICollectionView cell labels populated with their text content when these cells enter the reuse queue. It is highly likely that once the cells are recycled, the labels’ text value will be different, so storing them is wasteful.

I could have pulled a few more gems from this super helpful post by Rony Fadel, but this first one struck me off the bat. I don't know how many times I have kept text in a label when I perhaps didn't need to. I also didn't know that the right place to nil-out text in reusable views (UI{Table|Collection}ViewCell) is not in their prepareForReuse() method but in the delegate's didEndDisplaying method instead.

In larger projects with many cell class types this may take some thinking on how to get the message across to a cell type of "time to reset any labels you have". I know if I were still at zulily this would be something that I'd work to get in place as soon as possible, as I did a lot of really hacky things to collection views in my time there 😀

]]>
<![CDATA[The Time I Stumped the Apple Geniuses]]> https://jsorge.net/2020/02/14/the-time-i-stumped-the-apple-geniuses LzIwMjAvMDIvMTQvdGhlLXRpbWUtaS1zdHVtcGVkLXRoZS1hcHBsZS1nZW5pdXNlcw== Fri, 14 Feb 2020 17:11:23 UTC AKA how did Apple sync the iMac G3 desktop color with its case? When the Apple stores first opened, the Genius Bar was a much different experience than it is today. For one it actually was a bar you could go to at the back of the store. But they also wanted to answer the really tough questions. And if the Genius you were talking with didn’t know the answer, there was a Red Phone to dial home and talk to someone in the next level up in support. It really was a fun experience.

Prior to the Seattle area getting its first Apple store my family and I went on a vacation to Las Vegas and we went to the Fashion Show Mall so I could see their store. And I had just the question to stump their Geniuses:

iMacs in their wonderful colors – those were the days

I worked at an Apple Authorized Service Center and had been doing service on the iMacs with slot loading optical drives (like the ones pictured above). Whenever I would need to erase a hard drive and restore the operating system I noticed that the desktop wallpaper color matched the color of the case. So a Ruby iMac would get a Ruby colored desktop, and same with Sage green, Indigo blue, and so on. How did they pull this off?

I do also have some inside information to help rule out some possibilities:

  • The main logic boards did not know anything about the shell color. There was 1 part per model of iMac and they were not ordered by color of case. These boards hold everything: CPU, graphics, memory, all the ports, all of the guts.
  • Same story for the other big board: the analog/video board. It was not ordered by color either.
  • The only other real parts inside were the optical and hard drives.
  • Except for the speakers.

And that last part is what I think happens. The speakers on these iMacs were colored to match the back case (and you could see them through the translucent base). I think that there was some chip in the speakers that would indicate to the system what color it was and then the system would pull the appropriate wallpaper.

If you or someone you know may happen to know how this worked I would love to know the answer!

PS: Special thanks to the Xcoders group last night for encouraging me to post this after I told the story. It was a ton of fun to speculate together. Community is awesome 🙂

Update 2/15

After a lot of fun discussion and speculation I think Daniel Kennett has the most plausible answer: the color was encoded into the serial number!

If my memory serves correctly, when we would replace a logic board we would have precisely one opportunity to reset the serial number via a firmware reset tool. I don't recall what would happen if we failed to update the serial number (and that sure would be a fascinating experiment to run!).

]]>
https://jsorge.net/2019/12/16/animating-constraints LzIwMTkvMTIvMTYvYW5pbWF0aW5nLWNvbnN0cmFpbnRz Tue, 17 Dec 2019 05:49:56 UTC Note to self: when animating NSLayoutConstraint properties, remember to call layoutIfNeeded() before the animation block and inside the animation block. Otherwise the animation won't work.

Hopefully this saves future me some time.

]]>
<![CDATA[Catalystic Converter]]> https://jsorge.net/2019/11/23/catalystic-converter LzIwMTkvMTEvMjMvY2F0YWx5c3RpYy1jb252ZXJ0ZXI= Sat, 23 Nov 2019 23:40:19 UTC What happens to your project when you Catalyze your app? Apple this year brought a new technology called Catalyst to the Mac. Going in to WWDC back in June, it was thought that Catalyst (née Marzipan) was going to be the future of the Mac. Essentially it lets developers write an app for iOS using the UIKit frameworks and have it work as a native Mac app. I think the results so far have been hit-or-miss but it's still super early days for this technology.

I'm starting a new project and wondered while updating my project templates – what does making an iOS app work on the Mac actually do to your project? Let's take a look!

Step 1: Make a new, empty iOS project. To make things easy, have Xcode create a git repo. This will set the stage for viewing differences.

Step 2: Add a couple extra targets. Lots of apps nowadays are moving towards a modular approach. This is great because it lets us keep our code separated in such a way that we can easier test our individual pieces and gain reuse by sharing frameworks across apps. I don't know offhand what Catalyst means for my dynamic frameworks and static libraries. Let's add a couple different types of these modules.

Step 3: Commit the current state. We want to capture the repo's place in time.

Step 4: Click the Mac checkbox. In your app's Deployment Info section, check the Mac device target to get going. You'll see the following sheet drop down.

Going Catalyst - hold on to your butts

Moving ahead will surprisingly just make a few changes to your project. There is a new entitlements file added with a couple of entries:

  • com.apple.security.app-sandbox
  • com.apple.security.network.client

I suspect if your app is using iCloud or other permissions that further entitlements may be added here as well, but in our sample project we're not using any of that.

Additionally there are 3 new build settings on only the app target:

CODE_SIGN_ENTITLEMENTS = Catalystic/Catalystic.entitlements;
SUPPORTS_MACCATALYST = YES;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;

There are a couple of interesting things here. First, only app targets need to be updated in build settings. Your other module's code may need some slight changes to source, but no build settings need to change. Super cool.

The other interesting thing is the DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER setting. I don't know what would happen if this was set to NO. Thankfully there's a handy Help button next to our Mac version's bundle identifier. It's help page contains this text:

You can change the Mac version bundle ID format but then you need manually sign the app. Set the Derive Mac Catalyst Product Bundle Identifier (DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER) build setting to NO, add a macOS conditional value for Product Bundle Identifier (PRODUCT_BUNDLE_IDENTIFIER) and Provisioning Profile (PROVISIONING_PROFILE_SPECIFIER), then manually sign the app.

So that's pretty cool. Xcode will automatically give us the maccatalyst prefixed bundle ID as a convenience to signing our apps across the embedded executables like app extensions. And if you want to manage it all yourself (say by replacing the maccatalyst prefix with a .macos suffix) you can do that too.

So there you have it. Just a few steps and you too can have a Mac app from your iPad source base.

WWDC Resources

]]>
<![CDATA[My Desk Setup]]> https://jsorge.net/2019/11/12/my-desk-setup LzIwMTkvMTEvMTIvbXktZGVzay1zZXR1cA== Wed, 13 Nov 2019 06:16:12 UTC A rundown on how I've got my desk set up. For the last couple of years I've really dialed in my desk situation. I'm really blessed in that I can have essentially the same setup in 2 places – my office near home, and my desk at the Lyft office. In this post I'll go over the gear I've got, what works and what could be better.

My desk

The Computer

I've got a 2018 MacBook Pro. It's a 6-core i9 with 32GB of RAM – and our Lyft project really demands all those resources. Sure, I'd vastly prefer an iMac Pro on my desk(s) but the portability really is great to have on the whole.

The Dock

Here's the brains of the rest of the operation. I have a CalDigit TS3 Plus which lets me plug one cable into my laptop. From there it breaks out to video, USB, audio, and ethernet. I friggin love this thing. I used to have to plug in power, video, USB, all in separate cables. This box even sends power to my computer so it's a true single-cable plug and go.

The Display

For many years now I've been able to have a 27" 4k monitor on my desk. I've used Dell (pictured here) for quite some time – it's the P2715Q model. I know it's not 5k and the resolution could be better, but 5k monitors are a lot more expensive than I was willing to pay at the time.

I got the Autonomous monitor arm last year and it's been quite nice to have the display floating. There are probably better arms (definitely more expensive ones), but this one has been just fine for my entry in to the bigger world of monitor arms.

The Keyboard

For a long time I used the Microsoft Sculpt ergonomic keyboard, but recently I switched to the Kinesis Advangage2 LF. It's still got the nice split layout that helps with ergonomics, and the key wells help my finger travel be overall smaller. I was feeling a fair bit of pain in my right forearm and with the Advantage2 that has subsided quite a bit.

Fair warning: the layout on the Advantage2 takes a lot of adjusting to. I've been using it for a little over a month and still adjusting.

The Desk & Chair

The desk I have shown is the Autonomous SmartDesk2. It's adjustable to be tall for standing or shorter for sitting. I love the control panel (especially compared to my other desk at the Lyft office) because the programmable buttons let me press once and it will adjust to the defined height. On my other desk I have to keep the button held for it to move. There's plenty of space for all that I put on the surface, and when it's standing up isn't wobbly or rickety at all. Highly recommended - especially for the price. It's one of the least expensive powered desks I've seen.

I also got the Autonomous ErgoChair 2 for the times when my desk is lowered. It's pretty comfortable – though the Steelcase Gesture that Lyft provided is much more comfortable but a lot more money.

You can follow this link to get at least $15 off your order with Autonomous (full disclosure: this is a referral link so I get something back too).

Miscellaneous

  • I love, love, love the Magic Trackpad 2 for all my mousing needs.
  • The HomePod is a great little speaker that more than fills the space.
  • The Logitech HD Pro Webcam C920 is what I use for video calls. It more than gets the job done for me.
  • I use the Audio Technica ATR2100 USB mic for recording podcasts and video calls. I get tons of compliments of how good my audio is.
  • I also under-mounted a power strip on the front-right side of the desk (under the HomePod) so that I didn't have a bunch of cords laying on the ground.

That's my setup. I think the big thing missing from the image above is a little filing cabinet. It's not crucial but I currently stash papers & miscellaneous little stuff behind the comfy chair in the corner (not pictured).

]]>
<![CDATA[Maverick Apps]]> https://jsorge.net/2019/11/11/maverick-apps LzIwMTkvMTEvMTEvbWF2ZXJpY2stYXBwcw== Tue, 12 Nov 2019 05:48:11 UTC Looking over what the next apps I want to work on could be. I've really liked working on Maverick over the past few days. I want to be blogging more and the improvements I've been making will definitely lead to that end. I deployed my metadata update I wrote about and things are showing no sign of issues. So now I'm on to the next step: better authoring and site maintenance tools.

For a long time I have wanted to make a set of Mac & iOS apps that would let me more easily manage my site. But I've had soem struggles figuring out how best to structure things (I'm starting with the Mac apps because I've long been an aspiring Mac developer). I could make one app that can manage the whole site, and author the needed textbundle files. Or, I could make a couple of different apps: one for basic site maintenance that would facilitate taking in new textbundles from any app you wanted to write in, and another for actually doing the writing.

I don't think there's an app out there right now that does textbundles really well at an affordable price. I've used Ulysses but it has its own syntax for things and you'd have to export files to get them out as a textbundle. Currently I'm a BBEdit user and while I do like it for many things, I think the UX on having markdown files with inline assets could be improved. I'd like to build a really nice textbundle editor as a standalone app.

I don't have any timeline for either of these apps, and honestly I'm not sure which one to build first. I think the textbundle editor may see a broader audience (since I'm the only one using Maverick as a blog engine that I know of). So maybe I'll give that one a go first, especially since I can wrangle up scripts to help with publishing kinks. Okay, I've convinced myself 🙂

I do also want to play with Catalyst, so this would be a really nice opportunity to use iOS to make iPhone, iPad, and Mac apps all with one codebase. Let's go.

]]>
<![CDATA[Better Procrastination Through Yak Shaving]]> https://jsorge.net/2019/11/10/better-procrastination-through-yak-shaving LzIwMTkvMTEvMTAvYmV0dGVyLXByb2NyYXN0aW5hdGlvbi10aHJvdWdoLXlhay1zaGF2aW5n Mon, 11 Nov 2019 05:58:30 UTC The first step in any new project is to create the project (more on what the project is tomorrow). That's where yesterday's yak shaving adventure comes in.

The app I'm starting in on is for the Mac. I have a project template for iOS already but it didn't support a Mac app. I have really come to like using Xcodegen to generate my Xcode files and not check them in to source control. So I decided to update my template to support a Mac app.

Instead of starting with the assumption of always wanting a Mac app, I updated the new-module command to output a framework, an iOS app, or a Mac app. This will let me have maximum flexibility for my project. I went about it by creating a shell project from Xcode, extracting the build settings using James Dempsey's excellent Build Settings Extractor, and modified some files to tokenize the name based on input.

I'm pretty happy with the result, even though I've been churning over my new app idea in my head. This was a fun distraction, but now the real work will begin.

]]>
https://jsorge.net/2019/11/09/new-project LzIwMTkvMTEvMDkvbmV3LXByb2plY3Q= Sat, 09 Nov 2019 18:57:49 UTC I'm at the part of a new project where, before actually starting on the project, I need to update all my templates. Currently updating my iOS project template to be able to make a Mac or iOS app.

]]>