Archive for December 10, 2015

Thursday, December 10, 2015

Improving Readabilty With Swift Extensions

Jacob Bandes-Storch:

One perk of being a programmer is that, if your tools don’t do what you want, you can improve them yourself. Swift makes this particularly easy, providing several features which enable you to extend and customize the language in a way that feels natural.

Unlike Objective-C categories, Swift extensions let you extend C types like CGContext and dispatch_queue_t.

If your project has both Objective-C and Swift, you may encounter an awkward moment when an Obj-C API just doesn’t feel Swifty enough. NS_REFINED_FOR_SWIFT to the rescue.

Mac OS X 10.11.2

Mac OS X 10.11.2 fixes the bug where Mail wouldn’t let you Option-Spacebar to page up. I’m seeing intermittent problems with account keyboard shortcuts no longer working, however. [Update (2015-12-15): Here is a script to remedy that.]

Safari continues to get stuck loading certain URLs, particularly from t.co.

I’m now getting errors from iTunes that it can’t connect to “Store Purchases.”

Sandbox test user accounts for the Mac App Store are now broken. When trying to launch my app, I get a “This Apple ID has not yet been used with the App Store” error message. If I go through all the setup steps in the store, it eventually wants a credit card.

Brad West reports that the application sandbox has (undocumented) tightened restrictions, which broke the Mac App Store version of his app.

Update (2015-12-11): Adam C. Engst discusses the iTunes error and others.

Update (2016-01-16): Nick Heer:

Happily, Timothy Hatcher has some good news:

We have a Radar and a fix identified. It is lower level than WebKit.

iPhone 6s Smart Battery Case

Apple’s new battery case has been getting a lot of criticism. The shape doesn’t seem like that big a deal to me, but I was disappointed to see Cabel Sasser’s report about the materials:

Apple Case. So heavy. Bump more uncomfortable than ugly. But iPhone is 96% at 6:53 PM. Conclusion: vacation use only

Oh also, if you get one, don’t get the dark one, this rubber material is like an Apple Swiffer for all the dust in your life and pockets

Why can’t they find a material that doesn’t collect lint or pull your pocket inside out?

Unless you really need a battery integrated into your case, I think most people would be better served with a simple external battery. I use the Jackery Bar, which has more than three times the capacity of Apple’s case. Even the smaller Jackery Mini and Anker PowerCore+ mini have higher capacities. They’re all much cheaper than Apple’s and will continue working after next year’s phone no longer fits in the case. Plus, you don’t have to hold the extra bulk the whole day. You can just connect the battery now and then to recharge.

Update (2015-12-10): Rene Ritchie:

Apple is routinely criticized for putting form ahead of function. In this case, though, putting function ahead of form has resulted in some of the loudest bouts of criticism in recent history.

The “hump” is the result of hard choices made during the design process. By not running the battery all the way along the back, and by not using rigid material to cover it, Apple can hide a hinge beneath the silicone. That hinge lets the top part of the case bend backwards so you can slide your iPhone in and then slip the case back over it.

[…]

Because of the Smart Battery Case’s design, the antenna bands are essentially covered only by thin silicone portion of the case.

Update (2015-12-11): John Gruber:

Me, I don’t like the way any of them look. But after using the Smart Battery Case for three days, and having previously spent time using the thinnest available cases from Mophie, I feel confident saying Apple’s Smart Battery Case feels better when you’re holding it than any other battery case, both because of the material and its shape.

[…]

The Smart Battery Case would certainly help with an overnight hiking trip, but I think Cook was off-message here, because that scenario is really not what it was designed for. Big 5,000 mAh (or more) external battery chargers (or the highest capacity, extremely thick battery cases from third parties) are far better suited to that scenario than the Smart Battery Pack.

[…]

After a few days using this case, my thoughts turn not to the Smart Battery Case itself but instead to my personal desire that Apple had made the 6/6S form factor slightly thicker.

That probably would have also made it more comfortable to hold.

However bulky the Plus feels in your pocket and hands, it feels less bulky to me than the iPhone 6S with any battery pack. An iPhone 6S Plus, even with a normal case on it, weighs noticeably less than an iPhone 6S with the Smart Battery Case.

Update (2015-12-14): See also: Accidental Tech Podcast.

Not Your Mac, Anymore

Mike Ash:

I can’t attach to TextEdit because of system integrity protection?

@millenomi:

the point of the thing is to prevent software to do damage to the system where a user gave their admin password.

Mike Ash:

How does preventing debuggers attaching to unimportant processes match that intent?

Mayur Pawashe:

you may be able to copy TextEdit to your Desktop and attach to a running instance of it, if SIP is still broken in this way

Milen Dzhumerov:

the ominous wording when you disable SIP seems quite worrying: “… is an unsupported configuration, likely to break in the future…”.

Rosyna Keller:

TIL rootless has the ability to disable protections for one specific class if you only need to change one thing!

Update (2015-12-10): Paul Kim:

I can’t attach to SysPrefs with SIP. We’re not talking about hacking things here. SysPrefs has a officially sanctioned plugin API.