Categories
Development iOS Work Note

Work Note: When to share?

I do freelance work. As a freelance developer I’ve had times where I need to write code I know others could use. I use plenty of open source software, so I figure I should try to contribute something back.

That said, I’m working on a project right now that needs to parse RSS feeds. I know there are some existing RSS parsers available for Objective-C, but I’m going to write my own for a few simple reasons.

  1. I need it for this project
  2. I can reuse it later
  3. I’d like to give back
  4. I wanted to do something block based
  5. I wanted to publish it using CocoaPods

This exercise is primarily about two things; Sharing and self learning.Duct Tape, fixer of all things!

If I’m the only person that ever uses it, at least I’ve learned something new (packaging with CocoaPods) and I have something I can use again.

Update (6PM): I’ve published what I’ve completed. Some warnings. This code is very much as is. I’ve only tried it with well behaving RSS 2.0 feeds. The code definitely stands on the backs of giants. It depends on TouchXML to do all the hard work, all this code does is create RSS objects. Do not expect much.

I still need to add CocoaPods support and it could use a bunch of unit tests. I’ve done a few, but I can go a whole lot deeper.

Anywho, lots to do.

Categories
iOS Work Note

Work Note: UIButton and UITableViewCell contentView

I am not sure why I see this behavior but I am sure someone smarter than I am can explain it. I am creating a custom table view cell derived from UITableViewCell. In the viewDidLoad method I’m adding, amongst other things, a UIButton to the cell.

All of the UILabels I added to the cell were added to the contentView and display just fine, but the UIButton’s I added to it don’t work properly, you can see them, but no events fire.

Here’s how I’m doing it:

[self.contentView addSubview:self.fancyButton];

That doesn’t work. However, adding the button to the view, does work:

[self.view addSubView:self.fancyButton];

According Apple’s documentation for UITableViewCell contentView:

The content view of a UITableViewCell object is the default superview for content displayed by the cell. If you want to customize cells by simply adding additional views, you should add them to the content view so they will be positioned appropriately as the cell transitions into and out of editing mode.

If I add the button using Interface Builder, it works as expected, but in this case I’m building the cell in code. At some point I need to dissect a prototype Interface Builder based UITableViewCell to see what it does. I would imagine it places all subviews in the view, not the contentView.

Categories
Development iOS Mobile Uncategorized

Mobile Apps are Real Applications

RibbitMartian Craft: “Do you want a one bedroom shack for $50,000 or a mega mansion for $2M+ similar to Facebook, Twitter, or Instagram? As with homes, many clients opt for a starter size for their first app. This allows them to build a solid foundation that will be setup to grow with them for years to come.”

This is another great article on the true cost of mobile app development. No, it’s not the first and probably won’t be the last. As a freelance app developer I have to share this kind of news with folks all the time. I’m sure other developers have these conversations, they go something like this…

Potential Client: “I’d like to build this application.”
Developer: “Ok, let’s talk about your application.”
Potential Client: “I would like this and this and this.” (Of course I’m paraphrasing, the client is obviously excited about their product, as they should be.)
Developer: “Great, what kind of budget do you have?”
Potential Client: “I don’t have a lot to spend, how much would you charge for everything I’ve outlined?”
Developer: “It will take X dollars to develop your app, just a ballpark figure. It could be more, it could be less.”
Potential Client: [Silence. Never heard from again.]

I don’t say this to embarrass anyone. I’m only sharing it because it is true. For every 10 people I speak with about developing an application I may only get one of them to talk to me past this point.

I’m not sure if there is some sort of psychological barrier because these are mobile applications and not taken seriously, or what? In the end this is serious software that takes time, and a lot of effort, to develop.

When you have an idea for a mobile application and need a developer, remember this: Mobile Applications are real software. Think of them as your web site, or that accounting software you use every day, or maybe a word processing package from your favorite software company. Maybe that will help with the sticker shock?

If you need an iOS Application for your business or need a developer to bring that app you’ve always wanted to life. Get in touch, I can help.

