Five Ways To Speed Up Your iOS Apps

Donnel, a full-time iOS developer  since 2008 whose app credits include Pinbook for Pinboard, shared some tips to a packed room at AltWWDC, which we have been all over like an snuggle iPad case. He divided them into practical and philosophical, but they sort of blend together.

Here are some of his main pointers:

  •  Slow down in the beginning.

Think a lot more before you start and design the code first.
“As coders, we want to be pressing the buttons right from the beginning, but that’s not always the best approach.”
He recommends going to the drawing board with OmniGraffle or a mind mapping app such as Mind Node to get your ideas down before you start typing. “Designing the code provides a roadmap, that way you can see where bottlenecks are up front. Often you’re making same mistakes and looking at it before you start can sometimes prevent that.”

  • If you want fast, make sure you’re test driving a Ferrari, not a Fiat.

Donnell admits to being a “pretty naive” when testing downloading and parsing data for Pinbook, a pin board whose API works a bit like Delicious. It seemed fast enough when he tried it on his own 300 or so bookmarks, but as it turned out, heavy users had more like 30,000 or 40,000 bookmarks. The app definitely wasn’t going to be useful if it took 10 minutes to synch.

  • If you need high performance don’t be afraid to take a different direction, try something a little a harder or learn something.

He needed to get that lag time down from a leisurely seven minutes to a few speedy seconds, and the way to go ended up requiring a change to LibXML streaming SAX parser, which can download as it parses. The other speed enhancer was to figure out a way to fetch objects that have been updated without a fetch request while parsing. The lesson was: however much caching you have to do upfront, it will always be faster than a bunch of fetch requests. Getting a change signature would tell if something had changed and one fetch request with core data would do it.

“I didn’t know what was going to work and there wasn’t a lot of documentation. That was a hard edge for me to bump up against,” he said. “But if you’re not into it because hard things are fun, maybe it’s not for you.”

  • Google may be your best friend

Donnell swears by this method for performance issues, especially when he’s been handed an app that someone else developed.
First load the app in instruments, then tweak the settings so it shows you the reverse call tree. At that point, you have an idea what’s causing the issue. Then Donnell says he pastes that into Google, adding in the word “slow” after. “You’d be surprised how many times someone has written a really detailed blog post explaining why it’s faster to turn it into an NSData and get the range of the comparison there” and voila’, your sluggish app is now back on track.

“We all like to write blog posts about all the fun things we discover,” he said, so harness that. On the flip side: help those who come after you by sharing the cool thing you found out.

  • Six degrees of Kevin Bacon is fun at a party, but not for your code

Any time you can, favor a more direct connection over a less direct one, so you can follow the path of the code from component to component. And keep those components as small as possible, so you can pull it apart to speed things up. “If writing a delegate is more typing but I know it’s the better thing to do, that’s what I’m going to do…When I do something less direct, it ends up creating problems. You can’t figure out why there are six degrees of Kevin Bacon sending out a notification” and you’re stuck.

“I’m not smart enough to write code that bad. To me, bad code that doesn’t perform well is usually complicated code, so I usually keep it simple. If I were smarter or had a computer science degree I’d probably be better at writing stuff that performed worse.”


WWDC wrapup: iOS 7, iTunes Radio’s value, and a newly confident Apple

Apple’s WWDC announcements – and particularly the unveiling of iOS 7 – have already reverberated around the tech industry. Here’s your guide to what has happened, and what it means.

• iTunes Radio could make Apple (and labels) quite a bit of money
There are 575 million iTunes accounts (most with credit cards) and Tim Cook said “iTunes in the cloud” has 300 million users. If that’s the same as iTunes Match (where you can download songs to up to five devices using the same iCloud ID), that’s a hell of a lot of people who are listening to their music on multiple devices. (Even if he actually meant devices rather than users, it’s still 60 million.)

Even if just one-third of 300 million people upgrade their version of iTunes to take advantage of iTunes Radio (which is free if you pay for iTunes Match; ad-supported otherwise) then Apple will be paying out large sums of money.

