Nineteen Step Process to Faster Apple Watch Button Actions

The upcoming release of Grocery focuses on speed. We can all agree that the main thing your app does should be fast, and for Grocery that's checking items off your list. As we added features to the apps the performance of checking items off a list slowed down - a lot. For some users, checking off items could take 3-4 seconds on iPhone, and 5+ seconds on Apple Watch. We needed to address that now before adding more features.

The problem on iPhone was simple to understand and solve using Instruments. When you mark an item off your list on the iPhone, we were waiting for the update to Reminders to finish before moving the table cell. Making that update asynchronous and moving the cell immediately solved the problem. When you mark an item off your list now, the list update happens instantly, just like it should be!

The problem on Apple Watch was harder to understand and harder to solve, and that's the focus of this blog post. Troubleshooting performance on Apple Watch can be tricky. You can try to identify red flags if they exist by running Instruments against the simulator, but the only way to truly evaluate performance on Apple Watch is with the physical device itself. Everything that seems slow on device will feel completely normal on the simulator. You have to test on hardware to solve the problem.

Grocery's Apple Watch app is very simple - just one table view where tapping on a cell checks the item off your list. That's why this particular issue was so perplexing: the app isn't doing anything that seems too complicated. When an item button is pressed, the app sends a message to the iPhone to tell it which item was checked off, and then removes the cell from the table view. The app isn't updating the Reminders database itself, so why is it so slow? Time to investigate!

This blog post describes my nineteen step process to faster buttons on Apple Watch, which is composed of the following individual steps that can be used repeatedly starting with the first one:

  • Disable Everything and Re-evaluate Performance
  • Refactor/Extract Functionality As You Go Into Their Own Methods
  • Start Adding Trivial/Simple Functionality Back
  • Turns Out Some "Trivial" Functionality Actually Hurts Performance
  • Identify Major Problem Areas and Either Improve or Remove Them
  • Put it All Together and Test The Final Version on Device

Step 1 - Disable Everything and Re-evaluate Performance

When tapping on a button feels slow on the Apple Watch the best thing to do is remove everything from the IBAction method and test it again. Button taps should feel as close to instant as possible on the watch. That's a major focus for watchOS 4 with the Unified Process Runtime - making touch interaction feel even faster and more reliable. If you remove everything from your action method and performance returns to normal, then you know something in that method is causing the slow down.

Commenting out the implementation also made me realize just how much functionality had been added to that button press action over time. What started out as a very simple method now included a laundry list of functionality:

  • Update the Apple Watch's Sorting Database
  • Updating the Table Data Model
  • Removing the Table Cell
  • Sending a WatchConnectivity Message to the iPhone
  • Playing a Haptic Feedback
  • Updating the Remaining Items Count
  • Hiding a Placeholder Group
  • Updating the Complication

Sure enough, after commenting all of that out things felt fast again. This approach is also very motivating because you get to see how fast it can feel which makes you want to achieve that performance with the rest of the functionality restored.

Step 2: Refactor/Extract Functionality As You Go Into Their Own Methods

While you're working on the button action method I think it's a great idea to refactor and re-organize the functionality of that method into smaller methods with a single responsibility. As I had been adding features and functionality to that button action I had just been adding them to the same method. I took this opportunity to move each area of functionality into its own method. This has the dual benefit of cleaning up the code as well as making it easier to see what you're turning on and off while evaluating button performance.

Step 3-7: Start Adding Trivial/Simple Functionality Back

I started adding functionality back one piece at a time, beginning with the most trivial pieces that I assumed wouldn't have any impact on performance. I installed a new device build after each piece to test performance on a physical watch. 

Most of the trivial features didn't affect performance at all. Haptics and hiding the placeholder group had no impact. Drawing a strike-through line through the item label with an attributed string didn't seem to hurt. Removing the table cell and removing the item from the array didn't hurt either.

Updating the remaining item count was the first place that I noticed a small change in performance. That involved counting the number of remaining items and updating the Interface Controller's title property. The change was barely noticeable though, so I decided to keep that feature in.

Step 8-10: Turns Out Some "Trivial" Functionality Actually Hurts Performance

The next seemingly trivial feature I added back to my button action was updating the complication. Updating the complication isn't slow on its own, but the way I was updating the complication was triggering a reload from the Reminders database. When I added this method back to my button action performance slowed down considerably. Once that happened it gave me an area to investigate further, which lead to identifying the database reload. By addressing that issue I was able to reload the complication after marking an item off the list without hurting button performance!

Step 11-18: Identify Major Problem Areas and Either Improve or Remove Them

The two major problem areas turned out to be updating the sorting order on the watch, and sending the message to the iPhone to tell it which item was marked off the list.

Updating the sorting order was actually completely unnecessary. In an earlier version of the Apple Watch app we had been moving marked off items down to the bottom of the list instead of removing them. Removing them from the list made more sense because of the small size of the Apple Watch screen. When we changed that behavior we didn't remove the sorting change - which was actually a pretty significant performance penalty. Removing that made a huge difference!

Sending the message to the iPhone using Watch Connectivity made more of an impact than I expected it would. Making that method call asynchronous by calling it on a background queue made our button action feel a lot faster, so that was the only change we needed to make there.

Step 19: Put it All Together and Test The Final Version on Device

Once all of the button action features are refactored, removed, disabled, moved, or improved then it's time to put it all back together and test the final product out to make sure that all the effort actually made a difference in performance. After a few days of testing it's definitely feeling like a big difference.

 

