Shiny iPhone Buttons Without Photoshop

Screenshot

Newcomers to iPhone development are sometimes surprised at how ugly the standard button controls are. They quickly learn that they need a graphics person to create a nice-looking button image in Photoshop and then attach that to the buttons. However, in this tutorial, I'll show how to create nice shiny buttons in code, without any image files, by using a CAGradientLayer.

JacksOrBetter for iPhone Updated

JacksOrBetter Screenshot

Version 1.1 of JacksOrBetter for the iPhone and iPod Touch is now available, and it's still free. If you have an iPhone or iPod Touch, you can get it from the App Store.

This version has a lot of cosmetic improvements over version 1.0. Version 1.0 was, frankly, a little embarrassing, and I'm glad I finally got around to fixing it.

I created JacksOrBetter back in September 2008, when the App Store had only existed for a couple of months, and the iPhone App Store Gold Rush was on. The news was full of stories of iPhone developers who were making tens of thousands or hundreds of thousands of dollars from simple games. I wanted in on that action.

JacksOrBetter wasn't intended to make me a fortune; it was my first learning-how-to-write-an-iPhone-app exercise. I figured I'd whip it out, learn what I needed to learn to make and sell an iPhone app, and then I'd get to work on the apps I really wanted to write. (Those other apps are still in the conceptual stage, a year and a half later.)

At that time, there were only a few hundred apps in the App Store, and many were little better than JacksOrBetter. I initially charged $1.99 for it, and after a couple of weeks dropped the price to $0.99. I made about $280 over the next few months. Initially I was selling a dozen or so copies per day, but sales eventually fell to only a few per week, so I decided to make it free.

Since then, I've seen a lot of really nice iPhone apps, and I've learned a lot more about how to make them, so I finally decided to sit down and make JacksOrBetter what it should have been.

So now, it has nicer looking cards, a nicer background, and some cool animations of cards being dealt, discarded, and cleared at the end.

It's still pretty simple, but it no longer has that first-app stink.

There are a few more changes I want to make, but I've got this idea for an iPad app...

iPhone Sample Code: Tiles

As an exercise in using the Core Animation API, I've implemented a little iPhone app that reproduces the behavior of the iPhone home screen's icon reorganization interface. (You know, dragging the wiggly icons around.) You can download my sample code to see how it works. Some descriptions of the highlights follow below.

Thoughts on the iPad

I like the iPad. A few friends and acquaintances accuse me of being stupid and easily fascinated by sparkly objects. Rather than have the same argument over and over again, I'm writing all my thoughts and predictions here. I will speak no further on the subject until I actually own an iPad.

43

Another year older. I'm solidly in my forties now. It's not too bad.

We've had a few additions to the family in the past year: we bought two more Yorkshire Terriers, named Boo and Tweezer. About a week and half ago, Boo gave birth to a puppy whom we've named Sparky. He hasn't opened his eyes yet, but he's growing fast. So we now have four dogs, which is more than we really want, but I doubt we'll be able to part with any of them.

I've lost thirty pounds this year. I'd like to lose another twenty, but I'm glad I haven't regained what I've lost. As a result of the weight loss and diet, I no longer need medication to control hypertension or cholesterol. So I'm healthier than I was last year, and I hope that trend continues.

My wife decided to put a patio in the backyard this summer. The project grew a little beyond its initial scope, but the result is that we have a really nice backyard now. I like to go out there and read on weekends. It makes our little house feel a little bigger. I still really like it in Dahlonega.

I notice in my "42" entry that I said my career was in a rut, and it still is. However, I will have some opportunity to learn new things at work this year, so while it's still not what I want, at least it won't be completely boring.

Usually when I write my birthday blog post, I can review the last year's worth of blog postings to remind me of the things I did during the year. Unfortunately, this year I decided to limit my blog postings to programming- and technology-related topics, so I don't have a record of the really interesting things that have happened. But I do know that I'm happy, and that's all that really matters.

Objectified: Great Documentary

I just finished watching Objectified, and can wholeheartedly recommend it to audiences of all ages.

Objectified is about industrial designers. Those are the people who design all the stuff we buy. Look around you: that desk you're sitting at was designed by somebody. The mouse and keyboard were designed by somebody. That lamp was designed by somebody. The chair you're sitting in was designed by somebody.