The standard streaming rate is 0.085p per track played. Apple has probably organised a lower price. But for the sake of argument, if 100m people listen to 200 songs per month, equivalent to 10 hours – the ceiling that Spotify presently puts on free listening, that’s £8.5m per month going to the labels. Essentially, it’s free money for them. Apple can sell ads against it; you can debate whether it will manage to sell that much advertising. At the worst, it could kick-start the iAds mobile advertising business by giving it a new source of inventory (the space ads are sold into).

But iTunes Radio will also offer one-click purchasing of songs and that’s where the advantage comes. Apple is reckoned to keep between 4p and 12p per song sold. That means it only needs to make about one sale per 50 listens, and it’s breaking even (ignoring streaming costs). If Genius, which has been going for five years, is any good at all, it should be finding songs that you’ll want to listen to – and even buy – all over the place. If Apple has negotiated a lower rate, and keeps more money from each song sale, then the number of “sales per listens” needed to break even falls further.

iTunes RadioiTunes Radio: the translucency effect makes it look blurred – but note the ‘Buy’ button

So it might be free and ad-supported, but it’s got a potentially big financial upside, both for labels and Apple. And users get free ad-supported music. (The devil might be in how much advertising has to be tolerated in those 10 hours. For free accounts, Spotify plays one 30-second advert per 20 minutes, plus displaying adverts on its app.)

An interesting contrast is that Google’s streaming music service will be paid for. Why? I suspect it’s because Google simply doesn’t have the scale that Apple does in terms of Genius data or potential users. Making its service paid-for ensures that it only gets those who find it valuable, not those who just find it convenient, and so increases its chance of keeping within break-even.

• Maps: an app and some feedback
Apple Maps are coming to the desktop as an app in Mac OSX 10.9 (“Mavericks”). Sources tell me that Apple is acutely aware of the annoyance Maps has caused, and of the extra annoyance (asenunciated by people like former Apple staffer Daniel Jalkut) caused when suggested changes don’t seem to get fixed. An improvement to the feedback process is in the works.

Maps is also getting some of the intelligence that Google Now and Windows (phone and desktop) have – such as pointing out that you have to leave a certain amount of time to reach your next appointment. Apple has a lot to prove here, but the incorporation of its Maps app into the forthcoming “Mavericks” desktop OS is further demonstration that it’s trying to winkle Google out of the default position it holds in many places. (Default location searches on Mac OSX presently offer Google Maps.)

• iOS 7: the “supergroup” of mobile operating systems
Remember when big rock bands used to form “supergroups” composed of the singer from one band, the bassist from another, the guitarist from somewhere else and a drummer, with the notion that the sum of these exalted parts would be better than the rest? That’s something like what iOS 7 is. It’s taken lots of ideas from other operating systems – Android, Windows Phone, webOS – and synthesised them into what was already there in iOS. (So mathematically it’s also a supergroup.)

Lots of people who have only seen photos of iOS 7 think that it’s “flat”. (That was my initial reaction when it was being shown on stage.) In fact, it’s not. I used an iPhone running iOS 7 briefly on Monday, and while the icons themselves give the impression of living in a single plane – very much like Windows Phone – there are other layers present too. The wallpaper behind the icons has a parallax effect, so if you move the phone it seems to have depth. (It can be turned off. A fun version would be a parallax effect that makes the phone seem deeper than it actually is.)

There are then at least two other layers – Notification Centre (which swipes down from the top) and Control Centre (which swipes up from the bottom). Control Centre has translucency overlaying what’s underneath it, while the keyboard in some apps (such as iMessage) also seems to have an element of translucency.

According to Jonathan Ive, who has driven the team to do the redesign, “these planes, combined with new approaches to animation and motion, create a sense of depth and vitality … Even the simple act of changing your wallpaper has a very noticeable effect on the way your iPhone looks and feels across the entire system.” Using translucency, he says, “gives you a sense of context”.

Apple adds iPhone ‘kill switch’

