Tag Archives: apple

How to transfer photos to Apple TV (4th gen) and use photos as screensaver

Here is a quick guide for saving photos on your 4th generation Apple TV so that you can use them as a screensaver on your Apple TV (without constantly have your computer on for Home Sharing).

  1. On your computer, open iTunes and turn on Home Sharing
    1. File > Home Sharing
    2. If applicable, select ‘Choose Photos to Share with Apple TV…’
  2. On your Apple TV, select the ‘Computers’ app icon from the home screen
    1. In your Library, select Photos & choose your album
    2. Select ‘Set as Screensaver’ in the top right & select ‘Yes’
  3. You’re done

That hopefully wasn’t too complicated to do. I wanted to post this since it wasn’t clear to me from googling if you could save photos to your Apple TV (or you had to always stream via Home Sharing).

As for the Apple TV, it feels like Apple Watch territory. Something that is nice to have, but nowhere near necessary. Their app stores are still early and widespread developer support is uncertain.

WKInterfacePicker Attributes Illustrated

The WatchKit Framework’s WKInterfacePicker has some level of customization in Interface Builder.

As of this time of writing, there are 4 main attributes to configure:

  • Style
  • Focus
  • Indicator
  • Enabled

Style is the most important attribute since it heavily influences the type of Picker. The options for Style are List, Stack, and Sequence. List is the standard iOS-style 3d list of text. Stack allows you to flip through images as if it were a deck of cards. Sequence lets you move between images without any intermediate transition effect. For a good look, I’d recommend Big Nerd Ranch’s blog post.

Focus presents an outline around the currently focused/selected Picker. This is helpful if you have multiple WatchKit pickers or multiple elements for selection (think “Customize” for your watch face). The options are None, Outline, and Outline with Caption. The last option, “Outline with Caption”, comes into effect if your Style is Stack (or possibly Sequence), see an example here.

 

Plain, without focus

Plain, without focus

Left picker is focused

Left picker is focused

Indicator has two options: Disabled or Shown While Focused. The documentation wasn’t very clear: “A value indicating whether the picker uses an indicator to convey context about the number of picker items and which item is selected.” As far as I can tell, Disabled means the standard look, and the “Shown While Focused” adds a scroll bar helper on the right side of the watch.

Indicator - Shown While Focused

Indicator – Shown While Focused

Enabled is a helpful option that is either on or off. Enabling it or not doesn’t affect the view. When the picker is enabled, it allows the user to use the picker. This attribute can be set or unset programmatically with -setEnabled.

Hopefully this quick explanation of the different WKInterfacePicker attributes helps you out. The digital crown (AKA dial) & the WKInterfacePicker provides an extremely powerful, convenient input method for your watch app users.

Logging during development with Apple Watch hardware

Inserting breakpoints or logging statements (such as NSLog) is relatively straightforward with an iPhone-only iOS app. But how do you log from the WatchKit Extension (aka Watch app)?

The good news is that logging isn’t filled with many complicated steps. The bad news is that the logging works intermittently.

  1. Add your NSLog statements in your WatchKit Extension. This is probably your InterfaceController.m
  2. Run the watch app on iOS Device + watchOS Device (in the WatchKit App scheme)
  3. Select Debug > Attach to Process > (click on your watch app name)
  4. Profit! You should see your NSLogs when they are triggered in the app lifecycle in Xcode

debug

If logging isn’t working, try typical Xcode debug steps such as:

  • deleting the app on your phone & re-running it in Xcode
  • restarting the phone and/or watch devices
  • clean Xcode (cmd + shift + k) and re-run the app
  • quit & restart Xcode

Setup Apple Watch for Development Guide

While working in Xcode and running my watch app on my actual hardware watch for the first time, I ran into this error on my watch the first time: “Failed to install [app], error: Application Verification Failed.” This stack overflow answer provides the solution, but I wanted help illustrate the steps I took to fix the error. Disclaimer: this worked for me, but there are probably more optimal ways of fixing the error.

  1. In Xcode, get the UDID of your Apple Watch (WIndow > Devices). The UDID is labeled “Identifier” and you can double click on the Identifier device hash to select & copy it.
    1
  2. Visit the Apple Developer Portal at https://developer.apple.com/devcenter/ios/index.action and click on “Certificates, Identifiers & Profiles” in the right sidebar.
    2
  3. Click on Devices > All in the left sidebar.
    3
  4. Click on the Plus Sign (+) in the top right.
    4
  5. In Register Device, provide a Name (whatever you want) and your watch UDID (from step 1 above).
    5
  6. Submit the form to register your watch device.
  7. In “Certificates, Identifiers & Profiles”, locate your .watchkitextension Provisioning Profile for your app. Select & download this profile.
    7
  8. Locate your downloaded profile file on your computer & double click the Provisioning Profile.
  9. Restart Xcode.
  10. Build your project and you will encounter a iOS Development Certificate alert.
    10
  11. Warning, this step may be dangerous (proceed at your own risk). This worked for me. Click on “Revoke and Request”. This will revoke your current certificate and request a new one. You will probably get an email notifying you that “Your Certificate Has Been Revoked”.
  12. Run your Xcode project. Your watch app should now load the development build on your actual watch hardware.

About the author: Rex Feng enjoys iOS development and has released Pomodoro Pro for the iPhone & Apple Watch. You can follow him @rexfeng.

Fix no matching provisioning profiles validation issue

Here’s a quick problem & solution that worked for me. Hopefully this helps others out there.

Situation:

Validating an archive prior to submitting the build to the App Store, but it fails validation. I am using App Groups (for the phone app & watch app).

Problem:

Validating my archive created two “no matching provisioning profiles found” errors. The error was specifically related to “none of the valid provisioning profiles allowed the specified entitlements betareports-active com.apple.security.application-groups”.

