Archive for January 24, 2019

Thursday, January 24, 2019

Swift 5 Release Notes for Xcode 10.2 Beta

Apple:

Swift apps no longer include dynamically linked libraries for the Swift standard library and Swift SDK overlays in build variants for devices running iOS 12.2, watchOS 5.2, and tvOS 12.2. As a result, Swift apps can be smaller when deployed for testing using TestFlight, or when thinning an app archive for local development distribution.

[…]

Key paths now support the identity keypath (\.self), a WritableKeyPath that refers to its entire input value (SE-0227)[…]

[…]

In Swift 5 mode, switches over enumerations that are declared in Objective-C or that come from system frameworks are required to handle unknown cases—cases that might be added in the future, or that may be defined privately in an Objective-C implementation file. Formally, Objective-C allows storing any value in an enumeration as long as it fits in the underlying type. These unknown cases can be handled by using the new @unknown default case, which still provides warnings if any known cases are omitted from the switch. They can also be handled using a normal default case.

Previously:

Update (2019-01-25): Patrick Balestra:

Created a new empty Swift project to see how much difference not including the dynamically linked Swift libraries made, and oh my god.

From 2,4MB to 24KB compressed IPA, users on iOS 12.2 are gonna love this!

And this is without importing any Swift library! The improvement is much bigger in real apps obviously.

Microsoft Office in the Mac App Store

Microsoft:

We’re committed to delivering the power and simplicity of Office in an experience designed specifically for Mac, and we continue to make significant investments in the platform. Today, we’re excited to announce that Office 365 is now available on the newly redesigned Mac App Store. With one click, Mac users can download the cloud-connected, always-up-to-date version of the Office suite—including full installs of Word, Excel, PowerPoint, Outlook, OneNote, and OneDrive.

Mitchel Broussard:

Microsoft Office apps have been available on Mac for years, but users have had to download them from the web or in physical retail boxes since Apple has never offered them directly in its Mac App Store. This should make the process of getting programs like Microsoft Word, PowerPoint, and Excel much easier for Mac owners.

Like other versions of Office, you’ll need a subscription to Office 365 to gain access to the full features of each app.

Erik Schwiebert:

the only thing different is that the apps from the MAS are signed by Apple’s App Store cert instead of Microsoft’s corporate developer cert. That means some saved keychain access will break if you mix apps from the two sources, because the code signatures are different.

Apple:

In business, as at home, employees want access to the best devices and apps to do their work. With Office 365 on the Mac App Store, these apps can now be easily distributed to employees using Apple Business Manager, a central dashboard where IT can deploy devices, apps and licenses. Now IT can quickly enable employees to get to work with their favorite Office tools across Mac, iPad and iPhone, with great new features designed specifically for Apple devices.

Microsoft:

This article covers frequently asked questions about the availability of Office from the Mac App Store, and the differences between downloading Office apps directly from Microsoft.

Clearly, the best part is not having to use the annoying Microsoft AutoUpdate app.

Previously:

Update (2019-01-25): Christopher P. Atlan:

Interesting that they choose to use the same bundle identifier.

davidkocher:

Wondering if Microsoft is paying the same 30% commission.

My guess is that they are for IAP. But, because Office is a cross-platform app, they can use their own payment processing like Netflix and bypass Apple’s commission entirely:

3.1.3(b) Multiplatform Services: Apps that operate across multiple platforms may allow users to access content, subscriptions, or features they have acquired elsewhere, including consumable items in multi-platform games, provided those items are also available as in-app purchases within the app. You must not directly or indirectly target iOS users to use a purchasing method other than in-app purchase, and your general communications about other purchasing methods must not discourage use of in-app purchase.

In a way, Apple is disincentivising exclusive apps. Make a Mac app? Apple takes 30%. Add a Windows version? Now Apple gives you free distribution.

But, unlike Netflix, Microsoft lets you subscribe via IAP. So you can manage it along with your other subscriptions and pay for it using discounted iTunes gift cards. In that case, after a year, Microsoft is getting 85%, and I’m paying only 80%, so I wonder if that means Apple is actually paying Microsoft.

Erik Schwiebert:

Bundles don’t have metadata entries for minimum OS, and I suspect the MAS code fills in “missing”metadata with that old minimum version string. I argue it should report the newest minimum version of all the apps in the bundle. But that’s up to Apple to fix (Radar 47520238).

John Gruber:

I’d bet a fortune Microsoft isn’t paying Apple the standard 70/30 split for the first year of a subscription. Maybe they’ve jumped right to 85/15? Maybe even more favorable to Microsoft? I’d love to know.

35 Years of Mac

Tim Cook:

35 years ago, Macintosh said hello. It changed the way we think about computers and went on to change the world. We love the Mac, and today we’re proud that more people than ever are using it to follow their passions and create the future.

As of this writing, he’s getting a fair amount of criticism in the Twitter replies.

Joe Rossignol:

Jobs pulled the Macintosh out of a bag during Apple’s annual shareholders meeting on January 24, 1984 at the Flint Center in Cupertino, California, grinning from ear to ear as the crowd erupted in applause.

[…]

Two days earlier, Apple teased the Macintosh’s introduction with its iconic “1984" ad during Super Bowl XVIII on CBS[…]

Here’s a video of the introduction (via John Gruber).

Update (2019-01-25): Walt Mossberg:

An early Mac ad, worth viewing today, the 35th anniversary of the original Mac going on sale. I love the headline.

ExpressibleByStringInterpolation in Swift 5

SE-0228:

String interpolation is a simple and powerful feature for expressing complex, runtime-created strings, but the current version of the ExpressibleByStringInterpolation protocol has been deprecated since Swift 3. We propose a new design that improves its performance, clarity, and efficiency.

Olivier Halligon (tweet):

The fact that you can implement whatever appendInterpolation(…) method you like means that you can choose what interpolation to support. This is a super powerful feature that opens a large range of possibilities!

For example, if you implement func appendInterpolation(_ string: String, pad: Int) that means that you’ll be able to build your type using an interpolation like: "Hello \(name, pad: 10), how are you?". The interpolation just has to match one of the appendInterpolation signatures that your StringInterpolation subtype support.

Olivier Halligon:

In this second part, I’ll focus on one application of that new ExpressibleByStringInterpolation, to make NSAttributedString prettier.

Erica Sadun:

Consider printing optionals.

Erica Sadun:

Today’s extension enables (optionally padded) radix-based interpolation. You interpolate a number and specify a radix, the numerical base used to present it.

Erica Sadun:

Consider formatters. Both Swift and Cocoa/Cocoa touch support a number of these, ranging from numbers and currency to dates and times. They are a natural interpolation fit.

Ravi Kandhadai Madhavan (via Ben Cohen):

This post presents an overview of our plan for creating a customizable interface for Apple’s logging system. Our proposal uses custom string interpolation, which is a recently-improved language feature, and compile-time interpretation, which is a compiler technology that is in the process of being upstreamed as an experimental feature.

Update (2019-02-05): Mattt Thompson:

For a simple example of this, consider a custom type that escapes values in XML, similar to one of the loggers that we described last week. Our goal: to provide a nice templating API that allows us to write XML / HTML and interpolate values in a way that automatically escapes characters like < and >.

Update (2019-02-18): Mattt Thompson:

RegularExpressionDecoder provides a convenient solution to constructing Decodable objects from regular expression matches by automatically matching coding keys to capture group names. And it can do so safely, thanks to the new ExpressibleByStringInterpolation protocol in Swift 5.

Mojave Software Update Issues

Howard Oakley:

During downloading of the update, it appeared that the progress bar had been shifted to the left, relative to the stated time to download the new update. As seen above, with just 7 seconds to go, the progress bar was only just over 80% complete.

Once the download had apparently completed, the progress bar slowly progressed to completion. But the text above it still referred to downloading, and didn’t, for example, change to report that the update was being prepared. Furthermore, there was no estimate of the time to completion, although significant additional time was taken at this stage.

I like having it back in System Preferences instead of the App Store app. But it still has the same old problems, like checking online and then telling you that your OS is up-to-date when it’s obviously not (then, sometimes, refreshing again to show the update a few seconds later).

I also ran into a bunch of problems when my father got a new MacBook Air and it wanted to update macOS during the setup process before proceeding with Migration Assistant. For example, the progress bar showed that it was finished, but the text didn’t say it was done. Seemingly the only thing to do was click a button to move on to the next step, but I later found that it hadn’t actually installed the update—and it had to download it all over again.

Jeff Johnson:

The links [in the release notes] are neither clickable nor selectable.

Update (2019-01-25): Thomas Brand:

Just like diskutil the cli softwareupdate command is the answer to getting reliable Mac OS updates in the background; even while running the Setup Assistant.