Video: UIKit is Dead, Long Live UIKit!

Philly CocoaHeads held a joint meetup with our Android friends for Philly Tech Week. At said meetup there were a bunch of lightning talks, and I did one.

UIKit is Dead, Long Live UIKit!

With the introduction of Swift and the rise of functional programming ideals in the community, UIKit and its MVC heritage has become a bottleneck for new ideas. This talk speculates how Apple might overcome this in the years to come. Attendee should walk away with a curiosity about the other UI patterns being developed and a resource list to learn more.

UIKit is Dead, Long Live UIKit! from Philly CocoaHeads on Vimeo.

Related Reading:

I actually had a few vocal flubs in the recording (was a little stressed about the 10 minute limit) but figured I’d use the live one anyways since it has more humanity than me speaking to myself in my room. I hope you enjoy!

Meet OwlDeck, a New Mac Presentation App for Programmers and Markdown Geeks.

Today I’m launching the teaser site for my new app, OwlDeck.

OwlDeck is a new macOS presentation tool for programmers and geeks who need to display code and love Markdown.

If you are interested in OwlDeck I’d love for you to signup to its newsletter and email me your thoughts.

If you are interested in some behinds the scene stuff you can checkout the project journal I’ve been keeping over at Rested Experience. I hope to share more now that things are going public and timelines are set.

Really excited to be working on products again. :)

Introducing Zorn Labs LLC

As I alluded to after loosing my job at the end of January, I knew I’d take the majority of February to recover from my neck surgery and then get serious about work in March. We’ll it’s almost the end of March so I figured I’d do an update.

First, welcome Zorn Labs LLC, my new company. It will house my future consulting and product work.

Second, I am still looking for work. My goal is to find something 10-30 hours a week, doing iOS or iOS mentoring. To help express my skill set and goals I’ll point you to the new company site. I would appreciate all friends and followers to help spread the word.

Outside of setting up the new business and website, much of March has been spent towards marketing and planning. I had many lunches and coffees with prospects and friends. I even had a few offers but they sadly weren’t the right fit for me at this time. When I haven’t been marketing I’ve been trying to jumpstart some new web skills, refreshing my HTML5/CSS3 knowledge, getting deeper into Hugo template design for the new Philly CocoaHead website, and experimenting with Elixir and Phoenix.

For those interested in my Mac app project, you can also check out my project journal blog at: http://restedexperience.com. I’ve been trying to update that a little more often with my recent progress.

So that’s my March update. Thanks for the interest! More to come in April! :)

Accessibility

At the Apple event a few weeks ago they began with a short video on accessibility.

I’ve learned a lot about accessibility on iOS over the last few years. Apple’s products are some of the most accessible in the world and for all the frustrations I have with Apple, this is definitely one of the high points I’m proud of.

I was also really pleased to see our own Philly CocoaHeads give accessibility some attention at a recent Side Project Saturday event. A group of people worked on improving the accessibility of the Wikipedia iOS app.

Group of Programmers using Voice Over on iPhone

Anyways, I think the time is right for development agencies and indy consultants to put accessibility front and center. For them to say loud and proud, any app you hire us to build will have some basic level of accessibility.

Some people whom I bounced this idea off of thought it would be bad for sales. Maybe. But these are the probably the same clients who question code review because they think it is a similar waste of money. At the end of the day we all have have some level of standards onto which we execute our craft. People hire us because they can’t build software. They need us to point them in the right direction.

Somewhere out there, a construction agency is in a discussion whether or not to add a wheelchair ramp to the current project. Some people will add it because it’s required by law, others will add it because it’s the right thing to do.

The software industry moves incredibly fast, maybe even too fast. We don’t have regulations and inspectors like other industries. We have to regulate ourselves. The tools to improve access for our creations are ready. They work really well. They sit there, waiting for us to use them.


I don’t want to come off like I’m some know it all when it comes to accessibility. If you need real help with your app, contact my friend Austin who does consulting on the subject.

