Author Archives: luis

Swift – 53 Days Later

The bomb dropped at WWDC. 5,000 of my fellow iOS and Mac Developers were sitting there at Moscone West when Craig Federighi said:

But we had to ask ourselves the question what would it be like if we had Objective-C without the baggage of C?

At that point, there erupted a mixture of nervous laughter, gasps and excitement. My Objective-C heart sank but my curious brain lit up at the opportunity to learn a shiny new language: Swift.

I’ve been fortunate enough to be able to use it almost daily in my work at Capital One. So what have I learned in these past 53 days?

First, Objective-C is not going away yet. We still have a majority of our codebase in Objective-C. All the popular third party libraries that are utilized via CocoaPods are in Objective-C. Fortunately, Apple has built really good interoperability between Swift and Objective-C and vice-versa. My coworker Jonathan Blocksom and I gave a talk about this at MoDev Coders Only, titled “Swift and Objective-C: Best Friends Forever?”

Second, Swift is a real pleasure to code in. It is a lot more succinct due to the lack of header files, square brackets replaced with dot syntax and parentheses, no semi-colons, etc. You do trade in some dynamicness but you gain safety by the compiler doing work for you, like checking that you have assigned variables before use.
There is definitely a transition / learning curve, but it is relatively shallow compared to the one I faced when learning Objective-C back in 2005. Especially since we had to do retain/release and I had come from a series of languages that had garbage collection like Smalltalk and Java.

Third, Xcode betas can be painful. I separate this out from Swift as a language even though they are intertwined. It seems like the Xcode betas are on a two week sprint cycle, so we are on beta 4 as of this writing. This is only a temporary problem though, but I think it has dissuaded a number of developers from jumping in headfirst. Yes, sometimes I do cry when SourceKitService terminates and I lose all syntax highlighting, but that is balanced out by being able to code in a modern language like Swift.

Fourth, Swift has injected a lot of energy into the Apple development community. It hasn’t been buzzing like this since when the iPad first came out. We’re devoting half of iOSDevCampDC to it. I’ve seen a lot of new developers start to come out with the promise of a new, modern language that is more familiar looking. And the allure of a level playing field, since everyone, from Objective-C greybeards to college graduates, have the same challenge and opportunity to learn Swift from scratch.

I’m personally still excited about Swift. I think we’ve barely scratched the surface. We’re entering a new, more modern age of iOS development.

Further Thoughts on Being Productive

I’ve recently come across Cate Huston’s blog and she has inspired me to start blogging again. I thought I’d echo her post “Thoughts on Being Productive” with my own. I had been wanting to catalog my current best practices anyways so I can remember it in the future. Maybe many years from now, I’ll dig it up like they recently did with the E.T. Atari cartridge.

Mechanical Keyboard

I use a CMStorm QuickFire Stealth keyboard. I originally got into mechanical keyboards because of StarCraft 2 and picked CMStorm because they sponsor one of my eSports heroes, Polt. I realized though that they made typing really pleasant and as a result, programming. There’s just a satisfying feeling to the way mechanical keyboards respond to your fingers. I use the Red Cherry MX switches because they are a lot quieter than the clicky Blue switches that people use, plus they require a lower force to actuate. I’ve outfitted a keyboard at a previous client with red O-rings to make them quieter but they change how they feel so I prefer them without the O-rings.

Magic Mouse

Apple’s Magic Mouse has not changed in a while but it is still the mouse that I use. Some people may say that it is not quite as ergonomic as a Logitech Performance Mouse MX. However, for me, I’ve found that using that a Magic Mouse lets me click with two or three fingers at once, distributing the force needed among my fingers. I guess low force is key for me and programmers in general should think about this as well. If you’re a good programmer, you’re going to be typing and clicking a lot, so you should consider how you’re going to take care of your hands over the long run.

For gaming, I use a Logitech G300. It works well with my finger-tip style method of mousing, like the Magic Mouse. The many buttons are a lot better for control though. I won’t use that mouse for day-to-day development though, because then my index finger gets worn out.

Thunderbolt Display

The classic Thunderbolt Display is a staple of iOS Developers everywhere. I use one, propped up on a Beats headphone box (they’re really strong – a big chunk of the price is probably in the packaging…) with my 15″ Retina MacBook Pro centered underneath, in front of it. I don’t have many complaints about it especially since it serves as a hub for Ethernet and USB and it has a lot of real estate.