Categories
Apple Design Development iOS iPad iPhone

iOS 7 Lowers the Bar

iOS 7

A gift for you!If you’re an iPhone or iPad user Apple had a shiny new gift for you this week; iOS 7. I know, I know, it’s a bit of a jolt. I won’t lie. I hated it for a few days, but it’s beginning to grow on me. I’ve heard this time and again “Give it a few days.” I’ve given it a few days and it still seems a bit stark, but overall I’m happy with it. My trusty iPhone 4 seems much faster than it did with iOS 6. Bonus.

Benefit to Developers

I’ve written a few iOS apps over the last few years. Some have been lovingly designed by professional designers, others, like our own RxCalc were kept intentionally simple. Why? Truth be told Jay and I don’t possess the ability to make beautiful imagery for our app, so the design has to be simple. We developed our app using plain old UIKit, it works really well, is fast, and the binary is tiny.

With iOS 7 the bar has been lowered. A generic looking application looked fresh when iOS hit the streets. There were developers that created their own style and look, and, in turn, third party developers began to define the look of the OS, not Apple. Think about developers like Iconfactory, Tapbots, and Path. They all introduced applications that took the look and feel of applications way beyond standard UIKit, and that’s great. They stood on the shoulders of giants and moved the bar higher so the rest of the app ecosystem had something to reach for.

Third party developers created Pull to Refresh, the Hamburger and the Basement, and alternatives to UITabBar. All were very good innovations and gave us beautiful, very functional, applications. But there is a downside.

If you go against the Apple playbook, which isn’t a bad thing, you may end up creating something that doesn’t feel at home on a future release of an OS. Since iOS 7 shipped I’ve seen numerous folks comment about how outdated forward thinking and innovative applications like Tweetbot look.

I’m sure we’ll see an update for Tweetbot soon, but the point is, if your app has a completely custom UI it may take a lot of time and effort to make it look right in iOS 7.

Back to RxCalc and our choice to use UIKit, without custom design elements. Here’s how RxCalc looks on iOS 6 and prior, and it looks this what on iOS 7 before being recompiled:

RxCalc, UIKit for iOS 6 and older.

It’s not flashy, but it looks similar to Apple’s own Settings app, or Mail, on iOS 6.

Making an app new again

If you created a simple UIKit application your road to iOS 7 is simple. Most of the hard work has been done. You can recompile and your application looks new again.

Here’s what RxCalc looks likes when it’s recompiled with the iOS 7 SDK. No additional work, just a simple rebuild.

RxCalc, UIKit for iOS 6 and older.

Can it be spruced up a bet? Sure it can, but I can put this in the store today and it will look like it belongs.

That’s why I tweeted this a few days back:

It is super easy to get a fresh UI if you stuck to generic UIKit.

Reset

The bar has been reset, time for a new generation of user interface innovation.

Thanks, Apple.

Categories
Development Indie iOS Objective-C

Better JSON to Object Serialization

Duct Tape, fixer of all things!Krzysztof ZabÅ‚ocki: “I don’t like passing around JSON so I write parsing on top of native objects like NSDictionary/NSArray. If you get data as JSON just write a simple category that transforms JSON to native objects using NSJSONSerialization.”

Here’s a nice hunk of code that will save you some time when you write your next iOS App that talks to a web service. I don’t like passing around NSArray or NSDictionary either, or even worse the raw JSON you get back from a service. I’ve written a few times about transforming JSON into an Object, and it’s not hard to do, but it’s so “boilerplate” it feels like a waste of time. Time you could use elsewhere. Krzysztof provides a nice way to get past all that boilerplate code and get automagic serialization of JSON to Object. It’s definitely worth a look and worth understanding the pattern.

Categories
Apple Development iOS

Apple Developer Center Breach

Full text of the email every registered Apple Developer received.

“Apple Developer Website Update