I do have some experience enhancing a few personal iOS apps and hope to make it a larger priority with my upcoming side project. Like a lot of things, I think the goal here is for continual learning and small, iterative improvements.

Documentation for NSViewController init(nibName:bundle:) is incorrect

Radar: #28802828

Documentation for NSViewController init(nibName:bundle:) is incorrect from Mike Zornek on Vimeo.

I say the wrong thing a few times in this spontaneous recording but hopefully there is enough here to reveal the problem. Not a major problem by any means but the Mac frameworks need all the love they can get so let’s be sure to report the changes we want to see.

Closing Thoughts on Big Nerd Ranch’s Front End Web Class

I posted a few thoughts while I was attending the Front End Web class last week and I figured I’d put a cap on it with some final thoughts.

Disclaimer: If you happen to find this post and don’t know, I do in fact work for Big Nerd Ranch, so yes I’m partial but these are still my honest opinions.

Who is this class for?

Like other BNR books and classes, there is an expectation of some experience. You don’t need to be an expert by any means for this class but you should be comfortable with the basics of web design, hosting and how the web works. If you are looking for these beginner skills I’d recommend Code School and/or Code Academy.

With the basics taken care of, this class provides an accelerated but thorough tour of modern web development and the toolchains that you need to know. The class is great for people like myself, who have a history of web development but have been out of the game for a few years or mostly focused on the backend systems. Others who would find value include those who are looking to jumpstart a new web skill set for a new job or project.

Having a full week to escape the distractions of work and personal obligations really enables you to focus on the class at hand. Combine this with guided lectures and an experienced instructor to answer questions and discuss patterns, really elevates the value to “priceless”.

The Syllabus

The table of contents titles don’t really do justice to the details of each chapter. In total we build four separate projects:

  • The first had us work with HTML5, CSS and JavaScript to do a moderately complex layout of a slideshow like page that included animations, responsive layout and modern markup techniques.
  • The second project was a Coffee Order system the helped us use HTML5 forms, Bootstrap styles, and JavaScript to communicate with a backend via AJAX.
  • The third project was a chat app, that utilized web sockets. For this app we not only built the front end but the backend too, in Node.js.
  • The fourth and final project was an EmberJS app that would have us catalog monster sightings. Ember is a big framework but I think the book does a fair introduction. We got to work with a relationship of models, and executed all the big features.

I thought the chapter and project progression went really well. There are some who might prefer to end with Angular or React instead of Ember but the good thing to know is the early class concepts give you a great JavaScript foundation to build on so you’ll be empowered to experiment with all of those projects and more over time.

That is a core value of Big Nerd Ranch classes that I really agree with. They teach you from the bottom up so you can understand how things work and not just how to assemble/configure things.

The Extras

There is lots of open lab time at night. You are encouraged to bring a side project to work on. While I did make some progress on my own project, an Ember Wiki project (I have some basic models and forms working, all backed up my a Firebase persistence layer), I did have to dedicate some lab time to the book itself to make sure I kept up.

In the afternoons we’d have time for a walk around the resort and on some of the days we even arranged for a shuttle van to take us to some of the exhibits, like the Birds of Prey and the Butterfly Center. Considering how focused we are during the class, these excursions are very welcome and a great way to clear your head and get a second wind.

Final Thoughts

If you want to learn a new technology, in this case Front End Web Development, and in particular if there is a time-sensitive nature to your needs it’s hard to imagine a better environment than a Big Nerd Ranch class. The ticket price does include lodging and food for the week so keep that in mind when shopping around or putting together a formal company request. If you have any questions, feel free to contact training support. They’ll be happy to help you out.

Mid-week Checkin