However, I think we should be well into 4K Displays soon so I’m looking forward to having a 27″-32″ Retina-quality display for day-to-day development sometime in the next year.

Walk 9,000+ steps a day

When I was an Indie Developer, I had no idea, but I basically sat around all day. Last year for my birthday, I got myself a Fitbit Flex and measured myself. I was shocked to realize I was super sedentary and was only taking an average of 3,000 steps a day. Recently, I joined Capital One and between a combination of walking up 5 flights of stairs from where I park to where I work, walking around the floor where I work, walking on a treadmill desk for a bit and going to the mall for lunch most days (plus some walking at home), I’m up to 9,000+ steps a day. As a result, I’ve lost 10+ pounds in the past 2+ months and have gained more energy throughout the day.

Stand or talk a walk every so often

Fitness aside, I think it helps to take breaks during the day. I’ve literally sat for hours at a time in front of a computer and I’ve come to realize that it is bad. Spending time with your computer is fine and all, but just not so many minutes straight. Every so often, at least once an hour, either stand up and stretch or take a quick walk. I’ve been doing that over the past year and it has helped me avoid the aches and pains that I’ve had throughout my career when I sat at my computer too long.

Also I use an push-button sit-stand desk. At home, I use a GeekDesk and at work, a Haworth. They’re both great desks in my opinion. I probably sit 2/3rd of the time and stand 1/3rd of the time, but the key I think is just varying it throughout the day. I find I can work effectively either way.

Treadmill desks like I mentioned earlier are also good, but they make you give up a lot of manual dexterity. So they’re not great for wiring up storyboards and configuring auto-layout. However, they’re fine for doing things like checking email and Twitter or reviewing resumes where you’re doing more reading or viewing.

Immerse yourself in headphones

I work in an open workspace. I think it is pretty cool with the different textures and varied lighting making it a very pleasant place to be. But frequently I want to tune all that out and really focus in on my code. I’m not sure if we Apple is going to acquire them or not, but we’ve got a rack of Beats headphones at my work, both the Solo HDs and the Studios. They come in a variety of colors so I can sort of match them to my outfit, which sounds vain when I type it out, but trust me, it is kind of a nice touch, especially with my blue shirt that matches the Beats blue perfectly. In any case, we have a rule on my team where if someone has headphones to not interrupt them, so as a result, I can get a lot of work done, with music that helps my mind flow. Plus I may dance a bit when my desk is standing. Because if you’re enjoying what you do and enjoying how you do it, I think you can be really productive.

Contributing to CocoaPods

If you’re an iOS Developer, you probably have heard of CocoaPods. More and more developers are using it. I’ve personally used it on many projects and I’m not sure I would want to go back to the old manual way of adding in libraries.

A few weekends ago, on March 29th-30th, they had the CocoaPods Bug Bash. I used to work a lot on the weekends when I ran my own iOS/Android consulting business, but now that I’m working at Capital One, my weekends are pretty wide open. Yay for work-life balance! (P.s. We’re hiring iOS Developers, just contact me.) But since I’m kind of nerdy, I thought what better way to spend my new-found free time than by writing some code.

I hopped onto the #cocoapods IRC channel, registered and then asked the CocoaPods bot to assign me a ticket. By the luck of the draw, I got issue #1489.

I set up my development environment by cloning the CocoaPods/CocoaPods repo, then initialized via rake bootstrap and ran the tests via rake spec.

At that point I realized, oh this is all in Ruby! For some reason I had thought it had more Objective-C in it, since it dealt with Xcode so heavily. Fortunately for me, before the iPhone SDK came out, I had made my living for a while creating Ruby on Rails apps. I quickly rediscovered my love for Ruby.

I loved it so much, I spent most of that weekend hacking away on CocoaPods and the weekend afterwards. At the end of it, I had touched not only the main CocoaPods repository, but also the internals of it in CocoaPods/Core and the high level tests in CocoaPods/cocoapods-integration-specs.

I’m now an contributor to all of those repositories and thus the CocoaPods project! I also got into the CHANGELOG twice:

0.32.0

An informative error message is presented when merge conflict is detected in a YAML file.
Luis de la Rosa #69 #100

0.31.0

Generated prefix header file will now have unique prefix_header_contents for Pods with subspecs.
Luis de la Rosa #1449

