Flying away from the nest (Bye Bye UIKit)

Flying away from the nest (Bye Bye UIKit)

From the very beginning of your journey as iOS developer, UIKit is always there to help you. It helps you to walk your first steps, populate table views, handle notifications, create beautiful layouts and more. But as time goes by, you become more experienced and some day you realise that you have to leave the nest and become less dependent on UIKit. Let’s check how this turns out for you and see if we really need UIKit and iOS simulator to run and test our code.

Also known as "Short story about love"

C000c81ba3431780f90bcb18001cfb55?s=128

Eliasz Sawicki

April 12, 2017
Tweet

Transcript

  1. 7.
  2. 8.

    A short story about Love 1. Friendship 2. Love 3.

    Doubt 4. Betrayal 5. Starting over again @EliSawic
  3. 9.

    A short story about Love 1. Friendship 2. Love 3.

    Doubt 4. Betrayal 5. Starting over again 6. Rebuild the trust @EliSawic
  4. 40.

    class PersonView: UIView { private var person: Person private var

    dateFormatter = DateFormatter() init(person: Person) { self.person = person super.init(frame: .zero) setupView() } private func setupView() { dateFormatter.dateStyle = .short birthdayLabel.text = dateFormatter.string(from: person.birthday) titleLabel.text = person.firstName + person.lastName } func workButtonTapped() { // Some complicated logic } } @EliSawic
  5. 41.

    protocol PersonViewModel { var title: String {get} var birthday: String

    {get} func doSomeWork() } class PersonView: UIView { private var viewModel: PersonViewModel init(viewModel: PersonViewModel) { self.viewModel = viewModel super.init(frame: .zero) setupView() } private func setupView() { titleLabel.text = viewModel.title birthdayLabel.text = viewModel.birthday } func workButtonTapped() { viewModel.doSomeWork() } } @EliSawic
  6. 42.

    class DetailedPersonViewModel: PersonViewModel { var title: String var birthday: String

    var dateFormatter = DateFormatter() init(person: Person) { title = person.firstName + " " + person.lastName dateFormatter.dateStyle = .short birthday = dateFormatter.string(from: person.birthday) } func doSomeWork() { // Some complicated logic } } @EliSawic