It’s Wednesday night and as expected it’s been both an exhausting and rewarding week so far here at the Front End Web class. Here is the table of contents we’ve been working through:

  • Introduction
  • Chapter 1: Setting Up Your Development Environment
  • Chapter 2: Setting Up Your First Project
  • Chapter 3: Styles
  • Chapter 4: Responsive Layouts with Flexbox
  • Chapter 5: Adaptive Layouts with Media Queries
  • Chapter 6: Handling Events with JavaScript
  • Chapter 7: Visual Effects with CSS
  • Chapter 8: Modules, Objects and Methods
  • Chapter 9: Introduction to Bootstrap
  • Chapter 10: Processing Forms with JavaScript
  • Chapter 11: From Data to DOM
  • Chapter 12: Validating Forms
  • Chapter 13: Ajax
  • Chapter 14: Deferred and Promises
  • Chapter 15: Introduction to Node.js
  • Chapter 16: Real-Time Communication with WebSockets

And what’s up next:

  • Chapter 17: Using ES6 with Babel
  • Chapter 18: ES6, the Adventure Continues
  • Chapter 19: Introduction to MVC and Ember
  • Chapter 20: Routing, Routes and Models
  • Chapter 21: Models and Data Binding
  • Chapter 22: Data: Adapters, Serializers and Transforms
  • Chapter 23: Views and Templates
  • Chapter 24: Controllers
  • Chapter 25: Components
  • Chapter 26: Afterword

Entering the class I was a little worried that my past web development experience would have made the early chapters moot, but to my enjoyment there is a lot of new web features and tools available since I did Rails full time back in 2012. Flexbox is particularly interesting and has me excited to do some testing to see if it will help me solve some layout concerns I have in my side project.

I also enjoyed the time we’ve spent working in pure JavaScript. We built out a very modularized system that would react to a simple coffee order page. I appreciate how we’ve taken the time to learn JavaScript from the bottom up. It makes you better understand and appreciate what more advanced tools like Babel and Ember are doing.

Tonight we closed with web sockets which is something I’m really hoping to embrace on future projects. Live content, no reload and real-time collaboration is where it’s at.

And then of course comes the “ranch” venue itself. Being able to get away and focus on the learning is priceless. Afternoon walks help clear your head. Here are some photos. Wish you were here. :)

Greetings, from the Ranch

One of the great perks of working at Big Nerd Ranch is that you are allowed to take one Big Nerd Ranch class a year. This week I’m taking the Front End Web class, and am really looking forward to it.

At nights we are encouraged to work on a side project to help practice what we are learning in the day. I think I’m going to work on a wiki app — with a few touches that I myself have an itch for, drag and drop image uploads, code syntax coloring, and more.

I’ll check in later through the week. Wish me luck.

Isolating Mac Application Menu Behaviors

A Place for Everything, and Everything in It’s Place

My side project is a Mac app and last week I was working on a small story about sending feedback.

Send Feedback under Help Menu

As a user, I want to be able to Submit Feedback via the Help menu, So that I let the developer know what I’d like changed.

Acceptance Criteria:

  • Under the Help menu there should be option to submit feedback.
  • Upon selecting this menu item a new email will be open.
  • to: mzornek+storyteller@gmail.com
  • subject: [Storyteller Feedback] [1.0(101)] — that is the version number and build number

This was easy enough to get working but I wasn’t in love with my first implementation. If you read up on the Menu documentation for macOS you’ll find out application menus will follow the Responder Chain . A responder chain of a document-based application looks like this:

responder chain of a document-based application

Now while this is a document-based application this behavior is an application-level behavior. The best spot to put it is in the AppDelegate but I don’t like polluting that class.

My new solutions helps improve the situation in lieu of the framework’s design constraints. I still have the IBAction inside the AppDelegate but it now forwards the behavior to another object that is more isolated, with a single responsibility and is easier to test.

// AppDelegate+SubmitFeedback.swift
import Cocoa

extension AppDelegate {
    @IBAction private func submitFeedback(sender: AnyObject?) {
        submitFeedbackService.submitFeedback()
    }
}