The most enjoyable aspect for me though is that it is fun to hang out with other developers from around the world. @orta, @irrationalfab and @alloy are pretty cool fellows and they are welcoming and helpful when they are around in IRC. They are definitely not shy about asking you to squash your commits, but they are also quite friendly with their emotes in pull request reviews.

I’m planning on doing some more hacking on CocoaPods. If you’re interested, I can help you get started with it if you’re in the DC area and come to NSCoderNightDC. Another good way to get started is to join the IRC room #cocoapods, set up your development environment and then just ask which issue might be good to work on. You might also want to follow the CocoaPods Twitter account and look for the “Simple open contribution of the day” which highlights simple issues to get you started.

Android + Glass Meetup

Did I mention that I started up a group called Android + Glass, a meetup which is focused on developing apps for Android and Glass over in the Tysons Corner area?

In addition to iOS, I also like to develop for Android. I’m also a Glass Explorer (I got in on the second round thanks to my buddy Andrew at Near Infinity.) Since the native Glass SDK, the GDK, is built on top of Android, I get to leverage all of that for Glass dev.

I also have a passion for getting developers together. I’m not sure exactly why, but I think it is just great to meet other programmers and talk with them. Maybe so we don’t feel so alone in the world? Not sure.

Also it is nice to have a meetup group that is close by. Around where I live and work, traffic is brutal. We regularly tie with Los Angeles for the worst traffic in the USA. It’s so bad that a guy from Manhattan said that he thinks our traffic is bad. Manhattan!

So I’ve started a local Android and Glass (and likely soon Wear) development group in the Tysons Corner area. We’re meeting at Capital One DIG, which is the building next to the infamous “shopping bag building.” It is kind of connected to Tysons Corner via a walking bridge too, which is nice if you want to go there to shop or eat beforehand.

Why start another group? Proximity and focus. There are other groups that discuss Android and Glass, but none in the immediate area. They usually meet either near Dulles or in downtown DC. While that seems close on a map of the USA, it can be an eternity in rush hour traffic.

Our focus is also purely on Android and Glass (and Wear) development. We don’t really talk much about other Google technologies unless they build on Android like Glass. We talk a bit about Glass usage because it is so new. We are also exploring related wearable technologies because the whole wearable space is pretty new. But we always look at them through a development lens: how can we write apps for that platform? What applications make sense in that context? What are the common techniques when developing with that API?

I do like the other local groups, namely the GDG-DC, Google Glass DC and DC Droids. I will likely go to their meetings occasionally and I encourage you to go there as well, especially if you live close to them. If you love all Google technologies, GDG is the best bet. If you like to explore all aspects of Glass, not just the programming side, Google Glass DC is probably better. But I hope to make a nice cozy regular meetup for Android developers and Glass developers here in the Tysons area.

Speaking of which, we have already had two meetings and we will have another one on April 29th, where we’ll be talking about mostly about Android and Bluetooth LE (and we’ll also have an Oculus Rift on hand to compare and contrast vs Glass, especially the SDKs.) We will have regular meetings, which I think is important for a meetup – as I’ve learned from Jose, the organizer of NSCoderNightDC. The meetings after that are scheduled for May 21 and June 18.

If you are interested in makings apps for Android or glassware for Glass, I encourage you to join the meetup group and RSVP for one of the upcoming meetings. Did I mention there will be free pizza and drinks courtesy of Capital One? :D

iOSDevCampDC 2014 Coming in August!

Mark your calendars: the date for iOSDevCampDC 2014 will be Saturday August 2 Friday August 1, 2014. We’ve booked a big place this year for iOSDevCampDC 2014 – the new DIG space at Capital One in Tysons Corner. It will follow the same one-track format, although we’re thinking of having some more time in-between sessions so we can enjoy the game room. I hear foosball and air hockey are good for learning. :)

We’ve also issued a Call for Speakers, ending on March 28th, so if you’re interested in speaking, send us a talk proposal with what you want to present, a short bio and link to your Twitter (or other) profile to info@iosdevcampdc.com. We would love to have at least one female speaker especially. Natalia presented along with Keith and Kiril about Harbor Master back at iPhoneDevCampDC and she was well received.

If you are interested in attending, please stay tuned and follow @iosdevcampdc on Twitter. We’ll likely be opening up early bird ticket sales sometime in April.

I’m going to be speaking at WearablesDevCon

WearablesDevCon is a conference about wearable technology from March 5 – 7 over in San Francisco.