Conclusion

Troubleshooting performance on Apple Watch can be tricky but the effort is well worth it, especially for a device intended for small and quick interactions. It's truly a device where every second counts, and a little bit of testing can help make the difference between an app that feels fast and an app that feels too slow to use. Even with the upcoming improvements to app performance with watchOS 4, anything that we can do to help our apps feel faster will make a big difference for Apple Watch users.

Introducing Grocery - An Opinionated Shopping List App for iPhone and Apple Watch

I'm excited to introduce Grocery, a new app that Ryan Considine and I built specifically for grocery shopping with the goal of making trips to the store more efficient. We started the project with a question — what if our app knew the path we took through a store, and how would it use that to make the trip more efficient? What we are launching is a simple shopping list with a focused interface that includes a lot of intelligence to always keep your list sorted in the order that you shop.

 Grocery for iPhone

Grocery for iPhone

Smart Sorting

Sorting a grocery list is no small task. There's no end to the variety of different ways that people shop. Paper lists are still very common, and people have different ways of manually sorting their lists. Grocery store layouts are almost as varied as individual people's shopping behavior — even among the same chain of stores. Some stores have tried to solve this problem with technologies like geolocation and beacons, but those are expensive to install, unreliable to use, and just haven’t caught on.

We wanted to build something that would be easy and reliable for everyone to use, regardless of store location or shopping habits. Our first step was to create our own intelligent sorting algorithm that can learn from an individual's shopping behavior. This is a new approach that we haven't seen applied before, but we chose to pursue it because it doesn't require hardware or analytics, or even a user's location to build a custom sorting order.

The algorithm we built learns from each trip you make to the store and sorts based on the order you shop for items and check them off your list. All of this analysis is taking place on the user's phone and stored locally. We aren't doing any machine learning in the cloud — not just for privacy reasons, but because there's no need. Everyone shops differently, and we don't need to learn from someone else's behavior to build a better sorting order for you.

Let's say you make a trip to the store for a few essentials, in this case:

  • Eggs
  • Milk
  • Avocados

You move through the produce section of the store first, and this was the order that you picked up the items and checked them off your list:

  • Avocados
  • Eggs
  • Milk

From now on, Grocery knows that Avocados come before Eggs and Milk. The next time you go to the store and only need to visit the produce section, but added a few new items to your list:

  • Kale
  • Carrots
  • Onions
  • Bell Peppers
  • Avocados

After this trip to the store, Grocery knows how to sort all of these items relative to each other, and because you previously shopped for Avocados, it also knows that these items all come before Eggs and Milk. If your next trip to the store is for Kale and Eggs, Grocery will know which item comes first and sort your list accordingly.

 

Apple Watch

 Grocery for Apple Watch

Grocery for Apple Watch

Efficiency in the store is our number one goal for Grocery, and an even more efficient place for the app is on the Apple Watch. We learned early on that the Apple Watch was a great device to use at the grocery store because it keeps your hands free to hold items or push a shopping cart.

We wanted the Apple Watch experience for Grocery to be the best possible. To that end we actually built the Apple Watch UI before we started on the iPhone. We spent a lot of time optimizing it to be as fast as possible - which is key for third party watch apps.

Always having your Grocery list in sorted order is the key to an efficient and effortless user experience on the watch. Because your list is in order, the item you just put in the cart that you’re looking to check off is visible immediately after raising your wrist without your needing to scroll to find it.

Raise your wrist, tap the item to check it off, look at the next item on the list, and lower your wrist. It’s a very quick interaction that makes shopping with the Apple Watch feel easy and efficient.

 

Adding Items

We also wanted adding items to your list to be as simple and fast as possible. The iPhone UI for adding items is optimized around speed and efficiency. The text field for adding an item and associated notes is always present at the bottom of the screen, within easy reach. Tapping the + button after entering an item keeps the keyboard up, ready to enter more items. And we built our own autocomplete system that populates from your personal history of purchased items, making repeat entries fast and easy.

You can also add items to the list on your Apple Watch, via dictation or scribble, or by picking a past item to add back to your list. We've all been in places where using our watch to do something is simpler than taking our phone out, and we wanted to make sure Grocery supported that use case.

But we didn't stop there. You can also add items to your Grocery list from the Mac, iPad, iCloud, and Siri! And even, via IFTTT, from Alexa. That's because Grocery is built on top of the iOS Reminders database, which supports shared lists on iCloud. When you start using Grocery, we prompt you to create a new list called "Grocery" (which you can change if you want to), that can be edited from any device with the Reminders app, or access to iCloud.com.

Support for Siri is something we've really grown attached to. Even the phrasing is simple with the default list name — "Add Eggs to my Grocery List", and items show up immediately after they're added. Voice assistants like Siri and Alexa work great in kitchen settings, and adding items to your shopping list that way is a great example of why.

And finally, because we're supporting iCloud Reminders lists, you can also share your list with a partner or roommate, and they can add items to your shared list from Grocery or from the Reminders app. You'll each see the items the other added in your list - but each person will still have a unique sorting order based on the order in which each person shops for items.

 

Conclusion

Grocery is launching today as a free app that includes Google app install ads, with an optional in-app purchase to remove ads and support future development of Grocery. We love using the app and are excited to introduce it. We hope you enjoy it!
 

Thoughts on a New Mac Pro

Like many other pro Mac users I was very surprised and excited to hear that a new Mac Pro is in the works. I don’t think I actually believed the Mac Pro was dead, at least not deep inside. But I had certainly come to terms with never buying one again…until now.