Solution:

In my case, my development was able to use App Groups, but the production/distribution environment was not setup yet.

Under Provisioning Profiles > Distribution (https://developer.apple.com/account/ios/profile/), create an Distribution / App Store for each App ID that you need. In my case, I had to create one for the phone app & one for the watchkit extension. Make sure to download each after generating them. Double click on your downloaded files to automatically load them into Xcode.

When I tried to validate my archive again, I was able to successfully validate (after generating & loading my new Provisioning Profiles).

iOS Programming

I’ve started learning iOS programming. Objective-C seems very low level, but it’s alright as an older object oriented language. Learning the Apple frameworks seems to the be tricky part. There’s a lot for me to learn with using Xcode (since I don’t normally use IDEs) and frameworks like Cocoa Touch.

I spoke to someone recently who suggested skipping Objective-C and going directly to Swift. Or even a tool like PhoneGap. Personally, I side with Aaron Hillegass’ take:

I have three messages for these people:

  • If you want to be an iOS developer, you will still need to know Objective-C.
  • Objective-C is easier to learn than Swift. Once you know Objective-C,
  • it will be easy to learn Swift.

To take a longer perspective on iOS, I want to build my foundation up from Objective-C to iOS. This is similar to how learning Ruby is critical for being a Rails developer.

With that said, I’m eager to get my hands dirty with iOS prototypes through different online courses.

iOS Simulator

When previewing a site on my iPhone (1136 x 640), I wasn’t satisfied with using my iPhone 5 or a Chrome browser Window Resizer app.

Turns out it’s super simple to use the iOS Simulator with Xcode on OS X (version 10.8.5).

Select Xcode > Open Developer Tool > iOS Simulator

xcode

You’ll be presented with an iPhone to navigate within. Select Safari and you can use a site like localhost:3000 for development.

 
ios_sim

iOS Redeem App Code Mockup

New rule: if I have to google “how to [do something],” your UI needs improvement.

While redeeming an iOS app, I couldn’t figure out where to enter in the app code. I instinctively went to the Search section, as I know that has a text input section at the top:

iPhone App Store Search screen

No dice.

So as with everything in modern life, I went to Google for help. It turns out it’s at the bottom of the Featured screen.

iPhone App Store Featured screen top

Scrolling down…

iPhone App Store Featured screen bottom

I find the Redeem button, and the rest is cake.

Without googling, I wouldn’t have stumbled upon Featured > New > page bottom to find the Redeem button.

I recognize that for most people, redeeming an app code is not a typical, common use case. That said, it should be somewhere logical. I’ve mocked up the Search screen with a Redeem button:

iPhone App Store Search screen mockup

This way, the user is able to associate entering in names of apps, keywords, or app codes in one convenient field.

The upside is an extremely easy to find Redeem button. A possible downside is that users will get led astray while searching for paid apps (by hunting for app codes instead of proceeding to checkout).

Ron Johnson: We want [jcp] to be your favorite store.

Last year, Ron Johnson left Apple as Senior Vice President of Retail Operations to become J.C. Penney’s (JCP) CEO. Before joining Apple, he was at Target. As Gruber points out today, “The Ron Johnson Era at JC Penney Has Begun.”

jcp Ad by Ken Segall

Johnson took out a two-page ad in several major newspapers with the mission of turning JCP into your favorite store. This is an amazing leadership step that sets the tone and gives an extremely ambitious goal to its employees.

This amazes me because you can see how he’s cutting out the bullshit. With the realization that almost everything sold at JCP is on sale (~72% of the time, discounted over 50%), he’s getting rid of confusing sales. Everything will just be at the sale price without consumers deciphering “SALE 60% off” tags, “Save an Additional 40%” signs, etc. plastered everywhere. Also, he’s implementing about “100 sleek, neat sections” into stores.

As a consumer, I find it extremely hard to imagine a future scenario where JCP is my go-to choice for anything, let alone my favorite store. That doesn’t mean I can’t give Johnson points for trying. If my company was in mass market retail and needed to turn around sales, stealing an A-level player from Steve Job’s pick for retail operations is as good as it gets.

I don’t have any vested interests with JCP performing well or poorly. But given the choice, I’d like to see Johnson turnaround in real-time a company that most people have completely written off as irrelevant (like Apple ten years ago). It would make a good case study.

(via daring fireball)

Apple Keyboard Shortcuts

We get it. Apple is the company that pays attention to the details. No detail too small, they create their own reality. With a strong internal design culture, they provide customers what they want before they ask for it. But sometimes they misfire (such as their power cords).

I recently started using OS X Lion. Spotlight (command + space) is amazing. Hot corners are cool. The difference between switching applications (command + tab), switching windows (command + `), and switching tabs (control + tab) sucks.

Looking at OS X’s menu bar, how would you ever figure out that that a sloping line with a horizontal line indicates the option key?

Menu Bar example (top to bottom: command, shift, and option)

The command key is clearly labelled on the keyboard. Not sure how you would easily describe the command key symbol’s shape over the phone.

The shift (the up arrow circled above) and the delete key (not circled) can be deduced by your average power user, so I’ll give Apple a pass.

The option symbol, which I’m still not sure how to easily describe (the bottom circled symbol) is a mystery.

Here is what an Apple keyboard looks like:

Apple Keyboard (from left to right: shift, option, and command)

While Apple is known for their attention to detail, the usage of the option symbol to indicate keyboard shortcuts in the menubar is useless as the option symbol only makes itself evident through 1.) web searching or 2.) consulting an expert Mac user. It doesn’t have to be this way. The easiest solution would be for Apple to print the symbol of the option symbol onto the keyboard.