Amidst all the hype around the new iOS and Mac Pro, one pretty big new feature was left out of the conversation – a new ‘kill switch’ for the iPhone.

The feature, known officially as ‘Activation Lock’ will be part of iOS 7, which is compatible with iPhone 4, 4S and iPhone 5, along with recent iPod Touch and iPads.

Apple will add kill switches to all its mobile devices, not just iPhones.

The kill switch will require an Apple ID and password before the phone’s “Find My iPhone” feature can be turned off or any data can be erased. Apple also confirmed at WWDC the same ID and password will be needed to reactivate a device after it’s been remotely erased.


Apple said the update will make its devices less tempting for thieves, and give users greater peace of mind.

“We think this is going to be a really powerful theft deterrent,” said Craig Federighi, senior vice president at Apple said at WWDC.

Theft of mobile devices is on the rise, CNN is reporting that in New York for example a special police unit has been set up to specifically handle stolen mobile devices.

The overall crime rate in the city increased 3% last year but “if you subtracted just the increase in Apple product thefts, we would have had an overall decrease in crime in New York,” New York’s Deputy Police Commissioner Paul Browne told the channel.

Here’s Everything That’s Changed Since Apple Announced The iPad Mini — 230 Days Ago

Apple is going to take the stage on June 10 at its Worldwide Developers Conference to announce a new version of iOS, the operating system that powers the iPhone and iPad.

This will be the first time we see an Apple event focused entirely on products since October. That’s 230 days between product events, the longest gap in Apple’s recent history.

The tech industry moves very quickly, and nothing proves that more than taking a look at how much has changed since Apple’s last big product announcement.

Apple working on large screen iPad Maxi tablet: Report

It looks like Apple is working on a new large screen iPad if a new report is to be believed.

According to a new report by Korean website (via Unwired View), Apple is working on a new larger iPad with a 12.9-inch diagonal screen that would be called iPad Maxi. It goes on to add that this iPad variant would launch in the first half of 2014 and would take on Ultrabooks. It would also target the educational market with digital textbooks. The report cites industry sources to report that Apple is in talks with display and component manufacturers in Korea for supplies.

We’ll take this rumour with a grain of salt as we’re not sure if Apple would go beyond the 9.7-inch tablet form factor given that it would compromise the device’s portability. Previous rumours have suggested that Apple is indeed working on making the iPad slimmer in line with the iPad mini’s form factor. Also, of late the iPad mini has done pretty well and has even eaten into the full-size iPad’s market share, so we’d rather like to believe that Apple would focus on upgrading the mini at this point in time. A large sized iPad would also require developers to make changes to their apps to support the tablet’s display unless it comes with a low resolution screen. Another reason would be the presence of Macbook Air, which are Apple’s most portable full-capability computing devices. We’re not really sure that a market for large sized tablets exists.

It’s worth pointing out that Apple still remains the top tablet seller although Android tablets are showing increased presence thanks to low cost devices from Asian sellers. Tablet shipments reached 49.2 million units in the January-to-March period, according to IDC. Apple’s iPads accounted for 19.5 million units out of these. Android tablets accounted for 56.5 percent of shipments in the March quarter, compared to 39.6 percent for iPads. Tablets running Microsoft’s new Windows and Windows RT platforms accounted for 3.7 percent of total shipments.

Apple iRadio coming this summer, says record label executive

Spotify and the likes, you have a reason to worry. We have word that Apple’s own music streaming service iRadio is looking dead on for a summer release.

Buried in a feature on The Verge is an interesting paragraph that says negotiations between Apple and several major record companies are ongoing and that the Cupertino company is in the advanced stage of talks with two of the market leaders – Universal and Warner.

Needless to say, if Apple manages to wrangle a deal with those two, the other players are bound to follow in the fear of missing out on a good thing.

At the moment, it is unclear if the radio service will debut with the next iPhone or will be a separate launch. Here’s the tale from the source: “Much has been written about Apple’s plan to launch a Pandora-esque service this year.