Before the Retina iMac, I used pro Mac towers for almost 10 years. I used a Power Mac G5 from 2005 to 2010 and a Mac Pro from 2010 to 2014. If there’s anything I took away from the experience of using pro Mac towers, it was the incredible performance. When I upgraded to the Mac Pro in 2010 the dual PowerPC CPU’s in my Power Mac G5 still felt like they had more in the tank. Those Mac Pro’s are famous for their longevity - mine was still performing very well when my iMac arrived.

What I want out of a new Mac Pro is a return to that level of performance longevity. The old Mac towers were relevant for 5+ years after you bought one. They stayed relevant because they used the highest quality parts currently available and had some user-replaceable parts. In both towers I owned I upgraded the RAM several times after I bought them - eventually reaching max capacity as I could afford it and the system felt like it needed it. I upgraded the Power Mac’s GPU to an Apple-sanctioned optional X800. I upgraded the Mac Pro’s storage many times over the years before eventually installing PCI-e SSDs in the giant tower - a massive boost to storage performance.

When I moved away from the towers to the iMac I also moved all of my primary storage to external drive enclosures. That experiment was a success. Apple made a big bet on Thunderbolt for expansion. From my experience, that was the right move. My Mac Pro had 8 internal drives at the end (4 in the 3.5 bays, 2 in the optical bays, and 2 PCI-e slots). That setup was convenient, but it wasn’t necessary. Thunderbolt enclosures are more affordable and the available storage capacity of SSDs and cloud storage has risen significantly. There are plenty of options to choose from now to increase storage capacity and performance. I’m very happy with the Thunderbolt storage system that I’ve been using with my iMac.

The biggest concern I had with the Retina iMac was graphics. Unfortunately I think that concern was valid. The GPU industry is advancing at an incredible pace, and the lack of an ability to upgrade the GPU is going to limit how long my iMac stays relevant for performance graphics. I don’t blame the iMac for that - the iMac was never intended to have upgradable or full-size GPUs. But what I want from a new Mac Pro is exactly that: upgradeable industry-standard GPUs. The older Mac towers had upgradeable GPUs after a fashion, but it was clearly an edge case. I’d really like to see Apple focus on solving this particular problem for pro users.

The 2013 space-age cylinder Mac Pro cut a lot of features from the 2010 Mac Pro. Some of those include:

  • 3.5” bays
  • Optical bays
  • PCI-e Slots
  • FW-800

As a long time Mac tower user, I agree with all of those cuts except for PCI-e. Optical drives are clearly dead, and Firewire support is easily gained through Thunderbolt hubs for legacy drives. Storage expansion through Thunderbolt is a very reasonable option for virtually everyone - and for the folks that don’t want to deal with spinning disk enclosures, the price of large SSDs is very close to affordable levels. But dropping PCI-e expansion was a step too far. PCI-e is a requirement for upgraded graphics, and is a great option for a lot of other expansion, including storage. 

I’m 100% on board with the suggestion ATP hosts made in “Thermal Corner” regarding adding additional PCI-e SSD expansion ports to the new Mac Pro. That would be a great step forward and go a long way towards keeping these machines relevant for years after you buy one.

The other wish that I have for the new Mac Pro is this - keep at least two Thunderbolt 2 ports. I can see why Thunderbolt 2 might be on the chopping block for the new Mac Pro. USB-C may be the future, and I understand why Thunderbolt 2 was removed from the new MacBook Pro’s. But when Apple signaled the shift to Thunderbolt storage, a lot of pro users invested heavily in Thunderbolt storage setups for an iMac, 2013 Mac Pro, or MacBook Pro. Apple should make using these storage expansions as easy as possible for Mac Pro users, especially on a machine where storage expansion through Thunderbolt will be required.

So will I buy a new Mac Pro? I think I will. My iMac will be about 4-5 years old at that point, and out of Apple Care. I wasn’t kidding about the graphics not holding up on the iMac. The iMac used to run Blizzard games at high settings when it was released, but lately I’ve had to reduce all of the settings to fairly low levels. The CPU is still one of the fastest that Apple has shipped in a computer, and the display is still amazing, but I think the graphics performance could be enough to convince me to upgrade.

Apple Watch at 360iDev

Next week I'll be presenting a talk on developing apps for Apple Watch at 360iDev in Denver, Colorado. I've been wanting to go to this conference for a long time and I'm really excited to be presenting this year.

I've written and talked a lot about watchOS, and this time I'm going to try and share as much technical detail as I can about what it's like to develop for the watch. I think that watchOS 3 will make developing for the watch much more appealing for a huge number of teams and developers. I'm hoping that people who attend my talk will come away excited about building a watch app and ready to get started.

My only regret going into the conference is the other talk during my time slot is one I'd really like to see! There are so many great topics and speakers that I'm really looking forward to being there this year.

CocoaConf Yosemite

When I first heard about CocoaConf Yosemite I couldn't believe there was a conference designed around three very different things that I love: Apple, Photography, and the outdoors. I enjoyed the experience so much that I went back for seconds this year and had an even better time. The conference is returning for 2017, and I'm very much hoping to attend next year.

It's hard not to feel inspired in Yosemite National Park. Spending time outdoors has always been a great way for me to recharge, but the serenity you can experience in Yosemite Valley is quite unique. There really is nothing else like it. If this were just a tech conference then Yosemite would still be a very special setting that people would get a lot out of. But CocoaConf Yosemite is more than that. It's a place to focus on the human side of working in the technology industry and why what we do with technology matters to other people.

