Giter VIP home page Giter VIP logo

weekdaypicker's Introduction

WeekdayPicker

CocoaPods Compatible Carthage Compatible Platform

WeekdayPicker is a custom UIDatePicker with weekdays.

Demo example

Requirements

  • iOS 9.0+
  • Xcode 9+
  • Swift 4.0+

Communication

  • If you'd like to ask a general question, use Stack Overflow.
  • 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

You can choose one of theses options to install WeekdayPicker.

๐Ÿ“ฆ CocoaPods โ€” CocoaPods is a library dependencies for Xcode projects. [CocoaPods Installation](https://guides.cocoapods.org/using/getting-started.html#getting-started)

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

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

target '<Your Target Name>' do
    pod 'WeekdayPicker', '~> 0.1'
end

Then, run the following command:

$ pod install
๐Ÿ’‰ Carthage โ€” Carthage is a decentralized dependency manager for Cocoa. [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate WeekdayPicker into your Xcode project using Carthage, specify it in your Cartfile:

github "WeekdayPicker/WeekdayPicker" ~> 4.7

Run carthage update to build the framework and drag the built WeekdayPicker.framework into your Xcode project.

๐Ÿ“š Swift Package Manager โ€” Package manager for the Swift.

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but WeekdayPicker does support its use on supported platforms.

Once you have your Swift package set up, adding WeekdayPicker as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Maximelc/WeekdayPicker.git", from: "1.0.0")
]

Manually

If you prefer to not use any of the dependency managers, you can integrate WeekdayPicker into your project manually.

Usage

After adding the framework to your project, import the module.

import WeekdayPicker

Add WeekdayPicker programmatically ๐Ÿค“

// Initialization
let myPicker: WeekdayPicker = WeekdayPicker()

// Add delegation conformance
myPicker.delegated = self

// Apply frame
myPicker.frame = CGRect(origin: CGPoint(x: 0, y: 150),
                        size: CGSize(width: self.view.frame.size.width,
                                     height: 150))        

// The first date to show will be the current date
myPicker.setToDate(Date())

// Add picker to current view
self.view.addSubview(myPicker)

Implement WeekdayPickerDelegate ๐Ÿค

// MARK: - WeekdayPickerDelegate
extension <#MyViewController#>: WeekdayPickerDelegate {

    func weekdayPickerDateChanged(_ date: Date?) {
        if let changedDate = date {
            print("\(changedDate)")
        }
    }
}

Documentation

The full documentation is available here.

License

WeekdayPicker is released under the MIT license. See LICENSE for details.

weekdaypicker's People

Contributors

maximelc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.