A fully customizable iOS Horizontal PickerView library, written in pure swift

Overview

ADDatePicker: Horizontal Date Picker

ADDatePicker is Horizontal Date Picker Library written in Swift

Requirements

  • iOS 10.0+
  • Xcode 10.0+
  • Swift 4.2+

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1+ is required

To integrate ADDatePicker into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
pod 'ADDatePicker'
end

Then, run the following command:

$ pod install

Usage

  • First, set Custom Class of UIView to ADDatePicker...

..And That's it., you can run the project now. it's that simple. ;]

Demo

Customize with ease..!

Customization

"Listen up, Dave. Your code is poor and colour choices are even poorer. this doesn't look good"

"Calm Down Joe, I gotchu.."

 @IBOutlet weak var datePicker: ADDatePicker!

1. Reset Range of years.

 datePicker.yearRange(inBetween: 1990, end: 2022)

2. Set Intial Date to Picker.

 datePicker.intialDate = Date()

3. Yay, Colours.. or Colors. (depends.. where you came from)

  //set BackGround Color of DatePicker
  datePicker.bgColor = .blue

  //set Selection and Deselection Background Colors
      
  datePicker.deselectedBgColor = .clear
  datePicker.selectedBgColor = .white
      
  //set Selection and Deselection Text Colors
  datePicker.selectedTextColor = .black 
  datePicker.deselectTextColor = UIColor.init(white: 1.0, alpha: 0.7)

4. Customize Selector..

Currently, there are three selectionType available. you're most welcome to contribute if you want to extand this list.

 enum SelectionType {
     case square
     case roundedsquare
     case circle
 }    

You can change selector by writing this piece of code.

 datePicker.selectionType = .circle

5. Delegate Methods..

Now, You can confirm to Delegate method to access date on scroll

datePicker.delegate = self
func ADDatePicker(didChange date: Date)

Which allows you to get new date on every scroll.

Credits

ADDatePicker is developed under observation of the great minds of Space-O Technology

License

ADDatePicker is released under the MIT license. See License for details.

Comments
  • Update the date label while scrolling the date/month/year row

    Update the date label while scrolling the date/month/year row

    Hi,

    I want to update the date label text, while scrolling the date, month , row. Could you please update me regarding this? Kindly let me know if you need more clarifications.

    Thanks.

    enhancement 
    opened by hemaks777 3
  • Feature request: Choose which elements to display and add weekdays as a new element

    Feature request: Choose which elements to display and add weekdays as a new element

    I'd like to be able to display weekdays inside the scrolls and decide if I want to display for example year or maybe number of days

    Something like:

    MON | TUE | WED | THUR | FRI | SAT | SUN
       1     |    2   |    3    |     4        5   |    6   |    7
    JAN   | ....
    

    And a method like:

    func displayElements(_ elements: [ElementType]) {
        //Logic here
    }
    

    That would be called like:

    datePicker.displayElements([.weekday, .day, .month])
    

    The code above would display weekdays, days and months

    While this one below would display only months and years:

    datePicker.displayElements([.month, .year])
    
    opened by Frakcool 0
  • Feature Request: Limit scrolling of days by range of days before and after current date

    Feature Request: Limit scrolling of days by range of days before and after current date

    I'd like to be able to limit the number of days we can scroll.

    For example +/- 3 days from today (August 25th)

    func limitScrollingOfDays(daysBefore before: Int, daysAfter after: Int, from selectedDate) {
        //TODO: Logic here
    }
    

    And be used like:

    datePicker.limitScrollingOfDays(daysBefore: 3, daysAfter: 10, from: Date())
    

    It should limit the number of scrolling days from August 22nd to September 4th

    opened by Frakcool 0
  • Can we use icons (images) instead of text?

    Can we use icons (images) instead of text?

    I love the design of this horizontal picker. Can we replace the text with images? I am interested in the carousel itself. Not the data picker. Thanks!

    opened by yashjain27 0
  • Strange issue with miss-aligned labels.

    Strange issue with miss-aligned labels.

    It seems the labels are miss-aligned. I've used Arial 16points font. Maybe some calculation issues with a reminder? We did not check the code :)

    Screenshot 2020-02-28 at 4 11 48 PM

    Would be nice to find a fix for this bug ๐Ÿ‘

    opened by AgileFlex 1