When I came to Yosemite last year I spent some time after the conference exploring the park. I had a chance to hike around by myself, which was a unique experience for me: I almost never go out hiking on my own. But it lead to some of the most amazing things I've had happen to me on the trail, like getting snowed in above Yosemite Valley!

 Snow! I woke up around 6am with a foot of snow outside my little backpacking tent.

Snow! I woke up around 6am with a foot of snow outside my little backpacking tent.

Getting out and hiking by myself was actually pretty far outside my comfort zone. But that also fits the theme of the conference, which really focuses on learning more about yourself. Pushing myself lead some amazing experiences, including witnessing the most amazing sunset I've ever seen, above Half Dome. A picture of the sunset from Cloud's Rest is my favorite picture that I've ever taken. But it's not just the picture I like, it's the experience that it represents. Talking to people in the valley to get ideas on where to hike to. Planning the hike and determining if I could make it safely to where I needed to go. Being totally isolated, knowing I was the only one witnessing this in person up in the snow, but being able to share the experience with people later through photographs. And knowing the whole time that I was out there doing something new that I enjoyed. Such is the power of exploring the outdoors, that just one sunset can mean so much to you.

 Sunset from Clouds Rest, overlooking Half Dome in Yosemite National Park.

Sunset from Clouds Rest, overlooking Half Dome in Yosemite National Park.

While I was exploring Yosemite that first year I had a few books with me. I read Becoming Steve Jobs by Brent Schlender, as well as Creativity Inc. by Ed Catmull. Both books taught me a great deal about leadership that I don't think I would have understood as well outside of a place like Yosemite. The conference and the environment were the perfect backdrop for listening to these types of stories.

This year leadership was a central theme at the conference, as well as another trait I wasn't expecting: vulnerability. I had started reading Daring Greatly by Brené Brown before the conference and I kept marveling at the similarities between what was being discussed in the conference talks and the themes of Brené's book.

Daring to be mediocre. The only thing between you and what you want to do is doing it. Be a little wild because we are in the wilderness. Be your own replacement. Challenge yourself. Having empathy for the point of view of others.

Many speakers told stories of using 31 day challenges as a way to coach yourself into doing something you were interested in but not comfortable getting started with. It takes courage to start something new, especially something you don't know you'll be good at. Daring to be mediocre helps you take a step towards something you want to achieve but are having trouble getting started with.

But the biggest takeaway I had from Yosemite this year was community, and how important it is. Sometimes it's easy to forget in the interregnum between WWDC's just how special the community is around the technology industry. The tech community is one that I think can be of immense service to others. I was so impressed by the talk Christa Mrgan gave on Civil Comments, a tool that is actually helping change people's behavior and positively influence the nature of discussion online. That's the type of impact we can have on the world, and I think it's a perfect example of why CocoaConf Yosemite is so great. It's about inspiring you to make a difference, in your team, in your company, in your community, in the world.

CocoaConf Yosemite is the best experience I've had at a conference. If you haven't been I highly encourage you to go. I'm hoping to return again next year.

App Launching on Apple Watch

Let me start by saying that I am very excited about watchOS 3. If I could have made a list and told Apple, "Here are the improvements I would like to see made to watchOS at WWDC this year" then I would consider that list to be thoroughly crossed off. A focus on performance, background updates for workout apps, and ditching the Friend button in favor of the new Dock are exactly what I wanted to see.

A lot of people watching the announcements caught that one notable Apple Watch feature was omitted from the commentary. The App Launcher, or Honeycomb / Home Screen, wasn't mentioned in the keynote or subsequent discussion about how users interact with Apple Watch. The subtext is clear. I don't think Apple intends or expects people to interact with their watch by launching apps from the Honeycomb any more than we do.

It's still clear that launching third party apps on the watch is very important. The Dock is a big step forward here but it can't be the only answer. The Dock is a more concise list of apps than the Honeycomb is, but the only context its aware of is which apps were launched recently or that the user favorites. The Dock is glance-able and meant to keep apps visible and freshly updated, but it's still not as easily accessible as the user's watch face with all of their complications.

It's been clear for several months that complications truly are the best app launchers. That's why the new ability to easily swipe between watch faces is absolutely game changing for Apple Watch despite not being something I was expecting. Next to the flashy new Dock it's an easy thing to miss, but I think it will have the biggest impact in how I interact with apps on my Apple Watch. 

The Apple Watch apps that I launch regularly are ones that I have complications visible for. I routinely use two fitness apps, UA Record and Runtime, because their complications are so easily accessible to me. The only time I go deeper into the Honeycomb is to launch apps that I don't have room to show their complications...like Stopwatch, or Timer. I choose not to keep their complications visible on my watch face because they usually don't have any content that is contextually relevant to me.

The significance of complications being the best way to launch apps is why swiping between watch faces is so valuable. It allows users to literally switch their context on the Apple Watch. One day this could presumably happen automatically, but at least it only takes one swipe to switch from your primary daily watch face to one with the type of information you want to have at a glance in another context.

This is going to completely change the way I use my Apple Watch. I'll be experimenting with this for a while in the coming weeks, but for now I've created three watch faces that I intend to switch between depending on what I am doing:

- Cooking
- Daily Activity
- Distraction Free / Movies

