Stuart Breckenridge

GameKit Replaced in iOS 9 Beta 3

One of the smaller changes I overlooked in the iOS 9 Beta 3 API diffs was that GameKit had been replaced with GameCenter. Attempting to run an app without making changes led to a strange error with the YouTube.framework:

dyld: Library not loaded: /System/Library/PrivateFrameworks/YouTube.framework/YouTube  
  Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/ReplayKit.framework/ReplayKit  
  Reason: image not found

To resolve, link to the GameCenter framework and replace:

import GameKit

with

import GameCenter

Microsoft Restructures Phone Business

Microsoft News Center:

“Microsoft also announced the reduction of up to 7,800 positions, primarily in the phone business. As a result, the company will record an impairment charge of approximately $7.6 billion related to assets associated with the acquisition of the Nokia Devices and Services (NDS) business in addition to a restructuring charge of approximately $750 million to $850 million.”

“Microsoft also announced the reduction of up to 7,800 positions, primarily in the phone business. As a result, the company will record an impairment charge of approximately $7.6 billion related to assets associated with the acquisition of the Nokia Devices and Services (NDS) business in addition to a restructuring charge of approximately $750 million to $850 million.”

Microsoft


It’s hard not to see this as both a failed investment and the beginning of the end for Microsoft built Windows Phone hardware.


When Does Windows 10 Launch?

“Starting on July 29, we will start rolling out Windows 10 to our Windows Insiders. From there, we will start notifying reserved systems in waves, slowly scaling up after July 29th.”

Microsoft


Windows Insiders get it July 29th. Easy to understand.

“Soon, we will give a build of Windows 10 to our OEM partners so they can start imaging new devices with Windows 10.”

Microsoft


OEMs get it soon.

“Soon after, we will distribute a build of Windows 10 to retailers all over the world, so they can assist their customers with upgrades of newly purchased devices that were originally imaged with Windows 8.1.”

Microsoft


Retailers will get it soon after.

And for end-users that just want to download it and upgrade from Windows 7, 8, and 8.1, when do they get it? With few concrete dates, the release plan doesn’t strike me as confident.


Singapore Botanical Gardens Added to UNESCO World Heritage List

“Situated at the heart of the city of Singapore, the site demonstrates the evolution of a British tropical colonial botanic garden that has become a modern world-class scientific institution used for both conservation and education. The cultural landscape includes a rich variety of historic features, plantings and buildings that demonstrate the development of the garden since its creation in 1859. It has been an important centre for science, research and plant conservation, notably in connection with the cultivation of rubber plantations, in Southeast Asia since 1875.”

UNESCO


It’s quite an incredible place.


David Cameron: No Safe Space From Government Snooping

“David Cameron was replying in the House of Commons on Monday to a question from the Conservative MP David Bellingham, who asked him whether he agreed that the “time has come for companies such as Google, Facebook and Twitter to accept and understand that their current privacy policies are completely unsustainable?” To which Cameron replied: “we must look at all the new media being produced and ensure that, in every case, we are able, in extremis and on the signature of a warrant, to get to the bottom of what is going on.”

Glyn Moody


How can this be achieved without implementing backdoors in every type of encryption on messaging platforms? iMessage is great example of an everyday service that’s encrypted end-to-end1, with no way for Apple to decrypt the messages in transit or on device.

It’s simply not possible to achieve what the Conservative government want without building backdoors into encryption. And building backdoors for one group means building backdoors for everyone.

  1. Read the iMessage section of the iOS Security Guide↩︎


Apple Music Availability

Apple Music is finally live and everything works for me, except Beats 1, which throws a 403 error.

It turns out Beats 1 isn’t available in Singapore. If you’re receiving the same error check out the list of countries with Apple Music availability just published by Apple.


Meet bPay – Barclays answer to Apple Pay.

Just spotted this on The Next Web:

“British bank Barclays would prefer if you used its own hardware to pay for your next purchase rather than your phone. It announced today three ‘bPay’ devices for making your next payment: a wrist wearable, a keyfob and a sticker for your phone.”

  • A wrist wearable that only allows you to pay for things. No fitness or time keeping features. It’s certainly focussed.
  • The keyfob is acceptable: it’s small enough that it wouldn’t get in the way.
  • The sticker isn’t even something I’d consider - it detracts from the design of the phone.

The clincher? Barclays expect you to pay:

“bPay devices will be available from July 1, starting at £14.99 for the sticker, £19.99 for the key attachment and £24.99 for the wearable wristband.”


Fitness Bugs in watchOS 2 and iOS 9

I’ve been using watchOS 2 and the iOS 9 betas for app development, but with a marathon coming up I thought I’d see what state the fitness and activities apps were in. Below are the issue I’ve come across:

  • Activities glance UI is distorted. (Radar: 21582510)
  • Activate on wrist raise during workouts is slow. (Radar: 21582523)
  • Watch OS 2 and iOS 9 do not connect to external heart rate monitors. (Radar: 21582562, 21582581).

Another important note for those considering the update to the watchOS 2 beta: there is no known downgrade path back to watchOS 1.0.1. Apple hasn’t announced an equivalent to the iOS DFU mode. If you upgrade you need to stick with watchOS 2 for the entire beta cycle.


Optional vs Empty Table Views in Swift

A recent post on Natasha The Robot looks at different (but equally valid) approaches for handling the display of data when table views are empty or optional.

I prefer a variation on the non-optional approach using the didSet observer.

// Tableview Data Source
var dataArray = [String]() {
        didSet {
            dataTable.reloadData()
        }
    }

didSet is not called during initialisation of the array, so using the observer ensures that the tableView isn’t reloaded until a new value is set.

In viewDidLoad, I hide the tableView until data is available:

override func viewDidLoad() {
        super.viewDidLoad()
    
        // Hide TableView 
        dataTable.alpha = 0.0
        
        // Load TableView
        loadTableViewData()
    }

loadTableViewData parses JSON in the background and passes an array back in the completion handler (which is called on the main thread)1:

private func loadTableViewData()
    {
        // Show indicator while loading.
        UIApplication.sharedApplication().networkActivityIndicatorVisible = true
        
        let parser = JSONParser()
        parser.parseJSON { (list) -> Void in
            // Hide indicator, set dataArray to list, show tableView
            UIApplication.sharedApplication().networkActivityIndicatorVisible = false
            
            self.dataArray = list
            
            UIView.animateWithDuration(0.2, animations: { () -> Void in
                self.dataTable.alpha = 1.0
            })
        }
    }

In the UITableViewDataSource functions, there is no need to consider optionals:

extension ViewController: UITableViewDataSource
{
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return dataArray.count
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as UITableViewCell!
        
        cell.textLabel?.text = dataArray[indexPath.row]
        
        return cell
    }
}

I’ve uploaded a sample project to GitHub which contains some sample JSON.

  1. I’m using networkActivityIndicatorVisible as a placeholder to show parse progress. ↩︎