Releases(1.0.0)
Owner
Abhishek Dave
repeat { write code; watch anime; read books; } while(isAlive)
Abhishek Dave
FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

null 10 Dec 11, 2022
LocationPicker - A ready for use and fully customizable location picker for your app

LocationPicker A ready for use and fully customizable location picker for your app. Features Installation Cocoapods Carthage Swift Package Manager Qui

Zhuoran 397 Nov 16, 2022
A simple, customizable view for efficiently collecting country information in iOS apps.

CountryPickerView CountryPickerView is a simple, customizable view for selecting countries in iOS apps. You can clone/download the repository and run

Kizito Nwose 459 Dec 27, 2022
๐Ÿ”ธ A customizable alternative to UIPickerView in Swift.

PickerView PickerView is an easy to use and customize alternative to UIPickerView written in Swift. It was developed to provide a highly customizable

Filipe Alvarenga 488 Dec 21, 2022
McPicker is a customizable, closure driven UIPickerView drop-in solution with animations that is rotation ready.

McPicker About McPicker is a UIPickerView drop-in solution with animations that is rotation ready. The more string arrays you pass, the more picker co

Kevin McGill 207 Dec 13, 2022
Elegant and Easy-to-Use iOS Swift Date Picker

D2PDatePicker Example To run the example project, clone the repo, and run pod install from the Example directory first. Example Code: Programmatical I

Pradheep Rajendirane 292 Nov 6, 2022
Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.

ActionSheetPicker-3.0 Important update Now I fixed most of the things and merge PR' (thanks to ). I did much work to support this library from iOS 5.

Petr Korolev 3.4k Dec 21, 2022
Date picker dialog for iOS

DatePickerDialog 4.0 - iOS - Swift DatePickerDialog is an iOS drop-in classe that displays an UIDatePicker within an UIAlertView. Requirements DatePic

Squimer 535 Dec 17, 2022
a picker view shown as a popup for iOS in Objective-C

CZPicker Demo Change Log 3 most recent changes are listed here. Full change logs v0.4.3 - 2016-08-12 Added - (void)czpickerViewWillDisplay:(CZPickerVi

Chen Zeyu 527 Oct 2, 2022
:date: UIDatePicker modally presented with iOS 7 custom transitions.

AIDatePickerController Installation Manually Download and drop /AIDatePickerControllerfolder in your project. Congratulations! Usage // Create a date

Ali Karagoz 90 Sep 23, 2022
An iOS picker view to serve all your "picking" needs

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

Blue Apron 883 Nov 28, 2022
A country picker view controller for iOS

Planet A country picker view controller for iOS. Installation CocoaPods You can use CocoaPods to install Planet by adding it to your Podfile: platform

kWallet 71 Jul 11, 2022
Multi-picker for iOS and Mac available in SwiftUI

Multi-picker for iOS and Mac available in Swift UI

1amageek 5 Jul 12, 2022
iOS/macOS media picker for importing images and videos in SwiftUI

iOS/macOS media picker for importing images and videos in SwiftUI.

Mobile Development Club 13 Dec 30, 2022
Countries - Simple iOS Project for search on Countries

Do like Countries ??โ€โ˜ ๏ธ Simple iOS Project for search on Countries The project c

Amir Ardalan 0 Feb 27, 2022
๐ŸŽฏ Swift country and phone code Picker

CountryPicker Picker code Swift 3 / 4 / 5. Example To run the example project, clone the repo, and run pod install from the Example directory first. U

null 207 Dec 22, 2022
A ฮผlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and emoji.

CountryKit CountryKit A ฮผlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and e

Alessandro 24 Nov 11, 2021
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

Tung Vo 290 Nov 13, 2022
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

Tung Vo 290 Nov 13, 2022