I love using the Stopwatch and Timer apps while I'm cooking or brewing coffee, but I don't want their complications visible during the rest of the day. The ability to swipe left and bring up an entire watch face devoted to them and any other complications relevant to cooking is a game changer for me. I'll keep my existing primary watch face configured with the date, and a few activity / fitness complications, and I'll also have my Movie watch face with no distractions that Ryan Considine inspired me to use.

Apple clearly intended for this usage pattern to take hold when designing watchOS 3. Craig Federighi stated so himself in tonight's live episode of The Talk Show in San Francisco. Watch faces are the true app launcher for watchOS, and users will start to customize their watch faces based on the contexts that are most important to them. This is where I could see some really exciting things happen with the platform. Collections of activity and fitness complications seem very likely to become popular, as well as watch faces with complications related to travel. I hope Apple will use curation to promote this concept and apps with great complications because of how much better this will make the experience of using an Apple Watch.

This is a really exciting week for watchOS developers. This is where the platform really starts to take off and we start to see what people will really do to build amazing watch apps.

The Twenty-First Floor

Lately I've been following along on the Swift conversation about static and dynamic features and the importance of the dynamic runtime. I'd like to share some of my thoughts as a developer who is using both Swift and Objective-C on an almost daily basis.

The concept of using the right tool for the job is a bit of a cliché, but it describes my views on the static nature of Swift very well. I like that we as developers for Apple's platforms have great options on both ends of the spectrum. Swift is an excellent static language, and Objective-C and the associated dynamic runtime is a great tool as well. I haven't found myself only wanting to use one or the other.

Maybe the point of Swift is to have a strongly-typed static language to use for the things that should have compile time type checking, like building application layers. Having the capability to build your application in a type safe environment while still leveraging a sophisticated dynamic runtime that supports tools and behaviors that make our applications easier to build feels like a huge advantage to me.

I think Swift is a great language and I've been enjoying using it to build applications and internally used frameworks. A team I work with just shipped an app built entirely in Swift with a 0.0% crash rate. There's a lot of places where using a static language makes sense, and I'm not ready to judge Swift's future based on whether it could be used today to replicate UIKit, Core Data, or any other Cocoa frameworks.

The measure of Swift's success shouldn't be whether or not it eradicates Objective-C from our tool chain. Honestly, I don't think that it should. The value it is adding to our existing tool chain as a foundational component, and the capability it brings to build highly sophisticated and powerful tools like Interface Builder and Core Data earn it a place in our tool kit for a very long time to come.

I liked this quote from Manton's blog post about Apple's mindset on Swift dynamic features:

Remember when Steve Jobs came back to Apple and compared NeXTSTEP to constructing a building by starting out on the 20th floor, with so much of the foundation and common patterns already taken care of for you? Cocoa allowed apps to be built significantly faster than before. Steve said at Macworld Expo in 1997 that the goal was to “eliminate 80% of the code that every developer has to write for their app.”

I love this, because I think the building metaphor applies really well to where we are with Objective-C and Swift. The building is Cocoa, and we don't need to re-build the first 20 floors. What's great about the static nature of Swift is it gives developers an option to make that last 20% of code type safe, faster, and more expressive. For a lot of applications and use cases, that's a really great tool to have.

–––

As a brief aside, I know that Swift has a lot of promise in areas with no history of a dynamic runtime, like Linux or perhaps even with embedded devices. I'm not trying to diminish that, or imply that Swift has to exist on top of Objective-C. I'm actually very excited about all of those areas and hope that Swift becomes widely used on other platforms. But I won't mind if much of the core platform for Mac and iOS continues to rely on the dynamic runtime.

Great Watch Apps are Great Complications

A great point came up in the Wrist UX panel I was on yesterday at SXSW, prompted by a user question about what makes the best watch app.

The best Apple Watch apps in my mind are the ones that include the most useful and frequently relevant complications. The watch face itself is the best piece of real estate on the watch. That's park avenue. It's what people will see all the time. The complications that inhabit it are the fastest way for users to launch your app. Having a great complication puts you in a prime position to have users interact frequently with your app while inherently giving them quick, timely updates at a glance. It’s an amazing feature for users, and the most rewarding should you get it right.

Designing a great complication is actually very hard to do. For complications to be used frequently they need to be something that a user would keep on their watch face at all times, meaning they should always have something relevant to show. 

Weather and fitness apps are great use cases, and I think the biggest reason why is the data they present you with is easy to take action on. If your activity ring or dashboard wheel isn’t full when you check the time before dinner, you might choose to go for a run. If you glance at your watch while getting ready in the morning and notice the temperature, you’ll remember to bring a coat. The fact that you notice these bits of information while doing something unrelated like checking the time helps you in a way you didn’t expect it to.

A complication that tracks a flight or a package is also very useful, but it's only relevant for a limited portion of time. These are the types that power users might set on a secondary watch face to use occasionally. Ultimately, I hope that Apple will eventually allow complications to be more dynamic based on context, but for now the best complications are the ones that are literally always relevant to the user.

Complications are also very difficult to design for because they have to provide relevant data without needing to be updated frequently. Generally speaking, a complication can only update itself once every 10 minutes. If your concept for a complication requires more frequent updates than that, then you may have to go back to the drawing board.

Getting the complication right is the key to unlocking a huge amount of potential on the Apple Watch. Once you get your one main use case nailed on the watch app, I would focus the rest of your energy on designing a great complication. It's difficult to do, and competition for space on the watch face is stiff, but when a user chooses to place your complication on their watch face that's when you know you've built a great watch app.

