MGCalendar

iOS Calendar that was made to be customized.


License
MIT
Install
pod try MGCalendar

Documentation

Update

This is no longer supported. Check out another [better] implementation: MNCalendarView

MGCalendar (MIT)

MGCalendar was made to be an easily customized calendar for iOS (See screenshots).

Feel free to improve or add features (making them easily customizable as well). Let me know your changes by creating a pull request!

ScreenShot 1

Setup

  • Drag and drop the MGCalendar/MGCalendar Folder into your project. (No need to add the demo…)

MGCalendar Properties & Methods

The baseDate is the date in which the entire calendar is based on. This is left as being settable but I recommend you avoid messing with the baseDate unless you are sure the date is valid. baseDate is set the [NSDate date]; by default.

@property (nonatomic) NSDate *baseDate; 

The delegate property is your typical delegate…

//the delegate property
@property (nonatomic) id<MGCalendarViewDelegate> delegate; 

//The protocol
@protocol MGCalendarViewDelegate <NSObject>
@optional
- (NSArray*) calendarMarkedDates;
- (void) calendarSelectedDate:(NSDate*)date;
- (void) calendarBaseDateUpdated:(NSDate*)date;
@end

The isSwipeGestureEnabled property dictates whether or not the swipe gesture (which changes months according to direction swiped) is enabled. BY DEFAULT isSwipeGestureEnabled is YES

@property (nonatomic) BOOL isSwipeGestureEnabled;

The Customization Properties

DayViews = The Actual Dates on the calendar, surrounded by a box (UIView).

Generic DayView properties.

These do not effect all DayViews, only those that are not a selected view, current date view, or a different month view (will explain what this is in a bit..).

@property (nonatomic) UIColor *dayViewBorderColor;
@property (nonatomic) CGFloat dayViewBorderWidth;
@property (nonatomic) UIColor *dayViewBackgroundColor;
@property (nonatomic) UIFont *dayViewDateFont;
@property (nonatomic) UIFont *dayViewDayFont;
@property (nonatomic) UIColor *dayViewTextColor;
@property (nonatomic) UIColor *dayViewDotColor;

Selected DayView properties

Set these to edit the selected DayView. (the view that is selected by touch…)

@property (nonatomic) UIColor *selectedDayViewBackgroundColor;
@property (nonatomic) UIColor *selectedDayViewTextColor;
@property (nonatomic) UIColor *selectedDayViewBorderColor;

Current DayView properties

Set these to edit the current DayView. (the view that is shows what the current date is)

@property (nonatomic) UIColor *currentDayViewBackgroundColor;
@property (nonatomic) UIColor *currentDayViewBorderColor;
@property (nonatomic) UIColor *currentDayViewTextColor;

Current DayView properties

Set these to edit the DayViews that are not in the month (of the baseDate) but still visible in the calendar.

@property (nonatomic) UIColor *differentMonthDayViewBackgroundColor;
@property (nonatomic) UIColor *differentMonthDayViewBorderColor;
@property (nonatomic) UIColor *differentMonthDayViewTextColor;

Demo

Checkout the demo for an example of how to use MGCalendar!