MBCalendar kit framework how to add in my project

2019-07-09 08:43发布

问题:

I used MBCalendar kit framework. and successfully added in my project, but problem is that months and dates cant show simulator. only one top bar show in this weeks and year show. I attached my output snap shot please find this and show bellow. I want to successfully calendar show in UI. how it possible please help.

#import "ViewController.h"
#import "CalendarKit/CalendarKit.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  CKCalendarView *calendar = [CKCalendarView new];

  [calendar setDelegate:self];
  [calendar setDataSource:self];

  [[self view] addSubview:calendar];

}

回答1:

Follow my step:

Step 1: remove you are implement all related to MBCalendar.

Step 2: include CKDemoViewController.h & CKDemoViewController.m file in your project.

Step 3: set your view design class to CKDemoViewController.

check some file: https://github.com/BhadreshKathiriya/MBCalendar

 - (IBAction)btnClick:(id)sender {
    [self presentViewController:[[CKDemoViewController alloc] init] animated:YES completion:nil];
    //Or
    [self.navigationController pushViewController:[[CKDemoViewController alloc] init] animated:YES];
 }