Wrist UX - Designing for Apple Watch

Today I was on a panel at SXSW focusing on the challenges designers face when creating apps for Apple Watch and Android Wear devices. I've spent the better part of the last year and a half building different apps on the Apple Watch, ranging from fitness trackers to news readers and collaboration tools. I really enjoyed speaking on a design focused panel and wanted to continue the conversation by sharing some of my thoughts here on what works and what doesn't when it comes to smartwatch UX.

The Apple Watch is both a blessing and a curse for designers. It has a very small screen that provides natural constraints for what you place inside of it. The watch invites simplicity, and welcomes a minimal approach to app design. But it is also very easy to overthink your design and create a complex and confusing user experience.

One of the reasons people complain that the Apple Watch is too slow and that apps on the watch aren't great is that many of them are trying to do too much. We're used to iPhone apps that can do 10 things really well. An Apple Watch app can’t really be great if it’s trying to do more than one of them.

Pick One Feature, and Maybe Not Your Most Obvious One

When it's time to gather around a whiteboard and start designing your Apple Watch app, draw all of your features and start discussing some of your least obvious ones. It’s very likely that one of them represents a better use case for the watch. If you start with the secondary features you might realize that focusing there can actually improve the utility of your overall product.

I think there are two great questions to ask yourself when considering a feature for the watch. Will having this feature on the watch make my combined wrist+phone experience better? Or is this feature simply a better fit for the watch than the phone?

I think that we are moving towards a place where watch apps become standalone. The Apple Watch is already a great standalone fitness tracker and information dashboard. It's great for quick updates and simple bursts of interaction. But it’s also still safe to assume that the user has their phone with them, so an augmented experience that improves with both devices is also important to consider.

What each app does best on the watch will be very different. And honestly it doesn't even need to be an app. Notifications are a core feature of the watch for many users, and providing excellent contextual notifications that a user can take action on is huge win for many apps. Richly detailed notifications are a big differentiator on the watch, and I think that’s an important area for any iOS designer to consider.

It’s very hard to do more than one thing well in a watch app. Screen space is one issue, but there’s also limited context around what the user might be doing while using your app. It’s very hard to build an app that will be easy to use in multiple different situations. Scrolling through a grocery list on your watch while sitting on the bus is a very different experience than trying to scroll through it with two hands while pushing a grocery cart. That's why it's better to solve for one use case, and make that one interaction simple, fast, and intuitive in as many contexts as possible.

Protect The User

One of the reasons it’s so important to focus on a single use case and keep your design simple is so that you can protect the user from getting lost or feeling like they can’t get to where they want to go. The watch just isn’t big enough for bread crumbs or detailed error states or handling issues like that. Think about protecting the user to keep your interactions quick and to the point.

On our panel we discussed the concept of an undo action. How would you undo something on the Apple Watch? Would you scroll down to reveal more buttons, or force press to find a reset button? Or would you just shake your wrist, like the system undo gesture on the iPhone? In reality, none of those interactions work or are standard for this action, and that’s probably for the best because we ought to design our apps such that they aren’t necessary.

One example of very focused simplicity on the Apple Watch are the Activity rings. A discerning user might think that if they stood for 6 full hours on a walk and at the park that it should count as a full 12 hours credit on the stand ring, because 6 full hours is a greater amount of time than 12 partial ones. But the beauty of the activity rings is how simple the UX is. There is only one way that system ever behaves. If that ever changed, it would confuse people.

The same principle applies to our apps too. If you have to invent logic that changes the behavior of a feature based on information the user doesn't have or that isn't obvious to them, then you can't expect for them to understand what is happening.

One of the hardest things to do well in an Apple Watch app is to keep its scope and feature set limited. Usually when you start building the app you’ll be surprised at how easy it is, and that success will lead you to want to do more. Remember that is a slippery slope and take care to avoid overcomplicating your app by trying to make it do more than it should. Avoid the Hamburger Force Touch navigation pattern.

It’s also important to prototype and test your designs with users before shipping the final product. The fastest way to prototype a watch design is on paper. Draw out your screens and see how it makes sense to you and your team. You can actually get really far into your design just using paper or a whiteboard, because of how simple a watch app should be.

One of the lessons we learned while user testing our apps is that even experienced Apple Watch users are trained to tap and scroll and don’t intuitively reach for the Digital Crown as an interaction mechanism. Adding a coach mark or guide post to the screen to indicate interactivity actually improved the usability of our app quite a bit. We actually validated this by prototyping the feature in code, which was a really great way to try our assumption and get it in front of users quickly to see how they reacted to it in a real situation with working software.

Apple Watch Users Are Passionate

It's easy to look at Apple Watch users as just a subset of iPhone users, but I think that’s too shallow of a view of the smartwatch landscape. People that own an Apple Watch and use it every day LOVE that watch. If they're passionate about your app too then you have a great problem on your hands, which is that they want to use the app on their wrist too.

There have been a number of key moments for me that showcased just how much users of the Apple Watch care about the device and its software. I remember scrolling through the App Store reviews after shipping a new watch app several months ago, reading the comments left by people excited about the update. People that were excited about the watch app took the time to leave a positive review. Many included ideas for improvement or feature requests.

Users of another Apple Watch app I worked on are incredibly engaged on Zendesk. Proportionate to the number of users, there are a lot more comments left about the Apple Watch app, and many of them include very useful feedback from people who WANT to use the app. That was really the key moment for me with this lesson. Apple Watch users are clearly using the app enough to WANT it to be better so that they get more out of it.

