One of the advantages of working with Just Eat is their commitment to Open Source. As an iOS team at Just Eat we are always looking for ways to separate our code into useful, self contained components, and where possible, make them available to the community.
Recently I’ve been involved in open sourcing 2 Swift modules, with 1 more that can hopefully be open sourced soon.
The ability to persist data is a key component for many apps, and all too often as your app grows in complexity, you find the implementation details of your persistence solution littered throughout your codebase.
This is not ideal. No matter which persistence solution you choose, Core Data, Realm, User Defaults, Keychain, to name a few, your requirements may change as your app grows. When you do need to change your persistence solution, unpicking all the related code is no small task. Testing can also be tricky, with complex persistence stacks needing to be setup and torn down.
JustPersist aims to provide a implementation agnostic interface to your persistence solution. By keeping your persistence layer behind the JustPersist interface, you ensure testability and the ability to swap out persistence solutions as your needs change.
Here this the Just Eat tech blog post.
A key non functional requirement if any app is that it is quick, smooth and responsive. To achieve this, you will be frequently working with asynchronous code. Grand Central Dispatch is great, but jumping back and forth between queues can easily become unwieldy with nested blocks.
Doing a full rewrite enabled me to take full advantage of Swift’s generics system and other advanced Swift features. It also allowed me to tidy up the conceptual model and base the
NSOperation), since handling a long running task is exactly what
Operations are built for.
Here is the @justeat_tech @justeat_tech twitter account, announcing the release:
The iOS team is proud to release a major update of JustPromises rewritten in Swift 3 😎 https://t.co/cSr4tpyfIR— JUST EAT Technology (@justeat_tech) December 5, 2016
Other iOS Open Source
The rest of the Just Eat iOS team have also been busy contributing to the open source community
JustTrack is an event tracker.
- Events are declared in a .plist file and Swift 3 code is automatically generated at build time from it.
- Events can be sent to multiple destinations (called Trackers) at the same time.
- Custom Trackers are easy to create and use.
Remote logging to multiple providers from one interface.
JustPeek ports Force-Touch Peek/Pop-like interactions to devices that aren’t force-touch enabled.