swift How I Usually Do: Networking - Swift 3 During the time I was an iOS developer I picked up some patterns for doing networking. There is a lot of decisions to make when implementing networking, but this general solution is my favorite. I'll go through an example API I implemented. Networking Class class Api { enum Error:
Guest Post: Swifty Cell Dequeuing My coworker wrote an article about a piece of code I wrote. You can check it out here: https://swifting.io/blog/2017/04/19/40-how-to-swiftly-dequeue-a-cell/
Guest Post on swifting.io: Core Data + Protocols I've done a guest post on the blog of my coworkers. You can check it out here https://swifting.io/blog/2017/02/05/35-structs-alternative-using-swift-protocols-to-enhance-safety-of-core-data-access/
My favorite iOS interview question It's a question I like to ask a lot on interviews. Please tell, what are the possible orderings of the digits logged onto the console in every case. Case 1 -(void)f { //runs on main thread NSLog(@"1"); dispatch_async(dispatch_get_main_queue(), ^{ NSLog(
CALayer Flirting with people - iOS style There was a girl I liked. I did not know how to draw, sing or say cute things to impress her. I decided to make something cute the only way I knew how - by doing animations on iOS. This is the result: Drawing curves To create an animation of
power Making your OS X not sleep while running scripts We have a lot of script at Wikia. About 6k lines of code of Python. Most of them are usually run in loops like this: for app_directory in app_directories: script() This can take a lot of time, especially that some of the scripts use Selenium and we have
iOS Fastlane Tools KrauseFx [https://github.com/KrauseFx] recently released Fastlane Tools [http://fastlane.tools], a framework for automating the release process to the App Store (and more). I encourage you all to check it out! At Wikia [http://wikia.com] we developed a similiar automated process for creating and submitting Apps, but
fast Fast dependency installation (gem, brew, pip, npm) At Wikia we write a lot of scripts and use a lot of tools to manage our App Farm. Anyone in the team should be able to use the scripts in the same way, so we created a little script that installs all the dependencies. This file initially looked like
subtree git subtree - a better alternative to git submodule To manage a lot of libraries at work, we once decided to use git submodules. The idea looked easy. Create a submodules/ directory in the main repo and then every library is checked out in the directory as a submodule. This idea had some additional benefits, every library had its
simulator Reset the iOS simulator using Frank Frank page [http://www.testingwithfrank.com/user_steps.html] has some step definitions contributed by users. The step for resetting the simulator is very useful, as there is some state in the App, and it's hard to test around it. For example if you have a "Rate
enumerateObjectsUsingBlock: Hard to notice multithreading bug During working on my UIBezierPath reimplementation to enable checking for crossing paths I encountered a bug. The bug was really hard to debug. It happened randomly. App was generally unstable, it was crashing randomly and in random functions, both mine and Apple's dealloc, retain, etc. I was quite
objective c Scaling a UIView with subviews staying the same size Easiest way to scale a UIButton or a UITableViewCell is to set a transform on it: view.transform = CGAffineTransformMakeScale(1.5f, 1.5f); If this works for you that's perfect, but sometimes some subviews start looking bad when zoomed in, especially images and text. To make the UIView
xcode One weird Podfile trick to manage your App farm We have a lot of apps in Wikia [https://itunes.apple.com/us/artist/wikia-inc./id422467077] and a lot more to come! To manage the codebase we're using CocoaPods [http://cocoapods.org] with our whole code split into local Development Pods [http://guides.cocoapods.org/making/making-a-cocoapod.html#
app farm Using Crowdin Working with translators can be a hassle. Especially if your App is translated to 10+ languages and you actively develop new features that require localization. New translations come in from the translators, developers already added their new strings to localization files - everything has to be merged somehow. This article
pixel perfect Aligned UIViews The iOS Simulator has some nice debugging options. One of the is the Color Misaligned Images option. According to the documentation: > Places a magenta overlay over images whose bounds are not aligned to the destination pixels. If there is not a magenta overlay, places yellow overlay over images drawn
objective c Human Interface Guidelines compliant UIButton subclass iOS Human Interface Guidelines [https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/LayoutandAppearance.html] tell us: > Make it easy for people to interact with content and controls by giving each interactive element ample spacing. Give tappable controls a hit target of about 44 x 44 points. Sometimes