Archive for January 1, 2019

Tuesday, January 1, 2019

IINA 1.0

IINA (via Martin Pittenauer):

IINA is born to be a modern macOS application, from its framework to the user interface. It adopts the post-Yosemite design language of macOS and keeps up the pace of new technologies like Force Touch, Touch Bar, and Picture-in-Picture.


Powered by the open source media player mpv, IINA can play almost every media file you have. With the support of youtube-dl and our browser extensions, you can also play a variety of online streams in IINA via one click.


Written in the Swift programming language, IINA is free and open-sourced under the GPLv3 license.

React.js and Cocoa Side by Side

Marcel Weiher:

Fortunately, the React.js team was so kind as to put their basic ideas in writing: React - Basic Theoretical Concepts (also discussed on HN). So I had a look and after a bit of reading decided it would be useful to do a side-by-side comparison with equivalents of those concepts in Cocoa as far as I understand them.


[React:] Calling the same function over and over again is wasteful if we know that the function is pure. We can create a memoized version of a function that keeps track of the last argument and last result. That way we don’t have to reexecute it if we keep using the same value.

[Cocoa:] First, we did not start with the obviously incorrect premise that the UI is a simple “pure” function of the model. Except for games, UIs are actually very stable, more stable than the model. You have chrome, viewers, tools etc. What is a (somewhat) pure mapping from the model is the data that is displayed in the UI, but not the entire UI.

So if we don’t make the incorrect assumption that UIs are unstable (pure functions of model), then we don’t have to expend additional and fragile effort to re-create that necessary stability.


Last not least, it’s probably not entirely coincidental that this idea was hatched for Facebook and Instagram feed applications. Similar to games, these sorts of apps have displays that really are determined mostly by their “model”, the stream of data coming from their feed. I am not convinced that feed application generalizes well to application.

Splitting a Swift Sequence Into Head and Tail

Ole Begemann:

One possible solution is to create an iterator to read in the first element, and then wrap the current iterator state in a new AnySequence instance[…] This code works, but it’s not a nice generic solution, especially for types that also conform to Collection. Wrapping the tail in an AnySequence is a big performance killer, and you can’t use the affordances of a collection’s proper SubSequence type.


Dennis’s trick is to call Sequence.drop(while:), which preserves the SubSequence type for the tail, and then “catch” the first element inside the drop(while:) predicate closure using a captured local variable. Nicely done!


The code above targets Swift 4.2. It will break in Swift 5 because sequences will no longer have an associated SubSequence type, only collections (Swift Evolution proposal SE-0234).

Lower Cost iOS Devices

Joe Rossignol:

The report claims that just one in four Indians own a smartphone, providing Apple with an opportunity to sell iPhones to millions of new customers in the country. The issue is that India is a very price-sensitive market, with more than 75 percent of the smartphones sold in the country costing “less than $250.”

Apple-authorized reseller Flipkart continues to sell the iPhone SE in India for around $250, but other iPhone models are priced between the equivalent of $325 and $1,950 in the country, well above the budgets of many Indian customers.

Simone Manganelli:

Apple’s incompetence here is absurd. This is so easy. Release new, low-cost, iPhone SE 2 with updated processor. You’ve already produced this phone at scale.

Nilay Patel:

Apple just dropped the price of the iPad to $229 on Amazon and Walmart. Apple just reached a deal to sell directly on Amazon, so it’s selling the iPad cheaper on Amazon than its own stores.

Michael Love:

This is a much bigger deal than the amount of coverage would suggest; Apple appear to have pulled off something with iPad that they’ve never managed with iPhone, differentiating the high-end $1000 model sufficiently that they can comfortably offer a low-end one for $200.

The iPhone 7 is currently $449 but that’s 2 years old, too expensive relative to Android + not cheap enough relative to the XR to be a game changer. Put an A12 in a 6/7/8 chassis and charge $300 and you’ll convert a lot of Android users while still making a healthy profit.

That they haven’t done this leads me to an interesting inference about services / accessories revenue, namely, it’s mostly coming from high-end users; the reason Apple doesn’t have a $300 iPhone is because they wouldn’t expect it to produce much more than that $300 in revenue.

Previously: 2018 iPhone Sales.

Update (2019-07-16): Tim Hardwick:

Apple has reportedly stopped selling iPhone SE, iPhone 6, iPhone 6 Plus, and iPhone 6s Plus in India, meaning anyone in the market for a new Apple smartphone will have to shell out more for a later model.

According to The Economic Times, the strategy indicates Apple is no longer prioritizing shifting iPhones in the country by volume and is instead refocusing efforts on increasing its revenue there.