Now multiple music industry insiders have told The Verge that significant progress has been made in the talks with two of the top labels: Universal and Warner. One of the sources said ‘iRadio is coming. There’s no doubt about it anymore.’ Apple is pushing hard for a summertime launch.”

Earlier this month, reports said Apple was offering half the royalty that Pandora, another popular music streaming service, pays. Apple wants to pay 6 cents per 100 song streams while Pandora currently pays 12 cents per 100 plays.

Apple ID security improved with new two-step verification option

Apple on Thursday improved its security system for Apple ID accounts tied to services like iCloud and iTunes, offering users two-step verification for when making changes to an account.

The feature began rolling out to Apple ID owners on Thursday, and allows those with accounts for services like iCloud, the iTunes Store, App Store and others to enable it on the Apple ID website.

Once two-step verification has been turned on, a user can receive verification codes on their mobile device, such as an iPhone or iPad. On iOS devices, the codes are received via the Find My iPhone application, while other handset users can receive the code via text message.

Once the code arrives, an iOS lock screen will display the notification that users must “unlock to view your verification code.”

Apple also offers users the ability to have a recovery key as a precaution, in the event that their mobile phone tied to the account is lost or stolen.

Apple Analysts Expect New iPhone In The Fall, Larger-Screen iPhone, SmartWatch in 2014

No iPhone 5S until September or October. A smartTV at the end of 2013. Larger-screen iPhone and smartwatch in 2014. A new killer service around mobile payments. A China Mobile deal for the iPhone – finally.

Those are some of the takeaways from comments made by Apple CEO Tim Cook yesterday after the company reported second-quarter earnings. To be sure, Cook never mentioned the iPhone 5S or said anything about a smartTV or smartwatch or a mobile payments service. What he did say is that Apple is “ hard at work on some amazing new hardware, software and services that we can’t wait to introduce this fall and throughout 2014” in “exciting new product categories.”

And in response to a question about whether Apple might create a version of its smartphone with adisplay that’s larger than the 4-inch used in the iPhone 5, Cook said, basically, not right now. “Our competitors have made some “significant tradeoffs” in many of these areas in order to ship a larger screen. We would not ship a large-display iPhone while these tradeoffs exist.”

That was enough to get Apple analysts’ speculating on what the company might announce this fall and into 2014.

• Gene Munster, Piper Jaffray: “Apple CEO Tim Cook mentioned that the company is looking at adding new services and new product categories. We do not believe Apple has hinted to new product services and categories in the past, making Cook’s comments tangible evidence innovation is alive at Apple. We believe the new product categories will include both a television to be announced at the end of 2013 and a smartwatch in 2014. We also expect a digital wallet offering in iOS7 or iOS8 (2013 or 2014)…. We continue to expect a larger screen iPhone in March 2014. Cook’s comments all but eliminate a larger screen iPhone in the near term suggesting Apple would not trade a larger display at the expense of battery life and quality of display.”

• Katy Huberty, Morgan Stanley MS -0.74%.“March results beat our model but lowering June and September quarters to reflect slow sales and lower average selling prices ahead of new products. Apple provided increased transparency into the timing of new product launches (“Fall and throughout 2014”), which implies a September iPhone launch, in-line with supplier data points… Perhaps most interesting was Apple’s increased focus on content/software/services, which hit a $16B+ annual revenue run rate, up 30% Y/Y. Apple also broadened its comments on product pipeline to include software, services, and new product categories. Most interesting to us is the potential for a killer service, like mobile payments, to better monetize the 500 million plus account base and drive further differentiation and share gains in mobile devices.”

• Amit Daryanani of RBC Capital Markets.“There was plenty for both bulls and bears to hold onto during the March-quarter call. Bulls will point towards – better capital allocation and new product launches, while Bears will focus on declining gross-margins and delays in new launches. We believe the stock is stuck in a trading range ($375-425) till we witness the launches in “fall” time frame…While the guidance was softer than expected the increase in capital allocation and iPad growth should help Apple return to double digit growth, post product-line refreshes. Future revenue catalysts could include an iTV or the addition of China Mobile.”

