Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 743 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 743 Bytes

SATrafficLight -

  • Language Used - swift 3.0
  • TrafficLight with Red,Yellow,Green Light Similar to trafficLights on Roads.

Contain Module - TrafficLight

  • i)Model Class -> SATrafficLight with configurable trafficLightTime enum of type TimeInterval(in seconds) :
enum trafficLightTime : TimeInterval {
    case red  = 3
    case yellow = 2
    case green = 1
}
    1. View -> SATrafficLightView Updates Traffic Light view for trafficLight State
  • Usage:

    • a)Invoke startTrafficLight() function of SATrafficLight" Model class.
    • b)Conform to SATrafficLightProtocol to update trafficLightState.
  • example Usage is written into ViewController

alt text