/Custom-Calendar

Custom calender view for SwiftUI with no usage of third party libraries.

Primary LanguageSwiftMIT LicenseMIT

LinkedIn[https://www.linkedin.com/in/ucargiray/]

About The Project

This is a custom calendar view written in SwiftUI. No third party libraries used in order to create this. You can download and change the variable's values in order to achieve the view you want.

Getting Started

  • App gets the users current date and shows the month that user is on. If user opens calendar view at March, view starts with March month and lists all the days of March.
  • When user clicks on the either left nor right arrow, month and days changes.
  • (Optional)There is a limitation for user to change months on calendar. Default value is 2 right now but change this limitation with changing the variable called "monthDifferenceLimit".
  • User's current day is shown on the calendar as a gray circle behind it.
  • When user clicks on numbers on the calendar, view updates itself and puts a purple circle behind it to notify the user.

Description

  1. Inside "Date+Weekday.swift" file, some functionallity added for Date and String struct.
  2. "CustomCalendarViewModel.swift" file has the functions for calculating the day's name.
  3. "CustomCalendarDayView.swift" file is the header view which has the day names right above CalendarView.
  4. "CustomCalenderView.swift" is the file of whole Calender View.

Screenshots

User chooses different day User's current day is shown User reaches bottom limit User reaches upper limit

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Ahmet Giray Uçar - giray.dev

Project Link: https://github.com/ucargiray/Custom-Calendar