Skip to content

An analog clock app with time, alarm and stopwatch feature

License

Notifications You must be signed in to change notification settings

tmusabe/ClockApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ClockApp

ClockApp contains analog view of watch. It is an iOS app which is developed by SwiftUl and also conform MVVM architecture

Features

  • Set Alarm
  • Use Stopwatch
  • View Current Time

- -

Tech

  • SwiftUI
  • Swift 5.0
  • MVVM architecture

Components

File Description
TickShape Generate tick in the circumference
ClockView Design the analog clock view
NeedleView Generate needle for minute, hour, second
NumberView Create circular number view
CheckBoxView Make selectable checkbox
ActionButtonStyle Circular button style
RoundRectangleButtonStyle RoundRectangle button style

Critical Logics

Selecting any point on clock changing time is done with creating hidden niddle

@ViewBuilder func getSelectableView(width: CGFloat, height: CGFloat) -> some View {
        ForEach(0..<360){ index in
            NeedleView(width: width, height: height, color: Color.backgroundColor.opacity(0.001), bottomLineHeight: 30)
                .rotationEffect(.degrees(Double(index)))
                .onTapGesture {
                    updateNeedlePosition(position: index)
                }
        }
    }

Motivation and Credit

License

MIT

About

An analog clock app with time, alarm and stopwatch feature

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages