Published on

Indie Dev Weekly #19

Authors

2023, 0619-0625

This week I experienced farewells as well as reunions.

Anyway, life goes on.

Stranded in Beijing

Usually when I travel between Beijing and my hometown, high-speed rail tickets are available on demand and the carriages are mostly empty. On Tuesday afternoon when I was about to go back home from Beijing, I was surprised to find that all tickets were sold out for the next three days - that's when I belatedly realized it was because of the Dragon Boat Festival. I opened the ticket booking app and selected all options including transfers, rides with stops, and various VIP bookings, and even business class seats, but after waiting at the Beijing Chaoyang station for a whole afternoon I still couldn't get a single ticket. At that time I panicked, worried that I wouldn't be able to get home for three days.

Since taking the train was out of the question, I contacted my college classmates in Beijing to meet up for a meal, and also experienced the subway during Beijing's evening rush hour that I hadn't taken for a long time. I hadn't seen my classmates for many years but we chatted happily, we're all entering middle age now and talked about things like houses and kids. My Beijing classmates all said they rarely get together, it's only when those of us from out of town come to Beijing that there's a chance to meet up for a meal - maintaining our schoolmate relationships apparently relies on us out-of-towners...

I freeloaded a meal off my classmate L, and classmate H also helped me book a hotel near the subway station, with classmate H telling me to just take a shared bike from the metro to get there. But after running around all day I was exhausted and didn't want to walk another step, so after getting out of the subway I called a DiDi (Chinese Uber), selecting 6 car types and waited a long time without anyone accepting the order, until finally a private car that was only a dozen meters away accepted. But when I arrived at the hotel I realized I had gone to the wrong one - the one my classmate booked for me was "Beijing Chaoyang High Speed Rail Hotel" while I had gone to "Beijing Chaoyang Park Hotel"... Luckily the two hotels weren't far apart on the same street, a 500 meter bike ride and I arrived at the right one, yes, in the end relying on a shared bike.

Fortunately, while on the subway earlier I managed to get a first class seat home for Wednesday afternoon. It was my first time taking first class, the attendants pour water for each passenger, give out small bags of snacks, and notify you when it's time to get off. The seats are a bit more luxurious than second class with foot rests, but I feel the small fold-out tables aren't as good as second class. My carriage was No.01, and I thought it was the first carriage but there was another business class carriage in front, I guess No.00?

After getting off, I realized as expected the entire train was full, the first time I've seen that. Going down to the taxi area on the basement level 2, there was an extremely long line of people waiting, strangely the taxis weren't coming one after another but rather several seconds between each one. Seeing the line I figured it would take two hours just to get a taxi, so I made an absolutely correct decision - I went upstairs to the bus waiting area, took a random bus to the city center, then got a taxi home from there. From chatting with the taxi driver I learned that the taxi drivers were having a dispute with the high speed rail station, collectively refusing to pick up passengers there on purpose. Also Thursday was the Dragon Boat Festival holiday, with only a quarter of the taxis operating in the city, which would make the backlog at the train station even worse.

Apple Vision Pro

The visionOS beta was released on Thursday, and I directly got the Zen Flip Clock and Clock Wall running successfully in Xcode 15 beta 2.

Clock Wall was the first SwiftUI app I wrote to learn SwiftUI, completing the first version in just 3 days and successfully releasing it.

avp

And Zen Flip Clock was completely rewritten in SwiftUI last year. The original UIKit version had been maintained for 5 years, with a very complex internal implementation, and I didn't dare add any new UI or features.

Currently all my apps are implemented in SwiftUI. Thanks to switching from UIKit to SwiftUI in time, I could get the apps running on visionOS so smoothly. This is also one of the advantages of indie developers - small boats are nimble.

visionpro.jpg

StandBy

This week I adapted Zen Flip Clock for iOS 17's StandBy.

Strangely I couldn't find any tutorials on how to adapt to StandBy, whether WWDC sessions, personal blogs or videos. Searching for "StandBy" in Apple's developer documentation, I could only find a static property standby of type WidgetLocation, so I continued searching on WidgetLocation and found a new method:

api

This was the only new method using WidgetLocation, so I tried it and indeed by adding this method I could add Zen Flip Clock widgets to StandBy. I don't know if my approach is correct, but the method name is to set exclusion options, I don't understand why Apple used a negative to set StandBy.

Currently StandBy seems to only support half-screen widgets like small and large squares, I wonder if full-screen rectangle widgets will be allowed later.

standby.jpg

Developer App

Apple has an official app, Developer, mainly used to watch WWDC.

I just discovered a shocking usage technique in this app. If you want to search for something related to a new feature, you can enter a keyword (of course in English) in the search box in the upper left, then the right side will list all the sessions where that keyword appears in subtitles. When you click on a session, the keyword will be highlighted in the subtitle area below. Up to here, it's just a plain search operation, but what surprised me most is that when you click on a line in the subtitles (doesn't have to be the highlighted keyword), the video will jump to that moment in time!

I don't know when this feature was added. In the past I always watched from start to finish, or estimated the playback position based on the subtitle location and manually adjusted the progress bar.

developer