jivesoftware / PDTSimpleCalendar

A simple Calendar / Date Picker for iOS using UICollectionView
Apache License 2.0
1.93k stars 338 forks source link

PDTSimpleCalendar

Pod version Carthage compatible Build Status

PDTSimpleCalendar is a very simple calendar/date picker component for your iOS apps based on UICollectionView.

Default Scrolling Hebrew

Upgrade Note

You should read the Release Notes when you upgrade to a newer version.

Install

Cocoapods

in your Podfile just add:

pod 'PDTSimpleCalendar', '~> 0.9.1'

then run pod install

And finally in your project import #import <PDTSimpleCalendar/PDTSimpleCalendar.h>

Carthage

In your Cartfile simply add:

github "jivesoftware/PDTSimpleCalendar" ~> 0.9.1

run carthage update

Finally you need to add the built framework to your project. For more information about Carthage : github.com/Carthage/Carthage

Warning: Carthage uses dynamic framework and will only work if your app targets iOS 8.0 or later.

Old-School

If you don't like cocoapods or Carthage or Cocoapods-Rome, you can still import it using git submodule or simply copy/paste all the source files in PDTSimpleCalendar to your project.

Customize it

Calendar

Colors

You can change the display of the calendar using backgroundColor & overlayTextColor properties on PDTSimpleCalendarViewController.

Other colors can be set using UIAppearance on PDTSimpleCalendarViewCell, PDTSimpleCalendarViewHeader & PDTSimpleCalendarViewWeekdayHeader

[[PDTSimpleCalendarViewCell appearance] setCircleDefaultColor:[UIColor whiteColor]];
[[PDTSimpleCalendarViewCell appearance] setCircleSelectedColor:[UIColor orangeColor]];
[[PDTSimpleCalendarViewCell appearance] setCircleTodayColor:[UIColor blueColor]];
[[PDTSimpleCalendarViewCell appearance] setTextDefaultColor:[UIColor redColor]];
[[PDTSimpleCalendarViewCell appearance] setTextSelectedColor:[UIColor purpleColor]];
[[PDTSimpleCalendarViewCell appearance] setTextTodayColor:[UIColor magentaColor]];
[[PDTSimpleCalendarViewCell appearance] setTextDisabledColor:[UIColor yellowColor]];

[[PDTSimpleCalendarViewHeader appearance] setTextColor:[UIColor redColor]];
[[PDTSimpleCalendarViewHeader appearance] setSeparatorColor:[UIColor orangeColor]];

[[PDTSimpleCalendarViewWeekdayHeader appearance] setHeaderBackgroundColor:[UIColor lightGrayColor]];
[[PDTSimpleCalendarViewWeekdayHeader appearance] setTextColor:[UIColor orangeColor]];

See the Demo for the full API and even more customization.

Here is how it looks in the Producteev app:

Producteev

License

Copyright 2013-2015 Jive Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.