// SubmitFeedbackService.swift
import Cocoa

protocol URLOpener {
    func openURL(url: NSURL) -> Bool
}

extension NSWorkspace: URLOpener { }

struct SubmitFeedbackService {

    private var to: String {
        return "mzornek+storyteller@gmail.com".urlEscape()
    }

    private var subject: String {
        return "[Feedback: Storyteller \(versionString)] ".urlEscape()
    }

    private var versionString: String {
        let appVersion = NSBundle.mainBundle().appVersion
        let bundleVersion = NSBundle.mainBundle().appBundleVersion
        return "\(appVersion) (\(bundleVersion))"
    }

    private let urlOpener: URLOpener

    init(workspace: URLOpener = NSWorkspace.sharedWorkspace()) {
        urlOpener = workspace
    }

    func submitFeedback() {
        let urlTemplate = "mailto:\(to)?subject=\(subject)"
        guard let emailURL = NSURL(string: urlTemplate) else {
            assertionFailure("Email should parse fine.")
            return
        }
        urlOpener.openURL(emailURL)
    }
}

private extension String {
    func urlEscape() -> String {
        guard let result = self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet()) else {
            assertionFailure("Could not escape string for URL")
            return self
        }
        return result
    }
}

// SubmitFeedbackServiceTests.swift

import XCTest
@testable import Storyteller

class SubmitFeedbackServiceTests: XCTestCase {

    func testCallingSubmitFeedbackOpensAMailtoURL() {
        let mockWorkspace = NSWorkspaceMock()
        let service = SubmitFeedbackService(workspace: mockWorkspace)
        service.submitFeedback()
        XCTAssertNotNil(mockWorkspace.lastOpenedURL)
        XCTAssertEqual(mockWorkspace.lastOpenedURL!.scheme, "mailto")
    }

}

class NSWorkspaceMock: NSObject, URLOpener {
    var lastOpenedURL: NSURL?
    func openURL(url: NSURL) -> Bool {
        lastOpenedURL = url
        return true
    }
}

Feels cleaner to me but I welcome feedback. I also suspect SubmitFeedbackService will evolve in time as there is other communication needs in the future.

PS: I hope to share more about the implementation of project in the future. I know there is a void of Mac application programming discussions going on out in the web. I will try to help out with my own journalling the best I can. Questions welcome.

Regarding Knight Rider and Delegation

One of the saddest aspects of being a Big Nerd Ranch instructor in 2016 is that students these days do not appreciate the Michael Knight is to Delegation, as RoboCop is to Subclassing discussion of yesteryear.

From Cocoa Programming for OS X: The Big Nerd Ranch Guide:

Delegation

Let’s start with a story: Once upon a time, there was a man with no name. Knight Industries decided that if this man were given guns and wheels and booster rockets, he would be the perfect crime-fighting tool. First they thought, “Let’s subclass him and override everything we need to add the guns and wheels and booster rockets.” The problem was that to subclass Michael Knight, they needed to wire his insides to the guns, wheels, and booster rockets – a time-consuming task requiring lots of specialized knowledge. So instead, Knight Industries created a helper object, the Knight Industries 2000, or “KITT,” a well-equipped car designed to assist Michael Knight in a variety of crime- fighting situations.

While approaching the perimeter of an arms dealer’s compound, Michael Knight would say, “KITT, I need to get to the other side of that wall.” KITT would then blast a big hole in the wall with a small rocket. After destroying the wall, KITT would return control to Michael, who would charge through the rubble and capture the arms dealer. Note how creating a helper object is different from the RoboCop approach. RoboCop was a man subclassed and extended. The RoboCop project involved dozens of surgeons who extended the man into a fighting machine. This is the approach taken by many object-oriented frameworks.

In the Cocoa framework, many objects are extended in the Knight Industries way – by supplying them with helper objects. In this section, you are going to provide the speech synthesizer with a type of helper object called a delegate.

What do you think the new metaphor should be?