Code-free
Code-free

Swift: Generic extensions in libraries currently broken

Just saving you some time

Russ Bishop
June 11, 2014

If you were thinking of creating a Swift framework and writing some unit tests, you should be aware of a bug. You cannot currently extend a built-in or standard library generic type with any properties or methods that require the type's generic parameters.

In other words, create a framework project in Swift and add this to a swift file:

. . .

Read More

Handle Exceptions in Swift

Baby's got a brand new bag

Russ Bishop
June 07, 2014

Unless you've been living under a rock, you're probably aware that Apple has released a new programming language called Swift. It's still a work-in-progress, moving towards 1.0. Designing a language and a standard library to go with it is no small task, so it's not surprising they haven't gotten around to filling in all . . .

Read More

Auto Layout

I just can't quit you

Russ Bishop
May 25, 2014

I've learned to love Auto Layout, but it wasn't always so.

In the beginning I tried to use it. Really, I did. Despite my best efforts, I ran into a huge wall of failure. Then I went back to springs and struts.

The second time, I read the tutorials, watched the WWDC videos, tried to achieve Zen, and became familiar with the . . .

Read More

Immutability and Thread Safety

it depends on what the definition of "is" is

Russ Bishop
April 17, 2014

When I talk about immutable collections and immutable objects being thread-safe, what do I really mean by that?

Part of what makes traditional multithreaded programming so difficult is that you never have truly accurate information about the state of things. If you ask a list "are you empty?" and the list says "no", you . . .

Read More

Why I Love UIKit

simple but easy

Russ Bishop
April 06, 2014

I don't want my ranting and complaining to give the impression that I dislike UIKit; quite the opposite in fact.

Here's a simple piece of code I just wrote:

 self.brightnessLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; self.brightnessLabel.textColor = [UIColor  . . .

Read More

UIDatePicker: how I hate you

no, seriously

Russ Bishop
April 06, 2014

Oh UIDatePicker how I hate thee.

While working on Storm Sim for iOS 7 I ran into a problem on the Sleep Timer screen. There, I am using a UIDatePicker in countdown timer mode. This is what it looked like (I had already given up on trying to get a dark background for that screen; the UIDatePicker won't let you change text color.)

UI Date Picker

Reveal . . .

Read More

Don't Run You Own Servers

Let me disagree with Marco Arment

Russ Bishop
April 05, 2014

Marco was getting into it with Oliver Haslam over server hosting, and see this post by Brent Simmons. Marco extolled the virtues of running your own VPS or Virtual Private Server. He suggested that you learn Linux administration and port forwarding; that you learn how to setup mysql log shipping and read-only replicas.

Thanks, but no thanks. . . .

Read More

Archive
  Subscribe by Email and Never Miss a Post