Every* developer has wanted to create a product like Slack. A product that is not revolutionarily different but a better designed version of existing products (Zapier, HipChat, Campfire). That is why there are an abundance of Twitter, RSS, Podcast, you-name-it clients. Everyone has their own take on how these utilities […]
Do not click “Submit for Review” after getting a Metadata Rejection
This past week, I had to wait an extra week for an app update to be approved. I received a metadata rejection which is a common way for Apple to request more information about an app. I responded to their […]
With the introduction of a pannable keyboard in the iOS messages app, third party developers have been challenged with how to replicate this behavior. Apple’s provided inputAccessoryView for attaching a view above a keyboard will not work. Because of the responder chain you cannot place a UITextView or UITextField as its own inputAccessoryView. Therefore you can have a view attached above the keyboard, but not your input view like in the Messages app. Also, the issue of providing the keyboard panning functionality must be addressed.
For a while, I have been using the open source extension DAKeyboardControl to provide this input behavior. DAKeyboardControl uses a category to add a UIPanGestureRecognizer to your UIScrollView. This gesture recognizer is combined with method swizzling and view hierarchy hacks to allow for keyboard panning and block-based callbacks with the keyboard frame. While easy to setup, DAKeyboardControl has been the cause of many crashes and headaches up to the point where I’ve decided to remove it from my apps. The category’s swizzling of UIView’s addSubview method also appears to have issues in iOS 8.
Unfortunately, there is not a perfectly clean solution for mimicking the iOS Messages.app’s input view. When working on a solution, my goals was to create the most future-proof implementation as well as the most resilient towards bugs. For my implementation, I used a custom UIView subclass which key-value observes changes to its position. This subclass provides block-based callbacks informing you of the keyboard frame. Along with this subclass, I take advantage of iOS 7’s addition of the keyboardDismissMode property to UIScrollView. By setting this property to UIScrollViewKeyboardDismissModeInteractive the keyboard can be panned with the scroll view.
Now you might be wondering why using UIScrollViewKeyboardDismissModeInteractive would be enough to get accurate updates of the keyboard’s frame as the user pans it. Unfortunately, none of the notifications for keyboard frame changes don’t accurately reflect the changes made while panning. Therefore the frame observing subclass is also required. Key-value observing of a subview’s position is not a recommended practice, but in this case it was the only viable option.
Here is a link to the project on GitHub. I have already released it in several of my apps and it is working very well. Let me know if you have any issues, questions, or suggestions.
BABFrameObservingInputAccessoryView on GitHub
Last night I enjoyed speaking on an Android versus iPhone panel at the Nashville Mobile Developers User Group. Jon Wiley and Todd Grooms joined me on the iPhone side and Zach McCormick and Kenneth Rankin lead the Android side. We had a lively discussion with great points on both sides. Big thanks to the organizers for running the event and inviting me to lead the panel.
You can find a video of the discussion here:
At the end of September, I married my high school sweetheart, and we immediately left for a honeymoon in Europe. All of these photos are from my iPhone 6 Plus.
Our first stop was London for a few days. Since we’d visited the city before, we mainly spent our time shopping and enjoying the city’s […]
At Tuesday’s event, Apple began with the expected release of 2 new iPhones, boasting larger displays and the usual improvements we’ve come to expect – better cameras, faster processors, and the much anticipated inclusion of a NFC chip that enables a new type of device-device communication. The new iPhones feature a slimmer, more […]
When Kanye West offers to redesign your app…you’d better know something’s broke. Despite having the most liked photo on the platform, Mr. West recognizes Instagram’s shortcomings and staleness.
Over the last few months, the team at Aloompa has been working on an update to our take on social photography: OKDOTHIS. This […]
As a follow up to WWDC yesterday, I joined the NSVille podcasters to talk about Apple’s announcements.
Last Thursday night, the OKDOTHIS team and I had the fun opportunity to talk about our app at the Cool Springs Apple Store. This is one of the few events Apple has had at the Tennessee retail stores, so we were honored to be asked to come and speak. At […]
It’s been exactly one year since the reboot of Nashville CocoaHeads last February. I’ve loved seeing the Nashville developer community grow along with the connections and ventures which have come out of the group. Members I’ve talked to have expressed how the community has inspired and motivated them in their […]