Remember that these users are motivated to go the extra mile to make the experience on their watch better. I think it’s important to consider that and add watch-specific settings to your iOS app to allow people extra control over the type of notifications they receive on the watch or prioritize content they see on the watch. That’s a great way to keep people using your app who might have otherwise lost touch with it.

A lot of people think that third party apps on the Apple Watch are dead. I disagree. I think that third party apps on the Apple Watch are a big opportunity to delight your most passionate iOS users who also use an Apple Watch.

Conclusion

Apple will eventually ship a better, faster, newer model of Apple Watch and a new version of watchOS. But the principles of design that we apply to watch apps now will continue to serve us well even as people expect more from apps on the watch. Keeping things simple and focusing on doing one thing really well is the best way to make your passionate users love what you made for them, and serving those users is a very worthy goal while you think forward to future versions of the platform.

Designing in Swift

I've been slowly easing into Swift over the past few months. Some projects I've helped with at work have been in Swift, and my last personal app, Picturesque, was written completely in Swift. I've really enjoyed using the language, but until recently hadn't designed a major new component from the ground up in Swift. Fortunately, last year at WWDC I think we got a great primer for doing this: Protocol Oriented Programming.

I've been attempting to follow a protocol oriented methodology, and so far I've really enjoyed it. The rule of thumb I've been trying to follow is not to use classes for anything. It's obviously possible to take this rule to the extreme, but I think it is a good standard to start by for learning how to design in Swift.

Without using classes (much), you're left with Protocols, Protocol Extensions, Structs, and Enums. I'm going to cover how I am currently using each of these in my design.

Protocols

Protocols are, of course, the primary interface to what I am building. They represent the capital-T Types that another developer would be interacting with, and the methods they would be calling. But they also represent the plumbing between internal components. 

For a message passing framework there are public facing protocols like Listening, and internal protocols like Persisting or Encoding. Since Protocols are also just Types, the Listening protocol can have a reference to the Encoding Type that its implementation can use to decode a message. This form of dependency injection has always been a good idea, but the reason this is so useful in a Swift design should become clear below.

Protocol Extensions

Not only can Swift protocols inherit from other protocols, but they can also be extended to provide a base implementation of their methods, or add new ones. Using this feature to provide a base implementation of a common protocol is a huge deal for Swift. You know exactly what I mean if you've ever defined a protocol in Objective-C that many classes implement, and had to copy-paste the same method implementation between all of them.

I'm also using protocol extensions to drive out the dependency injection scheme described above. Since a method implemented in a Swift protocol extension has very limited access to Self (after all, this isn't a Class implementation), you have to make sure that anything that implementation needs is available from the protocol definition. 

That's why having your protocol reference other Types, like an Encoding type, is so useful. Those referenced types end up forming the shared base implementation of the protocol. If your varying implementations of the protocol need to change the behavior of one of the base methods, they won't override the method, they'll just override that dependency instead.

Structs

One nice thing about structs is that they're really not intended to mutate. Once I find myself starting to insert mutating keywords in front of method definitions I start to think through A) whether or not I should just use a class, or B) does this method really need to be changing state after all? Many times, having a struct (instead of a class) implement a protocol has helped me make better decisions about how my methods handle object state, which I think makes me more careful when adding or changing state. Of course, structs shouldn't be encapsulating state anyways, which leads us to:

Enums

Enums are my favorite feature of Swift. I don't think we could have asked for a better tool to manage state and branching in our programs. Enums can have methods, hold associated values, and conform to protocols. Their initializers can even take parameters. They're beyond cool.

One of the ways that I use enums is to support different behaviors for different cases - a common programming problem. I have an enum conform to various protocols that can return a Type. A message passing system could use an Enum to represent the form of messaging, which could return a different version of the Encoding type for each case. Other implementations only need to hold onto the current case in order to receive an Encoding type for that case, and don't need to care about state. All of that is managed by the enum itself. Generally speaking, if you start to define a switch statement outside of an enum, consider just using an enum instead or adding your functionality to the existing enum.

Conclusion

We're still in the early days of discovering what makes for good design in Swift. From what I've seen so far, I'm very excited about adopting a protocol oriented methodology and continuing to learn more about good code design in swift.

Swift is clearly a language that presents us with a lot of options from a design perspective. Once we get accustomed to protocol oriented programming, the next big decision to master is going to be when to use reference types (classes) versus value semantic types (structs, and enums). That's a decision we really weren't accustomed to making regularly with Objective-C, but one which presents a whole new set of options to consider in Swift. I don't have an answer for this one yet, but stay tuned for a future blog post.

Look and Feel

Today Apple unveiled what's going to become a whole new world for the iOS ecosystem. Alongside an impressive update to OS X and new hardware announcements like a refreshed MacBook Air and long-awaited Mac Pro came a complete re-thinking of iOS from what seems like the ground up. No stone was left un-turned with this new beginning for iOS. I wanted to talk about what that may mean for the iOS ecosystem's users and developers.

Apple has always been a champion for great design. That's apparent in the look of their products. The iconic Macintosh for example, or the elegant and attractive iMacs and MacBooks. The iPhone 5 may be the most attractive device Apple has made yet, with details like the chamfered edging and matte black finish. But in many ways, more important than how it looks is how it feels to hold, and to use. An iPhone just feels right to many of us, the same way that a Mac felt right to us before smartphones.