I’m going to be giving two talks:

A tutorial called “Transitioning from Android to Google Glass” where I will take people from building apps for Android (and mobile devices in general) to Glass.

I’m also going to go in-depth into live cards in my talk “Deep Dive into Google Glass Live Cards.”

I’m really excited about Google Glass. I think it is going to be the premiere wearable general computing platform. I’m also interested in seeing what other wearable technologies are out there. If you’re interested in Wearables, then check out WearablesDevCon. If you use my last name “DELAROSA” as a coupon code, I think you get an extra discount.

Enable Two-Factor Auth in GitHub

My source code is really valuable to me. So I like to secure it as much as possible. GitHub does a good job of securing things on their end. I use SSH to pull and push my code so that it is securely transmitted over the network to my computer.

However, there is still a potential problem with having a single password to log in to the GitHub website. That log in also allows access to your code. If someone wanted to pull from one of my repositories, they would have to have my SSH private key (and password) which is on my computer. If they somehow figured out my password, they could just log in from anywhere. How can I stop that from happening? Obviously, generating a random, unique password using a password generator like 1Password will help. But that isn’t enough, since someone could stand behind you and watch you type it in on your computer or phone, then later impersonate you.

What I need is Two Factor Authentication. This makes it so that an attacker needs both my password AND a physical device (i.e. the phone I carry around.) That device either receives an SMS with a code or has a synchronized authenticator app that generates a code that I enter in my password. It is easy to enable this on GitHub and I recommend that everyone do so.

To enable Two Factor Auth, follow the instructions at: https://help.github.com/articles/about-two-factor-authentication

Note that for ongoing authentication, I personally use Google Authenticator but others like to use Authy. You can also use SMS to get your codes if you prefer.

I have my backup recovery codes stored away in case of emergency. These are useful if you lose your device – you have to make sure these are also kept secure.

I’m giving a Google Glass talk at DevIgnition

If you’re in the Washington DC area, please come to my talk about Developing for Google Glass at DevIgnition. I’ve only got 30 minutes, so it will be a whirlwind tour but it should be enough to get you started on the premiere platform of the Wearable Generation(TM).

Also, I wrote up a blog post on the savvy apps blog discussing my initial thoughts on the GDK.

UPDATE: The slides are available in the Glass section of my blog.

Lagunitas – an iOS app inspection tool

If you make iOS apps, sometimes it is helpful to verify that the archive you made via Xcode has what you expected inside of it. Lagunitas is a tool to help you do that, courtesy of @soffes.

I just tried it out and it works great. Here are some usage notes:

I use rvm so I have a nice Ruby 2.0 environment on Mountain Lion, so I installed the Ruby Gem for Lagunitas like so:
rvm use 2.0
gem install lagunitas

After that, I changed to the directory that had an IPA I was interested in.

I fired up irb:
irb

Once in irb, I required (which is like an import) lagnuitas and tried to inspect the app inside the IPA:
require "rubygems"
require "lagunitas"
ipa = Lagunitas::IPA.new("myAwesome.ipa")
app = ipa.app

I was confronted with this error message:

NameError: uninitialized constant Lagunitas::IPA::SecureRandom

And so I guessed at the right require:
require "securerandom"

Voila – that fixed it and everything went well after that:
app = ipa.app
=> #<Lagunitas::App:0x007ff002905570 @path="tmp/lagunitas-e5c477f91f8777d76f2c9e79ececd358/Payload/myAwesome.app">
app.identifier
=> "com.luisdelarosa.myAwesomeApp"

iOSDevCampDC 2013 coming up this Saturday August 24

Time flies. We’re having our fifth iOSDevCampDC already! Well, technically it was iPhoneDevCampDC, then iPadDevCampDC, then iOSDevCampDC after that. The 2013 version is happening this Saturday, August 24 at Viget Labs. I have to give a lot of thanks to Viget since they’ve hosted us 4 out of the 5 years!

We sold out again this year. Something we’re trying is to not have any sponsors to simplify things a bit. We’ve appreciated all the sponsors we’ve had over the years, but inspired somewhat by iOS 7, we’re trying to make things simpler and flatter. The website (iosdevcampdc.com) is another thing that is a bit different – we’re going with a one page design this year to see how that goes.

Well – I’ll see everyone who got a ticket on Saturday. Feel free to say hi. Hopefully it will be our best one yet!