weilsonwonder / WWCalendarTimeSelector

A android inspired iOS date/time picker
MIT License
317 stars 126 forks source link

Obj-C Cannot create an instance of calendar #25

Closed yigit26 closed 7 years ago

yigit26 commented 7 years ago

Hi I'm Yiğit. I'm trying to open a WWCalenderTimeSelector in obj-c project. Like this :

`+ (void) createCalendar:(ExtViewController<WWCalendarTimeSelectorProtocol>*) delegate{
    static WWCalendarTimeSelector *obj = nil;
    if(obj == nil){
        obj = [WWCalendarTimeSelector instantiate];
    }
    obj.delegate = delegate;
    obj.optionLayoutWidthRatio = 0.5;
    [obj.optionStyles showTime:NO];
    obj.optionButtonTitleDone = @"OK";
    obj.optionStyleBlurEffect = UIBlurEffectStyleExtraLight;

    [[SlideNavigationController sharedInstance] presentViewController:obj animated:NO completion:nil];
}`

But when i call this method,your'open static func instantiate() -> WWCalendarTimeSelector' method throws an exception in this('return UIStoryboard(name: "WWCalendarTimeSelector", bundle: bundle).instantiateInitialViewController() as! WWCalendarTimeSelector' ) line.

Error output :

2016-10-05 18:33:34.546 prj[657:533235] Unknown class _TtC38WWCalendarTimeSelectorStoryboardBundle22WWCalendarTimeSelector in Interface Builder file. Could not cast value of type 'UIViewController' (0x3bb4f40c) to 'WWCalendarTimeSelector.WWCalendarTimeSelector' (0xa4c93c).

Any solution ? :/ Best regards..

yigit26 commented 7 years ago

I just move WWCalendarTimeSelector.storyboard from Resources group to main folder . It fixed my problem.