如何在没有Stroybord / Xib的情况下使用JTCalendar

时间:2016-01-15 13:38:12

标签: ios objective-c uiview nscalendar

如果没有使用JTCalendar的Storyboard / Xib,我没有得到如何使用。 通常任何视图都可以为Ex添加超级视图:[self.view addSubview:SampleView1] 如何添加自定义视图。

#import <UIKit/UIKit.h>
#import "JTCalendar/JTCalendar.h"
@interface GitCalendarViewController : UIViewController <JTCalendarDelegate>

@property (weak, nonatomic) IBOutlet JTCalendarMenuView *calendarMenuView;
@property (weak, nonatomic) IBOutlet JTHorizontalCalendarView *calendarContentView;

@property (strong, nonatomic) JTCalendarManager *calendarManager;




@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    _calendarManager = [JTCalendarManager new];
    _calendarManager.delegate = self;

    [_calendarManager setMenuView:_calendarMenuView];
    [_calendarManager setContentView:_calendarContentView];
    [_calendarManager setDate:[NSDate date]];
}

如何添加我的子视图。请帮帮我

1 个答案:

答案 0 :(得分:0)

[self.view addSubview:_calendarManager];

不起作用? calendarManager是哪个类的子类?