Coder Social home page Coder Social logo

traffic-light-swiftui-demo's Introduction

Traffic Light System

An example of a custom traffic light component with animations and logic inspired by a real traffic light. Developed entirely natively using Swift and SwiftUI.

Demo

The idea was to create a traffic light system.

✅ The app consists of 2 screens:

First Screen:

  • ✅ There is a single text view prompting the user to enter their car model.
  • ✅ A "Start Driving" button transitions to the second screen.
  • ✅ Validation ensures that the car model has a minimum length of 3 characters.
  • ✅ The car model name is then passed to the second screen.

Second Screen:

  • ✅ The car model is displayed at the top.
  • ✅ There are three circles aligned vertically: Red, Yellow, and Green.
  • ✅ The color intensity of the circles changes based on the active traffic light.
  • ✅ They mimic a real traffic light sequence: RED – 4 seconds bright GREEN – 4 seconds bright ORANGE – 1 second bright
  • ✅ The lights quickly fade when turning on or off.
  • ✅ This follows the classic traffic light sequence: Green → Yellow → Red, Red → Yellow → Green.

Installation

The project does not require additional installation, as no dependency manager is currently used.

Build

No additional setup is needed. Build project using Xcode.

Technologies

  • Swift
  • SwiftUI

Versions

  • Xcode 15.0 (latest)
  • Swift 5.9.0 (latest)

Branches

GitFlow is strictly enforced on this repository. GitFlow

Branch overview

  • master
  • develop
  • feature/name
  • hotfix/name

Git Flow:

feature -> develop -> master

License

Copyright © 2023 SKS. All rights reserved.

traffic-light-swiftui-demo's People

Contributors

stolyarenkoks avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.