• Ben Reitzes, Barclays Capital. “Apple issued guidance for $7 in EPS for the June quarter. While this guidance may provide a “jolt” to some investors, it does serve the purpose of reigning in outlandish predictions while maintaining margins above the key 36% level and helps make the stock investable into new product cycles that likely start in September (with builds hitting in June). The share repurchase also could help smooth the ongoing transition from growth to value holders. While the reception of the iPhone 5 and execution of late has tested our patience, the cash announcement, performance and guidance sets Apple up better into product cycles predicated on platform/service innovations.”

Apple posts $9.5b profit on $43.6b in revenue

Apple just posted its hotly-anticipated Q2 2013 earnings, and the company posted a profit of $9.5b on revenues of $43.6b, compared to $11.6b in profit on $39.2b in revenue this quarter last year and $13.1b in profit on $54.5b in revenue last quarter. That’s right in line with the company’s guidance from last quarter.

At the same time as releasing its earnings report, Apple also announced an expansion of its share repurchasing scheme, authorizing a $60 billion buyback — a $50 billion increase from last year. To do this, Apple says it will utilize $100 billion of cash until the end of 2015. It also released a few extra stats related to its iOS ecosystem and iCloud: It’s now distributed over 45 billion apps through the App Store (up from 40 billion in January), and says it’s paid out $9 billion in royalties to developers.

The final milestone announcement of the day was on iCloud, Apple’s cloud platform that encompasses iMessage and other services across iOS, OS X, and the web. The company says iCloud has now reached 300 million users after less than two years in operation. Apple CEO Tim Cook and CFO Peter Oppenheimer will be discussing the results with analysts at 5PM ET — you can follow our live blog for all the news as it happens, and you can listen along here.

Apple Lets Employees Leave And Come Back After Two Years And Keep Their Seniority

Here’s an interesting quirk of Apple‘s HR process.

According to tech blogger John Gruber of Daring Fireball, Apple employees can leave the company, and then return after two years without losing their seniority.

Essentially, they can quit, but if they come back in two years, it’s like nothing ever happened. They don’t get credit for two more years of work, but they don’t lose their spot at the company.

The employee has to have been at Apple for 10 years, though, says Gruber.

Gruber dropped this nugget on his podcast, The Talk Show.

Contrast this with a place like Bloomberg LP, which tells current employees to shun anyone that leaves the company. In a Seth Mnookin profile of Mayor Bloomberg, he quotes these excerpts for The Bloomberg Way, a manifesto for Bloomberg LP:

“When someone departs, those of us who stay are hurt.… We’re trying to feed our families, and his or her leaving makes that task more difficult. Him or her, or my kids? That’s an easy choice!” Later, Bloomberg/Winkler writes, “The Bloomberg philosophy may sound strange to ‘outsiders,’ but not to those who matter—us. We’ve always assumed that even if we’re paranoid, they probably are out to get us. While you’re reading this, we’re thinking about how our competitors are plotting to take the food from our children’s mouths.” If employees left to work for a competitor, “they’ve become bad people. Period. We have a loyalty to us. Leave, and you’re them.” There was even a policy against rehiring anyone who quit for anything other than family reasons: “How could we ever again look in the eye the one who stayed if we let the ‘traitor’ come back?”

Apple is a secretive, insular place so one might suspect its policy would be closer to that of Bloomberg. Instead, it’s “enlightened” in the words of Gruber. It gives people a chance to try something else and not burn out on Apple.

Gruber says Apple doesn’t have sabbaticals, so this two-year leave policy is a quasi-substitute.

When Steve Jobs came back to Apple, he banned sabbaticals. A lot of people were taking their two year sabbaticals and then quitting. So, Apple just says, quit up front. And if you change your mind, then come back.

This is also smart, says Gruber, because one of the biggest threats for Apple is a brain drain. However, if it’s easy for Apple’s employees to return, it’s less of a threat.