Skip to content

iOS-Swift-Controls/FXDatePicker-SwiftUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fxPickerImage

FXDatePicker

A SwiftUI library for a customizable DatePicker.

Features

  • Supports both Hijri and Gregorian calendars.
  • Allows adding images below days using Image or SF Symbols.
  • Supports Arabic and English languages.
  • Compatible with Dark and Light Modes.
  • Offers full customization.

FXDatePicker vs. iOS DatePicker

  • Customization: FXDatePicker allows for extensive customization, including the ability to add icons below dates. In contrast, the iOS DatePicker offers basic functionality with limited customization options.
  • User Interface: FXDatePicker features a modern, adaptable interface for a tailored user experience, while the iOS DatePicker maintains a standard, unchangeable appearance.
  • Flexibility: FXDatePicker is ideal for creating distinctive, engaging date-picking experiences. The iOS DatePicker is more suited for applications that require basic date selection.

Usage

  1. Add a binding Date variable to save the selection.
  2. Create a specialDates array to add images below dates.
  3. Initialize FXDatePicker and present it as desired.
FXDatePickerView(selectedDate: $selectedDate, specialDates: specialDates)

Customize | Available modifiers:

calenderType

Change the DatePicker type using calendarType. For example, to use the Hijri calendar:

FXDatePickerView(selectedDate: $selectedDate, specialDates: specialDates)
.calenderType(.hijri)

The default is .gregorian.

datePickerTheme

Customize the theme of the DatePicker using datePickerTheme. For example:

FXDatePickerView(selectedDate: $selectedDate, specialDates: specialDates)
.datePickerTheme(main:
 .init(
accentColor: Color(uiColor: UIColor(red: 0.23, green: 0.80, blue: 0.81, alpha: 1.00)),
monthTitle: .white,
daysName: Color(uiColor: UIColor(red: 0.45, green: 0.48, blue: 0.48, alpha: 1.00)),
daysNumbers: Color(uiColor: UIColor(red: 0.83, green: 0.84, blue: 0.84, alpha: 1.00)),
previousDaysNumber: Color(uiColor: UIColor(red: 0.44, green: 0.47, blue: 0.47, alpha: 1.00)),
backgroundColor: Color(uiColor: UIColor(red: 0.22, green: 0.25, blue: 0.25, alpha: 1.00)))
 )

The default theme has a white background with a blue accent color.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%