Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rewriting iOS apps in the wild

Karumi
June 23, 2016

Rewriting iOS apps in the wild

Rewriting apps is something that we all do at some point. Being able to ship your new code along with the existing one while the app keeps working is a tricky process that can be counterintuitive at some stages.

In this talk we will go through a set of recommendations, techniques and tips that might help you to rewrite your app without going crazy or spending a disproportioned amount of time in the process.

Karumi

June 23, 2016
Tweet

More Decks by Karumi

Other Decks in Technology

Transcript

  1. We embark on every project with a commitment to create

    something elegant, enduring and effective. That is our heartbeat. Our approach is uniquely simple and honest, we are a small dedicated software studio, delivering outstanding work. Karumi is the Rock Solid code software development studio.
  2. Reescribir una App es un proceso muy complicado y en

    cierta medida contraintuitivo con respecto a lo que nos enseñan las buenas prácticas del software Do not underestimate complexity
  3. If you are rewriting some SpaceX code, you might want

    to write the tests first, no matter how complex it is We are making mobile apps anyway
  4. protocol UserViewModel { var id: String { get } var

    userName: String { get } var email: String? { get } var memberSince: NSDate? { get } var isMe: Bool { get } }
  5. extension User : UserViewModel { var id: String { return

    String(self.userId) } var userName: String { return self.name ?? NSLocalizedString( "NoUsername.DefaultName", comment: "Default name for users with no name”) } var memberSince: NSDate? { return DateParser.fromString(self.memberSinceDate) } var isMe: Bool { get { return String(User.ObtenerInstancia().userId) == id } } }
  6. Re implementa la feature elegida por completo en la nueva

    arquitectura No te preocupes por el código duplicado en este punto, es totalmente normal Reimplement the chosen feature in the new architecture
  7. Make it super easy for the code reader to identify

    scaffolding code UserScaffolding
  8. A place in our code base where we can alter

    behaviour without being forced to edit it in that place
  9. For example, if you don’t want to change the getInstance

    calls, add a setInstance method to alter that behavior from the outside
  10. +

  11. +