Last Thursday, an intruder attempted to secure personal information of our registered developers from our developer website. Sensitive personal information was encrypted and cannot be accessed, however, we have not been able to rule out the possibility that some developers’ names, mailing addresses, and/or email addresses may have been accessed. In the spirit of transparency, we want to inform you of the issue. We took the site down immediately on Thursday and have been working around the clock since then.

In order to prevent a security threat like this from happening again, we’re completely overhauling our developer systems, updating our server software, and rebuilding our entire database. We apologize for the significant inconvenience that our downtime has caused you and we expect to have the developer website up again soon.”

I know people love a good scandal, and being breached is a decent story, but nothing sensitive was compromised. It’s a major bummer they were hacked, but as far as the developer community is aware no app keys or credentials were stolen. No, our apps won’t have to be resigned and resubmitted.

Categories
Indie iOS Mobile

John Gruber, Class Act

John Gruber: “This made my day, but allow me to put my humble hat on for a moment, and praise two apps that foreshadowed iOS 7 long before Vesper”

Calling attention to two iOS UI pioneers was the right thing to do. It also shows that Mr. Gruber is a class act.

Thank you, John.

Categories
Business Indie iOS

The Dark Side of the App Store

Ben Thompson: “My use of Paper is an essential part of stratechery, yet I needed to only pay $8.99 for two in-app purchases, for which I never need to pay again. That’s a hell of a bargain, but it’s ultimately unsustainable.”

It’s difficult to sustain a business on an app when you can only charge for the initial purchase. This is a problem Apple needs to solve on behalf of app developers.

Categories
Apple Development iOS

WWDC 2013, it’s not all bad

Well, it happened, Apple sold 5000 WWDC tickets in 90-seconds. Amazing. Of course it wasn’t all roses for everyone. Some people saw errors after thinking they got a ticket, others instantly got the “Sorry, we’re sold out message.” That’s not the story.

The story, at least to me, is the few developers who believe they are somehow more deserving a ticket than others. That’s a bunch of hogwash. No one developer is more deserving of a ticket than any other. This is how things should work. First come, first served. If you didn’t score a ticket, try again next year. I was able to attend WWDC 2011, Steve Jobs final keynote. I understand why developers really want to attend. It’s a chance for us to hear about new and exciting things before anyone else. We also get to hang out with friends and talk to other developers. That’s probably the most important part of the week; hanging out with friends.

I’ve read too many gripes that say it was their chance to meet others and hang out, and now that opportunity is gone. Why is it gone? Come to California that week and go to an alternative event if it really is that important to you. What’s stopping you? Nothing but you. I get why it’s important to connect with other developers and have dinner and a few beers. It’s a time to unwind, let your hair down, as they say. In 2011 I was able to hang out with a longtime friend. We hadn’t seen each other for ten years. It was a great time.

Alternative

Yes, there is a great alternative to WWDC that same week. You can attend AltWWDC, and it’s free!

If you missed getting a ticket and believe its important to get together with fellow Apple Developers you have a place to go.

Hopefully I’ll be able to attend at least one day, maybe two. If I do make it, I hope to make some new friends.

Maybe I’ll see you there?

Categories
iOS

The thorn in the iOS Developer’s side

Provisioning can suck

Provisioning. That’s the thorn. At least it’s the thorn in my side. It seems they go goofy once in a while and it’s always a pain in the butt to straighten them out. It’s been my experience that deleting them from Organizer and refreshing straightens them out, not this time. This time I’m stuck.

I believe this entry from Stack Overflow may be what I want but I’m actually afraid to pull the trigger. If I revoke everything will my app continue to function?

This bit troubles me:

Open Xcode. Click WINDOW > ORGANIZER. Then click the Devices tab and select “Provisioning Profiles” on the left. That should bring up your provisioning profiles. Highlight one by one (if more than 1), right click and delete profile. Yes, just do it! Delete them all! (I kept making a new one after a new one trying to make the thing work.)

Delete them all? Really? Is this the “correct” way to fix the problem?

Any help appreciated. Once I get this solved I will document how to fix it.

UPDATE: I followed the directions on Stack Overflow and generated a new provisioning profile. It worked. Scary.