We often think that consumerism and mass production takes the human element out of life, but Objectified will make you look at all those little works of art that surround us. Sure, there may be ten million copies of each thing, made by people in sweatshops, but somewhere there was a person who thought about it and made a lot of decisions. What shape should it be? What color should it be? What texture should it have? Should the edges be sharp or rounded? What should it be made of? How will it be manufactured? How much will people pay for it? What should the packaging look like? How can it be disposed of?

Objectified presents interviews with the people who do that. It may be a little geeky (how many people really care?), but it will give you a new appreciation for all that stuff you buy.

I rented it from iTunes. Next I'm going to watch Helvetica, which was directed by the same guy.

JacksOrBetter as a Web App

A little over a year ago, I created my first iPhone app, JacksOrBetter. As an exercise in learning CSS, JavaScript, and jQuery, I've created a web-based version of JacksOrBetter.

Bruce Schneier on Aviation Security

Computer security expert Bruce Schneier has a really nice opinion piece on CNN:

One could wonder whether a computer-security expert is qualified to write about aviation security or national security, but what he says makes a lot of sense.

Despite fearful rhetoric to the contrary, terrorism is not a transcendent threat. A terrorist attack cannot possibly destroy a country's way of life; it's only our reaction to that attack that can do that kind of damage. The more we undermine our own laws, the more we convert our buildings into fortresses, the more we reduce the freedoms and liberties at the foundation of our societies, the more we're doing the terrorists' job for them.

Ten New Year's Resolutions for Everyone

Being the arrogant lummox that I am, I've taken it upon myself to make a list of ten New Year's resolutions for everyone to follow.

  1. Be a better parent. Make time to spend with children (even if you have no children of your own).
  2. Be a better spouse. Are you the partner you promised you would be?
  3. Be a better friend. Your life isn't all about you. Reach out to others.
  4. Be a better citizen. Educate yourself about what's going on in your city, in your nation, and in the world. Ask questions. Respect those who disagree with you.
  5. Take care of your health. Prepare healthy meals, get some exercise, take your prescribed medications, get a physical exam and vaccinations.
  6. Put more into your work, but don't let your work take anything out of you.
  7. Correspond with people. This doesn't mean forwarding e-mail jokes, posting your status on a web page, or ranting about what some politician has done. You need to write about meaningful things, and carefully read what others have written.
  8. Examine your beliefs. How did you get them? What are they based on? Do they still make sense to you? Can you imagine what it would be like to hold different beliefs? Talk to someone who does have different beliefs.
  9. Get rid of what you don't need, literally and metaphorically.
  10. Relax more. You really do have the time.

Now you'll have an answer when annoying people ask you what your resolutions are.

Detecting Bullshit on the Internet

It's amazing what people will believe. At least once a week, I'm forwarded a piece of information from a seemingly intelligent person that seems fishy. Obama is not a US citizen! Obama is a Muslim who hates Christians! The Department of Homeland Security is setting up death camps! Eat whatever you want and still lose weight! Cancer cured by prayer! Etc., etc., etc.

It is usually very easy to debunk these claims:

  • Is this story being reported by any reputable news sources? If not, you should be skeptical.
  • Try Googling the first sentence or two of the story. This often brings up pages that demonstrate the story to be a hoax.
  • Try searching websites like http://snopes.com/, http://www.factcheck.org/, or http://skeptoid.com/, that have smart people who investigate suspicious claims.

For some stories, a tiny bit of research and critical thinking quickly leads to the conclusion that they are bogus. But it amazes me that people accept these stories without even considering that they may be untrue. Their "bullshit detectors" just don't work. They accept any negative story about people they don't like, and any positive story about people they do like. They reject mainstream media and other reputable sources in favor of quacks, cranks, and conspiracy theorists.

It is very easy to accept stories without question if they fit your existing beliefs, but we must always be on guard against such acceptance.

The first principle is that you must not fool yourself — and you are the easiest person to fool.
Richard Feynman

Carl Sagan, in his book The Demon-Haunted World, presented what he called his "Baloney Detection Kit". It's a simple set of guidelines for testing the believability of assertions and arguments. If you haven't read it, please do, and apply it both to new stories and to your existing beliefs.

And, please, stop sending me this crap.