Giter Club home page Giter Club logo

swiftuistopwatch's Introduction

SwiftUIStopwatch

A SwiftUI implementation of the stopwatch feature in Apple's Clock app on iOS.

A stopwatch is a simple, single screen app. Yet, is a classic example of how an app's UI can easily fall out of sync with it's model.

SwiftUI promises 'correct' user interfaces through it's declarative syntax. It also encourages explicit expression of 'state' via property bindings.

This makes the stopwatch example a perfect candidate for a SwiftUI experiment. The aim here is to develop the app in order to compare how the resutling code stacks up against imperative code typically written when working with UIKit.

If successful, SwiftUI should prove (when comparing to imperative code):

  • It involves writting significantly less code overall
  • Incorrect states are lessly likely to happen
  • Readability is improved

An additional observation we can make with this experiment is the performance of SwiftUI's rendering engine. The stopwatch's timer will be updating the UI every millisecond. The promise of SwiftUI is that it will efficiently take care of rendering on the programmer's behalf; diffing the view and only updating what it needs to. We may be able to observe this also.

swiftuistopwatch's People

Contributors

neilsmithdesign avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.