My favorite Steve Jobs quote, which received a mention today at the keynote, is that 'design is how it works'. What Apple has done with iOS 7 is a true testament to that. The design of iOS is no longer about the appearance of rich controls and detailed artwork and buttons. The focus has shifted to how the software makes the experience feel. Instead of rich textures, the layers in an application show through to provide depth and context and keep the focus where it should be: on content. The chrome becomes more muted and gets out of the way when you don't need it and comes back when you do.

But more than just the depth and translucency, we can see a big emphasis on motion and interaction. Shifting a background image based on how you hold your phone. Changing the angle of tabs in Safari. Even something as small and simple as shrinking, but not hiding, the URL bar in Safari as you scroll up. All of these are delightful touches that help bring an app to life through interaction. Parallax, blur and many of these techniques have been possible on iOS for some time now but this shift in iOS 7 shows which direction Apple sees the design winds blowing and I am excited to see them embracing it and taking the lead on the future direction for the platform.

At Google I/O a few weeks ago, I was disappointed with the lack of focus on developers building immersive experiences centered around great look and feel. Design is clearly important to Google. The polish and design in many of their own recent products is a testament to that. And while there were some good sessions around animation technology and UI design, I don't think you could say that it was a major emphasis from them to developers.

And that's why I am so excited about iOS 7. To me, it's not just about the lack of skeumorphic elements or linen backgrounds. It's about a focus from all angles on delightful user experience and engaging motion design in applications. Like with the introduction of iOS, Apple has set the bar for developers with iOS 7, and is giving us great tools to build these same kinds of experiences on the platform. I'm excited that they are pushing us forward and can't wait to see more of what everyone is going to build on the new version.

Review: Nifty MiniDrive

IMG 9819

Having plenty of computer storage options available has always been important to me as an avid photographer and computer user. On the desktop thats easy to accomplish using both internal and external drives. But now that I've been using a laptop for work it's been harder to have more options for storage. External drives are a hassle, and additional internal drives are not an option on the next generation of Mac laptops.

I was really excited when I saw the Nifty MiniDrive on Kickstarter. The Nifty MiniDrive extends the onboard storage on a Mac laptop by utilizing the SD card slot to house a Micro SD card. This is a genius solution for elegantly adding a fair bit of flash storage to your laptop. I had always viewed the SD slot on laptops with skepticism because I use Compact Flash cards for my photography work. But this solution seemed like a great way to utilize that card slot while also giving me more options for storage.

The instructions for installing the drive on the Nifty website are very helpful. Installing the drive was straightforward. I did have to re-seat the Micro SD card once on my first installation to get it to seat correctly, but since there there's been no issues. The drive lines up very nicely on my laptop, as seen in the image above.

The Micro SD card I purchased for my MiniDrive is a Samsung 64GB drive. The other option I considered was a SanDisk 64GB drive. I typically use SanDisk drives for my photography work, but I decided to try out the Samsung because it was on sale and showed similar performance characteristics to the SanDisk. Straight read/write performance for the Samsung has been about what I would expect. Essentially it's similar to a USB 2.0 external drive for reads, and perhaps a bit slower for writes. Not all flash storage is created equal, and you're not going to set any speed records with SD cards like you might with USB 3.0 and Thunderbolt externals or newer SSD drives.


Screen Shot 2013 02 26 at 9 44 39 PM


The Nifty Team lists a few possible uses for the drive on their Kickstarter page. I decided to use my MiniDrive as a Time Machine backup for general documents, settings, and works in progress. The practical consideration behind this is that the largest currently available MicroSD card is 64GB - too small for backing up my entire startup drive. But the reality is that this is still large enough for what I need to back up. Source code is backed up by an SCM, and applications are easily replaceable. Photos I keep backed up using other methods, so any photos stored on my laptop are disposable.

After my initial tests, I set up the drive as my Time Machine backup volume. I configured Time Machine to exclude all of my apps, repositories, system data, caches, and any other large files that don't need to be backed up. That placed my total backup size in the 10-12GB range.

I use Time Machine as part of my Mac Pro's backup system too. I recently switched backup volumes on my Mac Pro and performed a 400GB initial backup of my startup drive. That backup took about 3 hours. I knew that an SD card is no where near as fast as an onboard SATA drive, but I was still expecting that the initial backup wouldn't take more than a few hours.

Screen Shot 2013 02 27 at 9 15 41 AM


In the end, the initial backup to the SD card took almost a full day to finish. I'm assuming that this is because of how many small files were included in the backup. The random small write speed of the SD card is not very fast compared to the large consecutive write speed that I was testing above. The screenshot of Activity Monitor above was while writing a single large file. Now, here's another screen shot while the backup was in progress. As you can see, the drive isn't maintaining a constant speed and so the backup ends up taking longer to finish.

Screen Shot 2013 02 26 at 9 46 56 PM

I finished the initial backup about two weeks ago, and I've been using the drive as my Time Machine volume ever since. The subsequent backups have finished much faster. I haven't noticed any performance issues while the backups are going on. Performance within the Time Machine is good as well with the MiniDrive. Scanning through file and folder versions for the past few weeks was fast and easy. I have not yet needed to recover a file from the ether of time yet, but backup isn't only about that. It's about the peace of mind you get by knowing that your data is safe. The Nifty MiniDrive gives me that, and in a stylish and elegant package to boot. In the end, that's what matters, and so I am very happy to have my Nifty MiniDrive.