GDCalendar
  • February 8, 2024

Calendar component with both RTL/LTR languages support with Swipe Gesture enabled navigation.
Easy to use with Storyboard and Attributes Inspector support.

Requirements


  • Xcode 10+
  • Swift 4+
  • iOS 8+

Installation


Cocoapods


 

source ‘https://github.com/CocoaPods/Specs.git’
platform :ios, ‘9.0’
use_frameworks!

target ‘<Your Target Name>’ do
pod ‘GDCalendar’
end

pod update
pod install

Usage


 

import GDCalendar

Set To Desire Locale Calendar

// Persian Calendar Locale: fa_IR
UserDefaults.standard.set(“fa_IR”, forKey: “current_locale”)

// List of available iOS locale names
// https://gist.github.com/jacobbubu/1836273

/*
If `current_locale` is not set, default phone calendar will be selected
*/

Code


 

let calendar = GDTextSlot(frame: view.bounds)
view.addSubview(calendar)

Set Properties

// Days view items color
calendar.headerItemColor = UIColor.white

// Main calendar items text color
calendar.itemsColor = UIColor.black

// Header view items font
calendar.headersFont = UIFont.boldSystemFont(ofSize: 13)

// Calendar items font
calendar.itemsFont = UIFont.systemFont(ofSize: 15)

// Full properties list can be found on sample project

Set Date Selection Closure

calendar.dateSelectHandler = { [weak self] selectedDate in
print(selectedDate)

// Get Date Components
let day = date.dayName
let month = date.monthName

let components = date.componentsOfDate
print(“\(components.year) / \(components.month) / \(components.day)”)
}

Storyboard


  1. Add UIView to storyboard, set custom class to GDCalendar
  2. Set attributes with Attribute Inspector

GitHub


View Github

#calendar #component #locale #persian-calendar #swift #swift4
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...