Developing our own framework, the AilPod

Wassa Team
Wassa
Published in
3 min readMay 18, 2017
Developing our own framework, the AilPod by Wassa

Last November, we, the engineering team at Wassa, noticed we had 3 different issues that needed a quick fix:

  • Apple release swift 2.3 and swift 3 making most of our dependency framework not compiling. Objective-C is not subject to version change, so changing our dependency from swift to objective-c could make it work. Of course by reversing the language, we knew we would have to re-reverse back to swift language
  • We were using very similar code for native UI components (like UITableView and ToggleButton) This issue was leading in more testing and more bug fixing. Most of our projects are depending on tableview and UI stability.
  • We had a tendency to reuse code between projects without versioning it separatly

Those 3 issues have something in common: they can be easily solved by the creation of our own internal framework.

This is why we started developing the AilPod (pronounce as a french: “i-pod” ;-) )

The first and most urgent feature we developed was a network class using AFNetworking (objective-c) instead of Alamofire (swift).

Most of our projects make requests to REST APIs, but because of the new version of swift language, Alamofire became outdated and uncompilable. Our solution was to design a specific class called “AilNetworking” to implement AFNetworking features. By using Objective-C instead of Swift, this class does not depend anymore on Swift version. AilNetworking exposes the following functions:

The second feature developped was extensions to classes from Foundation and UIKit: String, UIView, NSDate, UIColor, etc.

The extensions for those classes implement basic features missing from Foundation and UIKit, like:

  • String: return the localized version of a string, for exemple: “my_localization_key”.localized() -> “Localized String” func localized() -> String
  • UIView: make layer properties easily available from view
  • NSDate: comparison operators
  • UIColor: Parse a string formatted as following “#FFFFFF” to transform to a UIColor object

The third most important feature is a custom implementation of a UITableViewController and its delegates: UITableViewDelegate and UITableViewDataSource.

Instead of re-writing the same basic implementation, the AilTableViewController class links a UITableViewCell and a custom type so the view is aware of what to display. This is how you can implement this custom AilTableViewController:

After months of using the AilPod, we consider the project stable and well documented. As our developers would say: “Sometimes I think I found a bug in the Ailpod, and then I realize I was not using it correctly”.

Our last issue about this project is to know what to add next: is a feature general enough to be added in the project ? Every new feature is discussed between the team members and is subject to several editing before being present in the AilPod.

Finally, by developing this SDK, we improve our skills to expose functions through a SDK. This knowledge will lead us to develop new internal SDKs, like one geolocation and 3d maps rendering.

Do you want to know more about Wassa?

Find us on:

--

--

Wassa Team
Wassa
Editor for

Wassa is a company specialized in the design of innovative digital solutions with great added value.