iOS, Objective-C, Swift, Design and Whatever Comes in Mind

Building My own iPhone Dock

During the last few days, I spend my time crafting a pice of timber.

picture of the pice of wood in its natural state

This bunch of oak was meant to be firewood and therefor it was stored and dried for about three years.
During this period, it lost all of its remaining humidity and became as hard as oak can be.

My work started with dressing it until only a rectangular board left. Even though is was realated to much dust, noise and strands the result was fascinating, as it was free of any defect and quality wise almost looked like an oak table that you can buy as furniture.

In order to gain my desired shape, I needed one side to be as angular as the iPhone that will stand on it after it is finished (20°).

Image of the rare-shaped timber after dressing

I am not meant to go into every single detail, therefore I skip the parts of drilling the hole and sanding it until the shape was perfectly right.

The question 'On what should the iPhone stand on? was answered before I started my exercise. I decided to buy an rather cheap lightning cable from Amazon.
As Apple uses the same technique for their docks (namely resting the iPhone on the lightning plug), I felt ok on doing so, too.

But lets move along in our manufacturing story.
The hole was drilled and the final shape achieved. What comes now can be described as "milling a canal for the cable" and "oiling", so it matches the color of my desk.

Which brings me to the intension behind it:
I dont want a shiny-plastik dock, but a place for my iPhone to rest that matches the style of my furniture, especially my oak desk.

Image of the finished dock

Mission accomplished.

"Building My own iPhone Dock".

Meta

To get make this blog a more vigorous place, I challenge myself:
Write at least one blogpost a week.

Honestly, for one simple reason: I just want to practice writing.
A nice side effect would be if someone is reading my words, but I am (probably) not going to pick topics that gain a lot of attention. Just trying to be myself and writing about 100 words a week. That's my goal.

Lets get started...

"Meta".

NSNotification

One of my favorite new features in iOS 9:

Objects that have registered to NSNotificationCenterare now weak referenced and therefore there is no need about un-register a given observer.
🎉

It gets far less attention as I expected, due to the fact, that it makes using NSNotification much simpler.

Prior to iOS 9, you have to keep track of all every notification name that you have registered to the NSNotificationCenter.
Once the registered object will be de-allocated, you have to un-register it manually. Otherwise, it will be kept in memory and cause a crash if the desired notification is fired.

Whether you use
addObserver(_ notificationObserver: AnyObject, selector notificationSelector: Selector, name notificationName: String?, object notificationSender: AnyObject?)

or the newer block-based approach
addObserverForName(_ name: String?, object obj: AnyObject?, queue queue: NSOperationQueue?, usingBlock block: (NSNotification!) -> Void) -> NSObjectProtocol,
you don't have to answer questions like when does this object gets removed or when will this UIViewController disappear.

"NSNotification".