weilsonwonder / WWCalendarTimeSelector

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

Could not cast value of type 'UIViewController' to 'WWCalendarTimeSelector.WWCalendarTimeSelector' #20

Open lifehappensoutdoors opened 8 years ago

lifehappensoutdoors commented 8 years ago

Hello, the issue described above seems to be unresolved (as per #15 ). Any special branch we need to pull from?

If we remove the custom class from the storyboard file it crashes with the unknown class error. If we add the classes, it works fine but the protocol methods won't work, date selection for example. Any input from your side is highly appreciated...

Nice component by the way. Thank you for sharing.

yigit26 commented 8 years ago

Try this #25 move WWcalendarTimeSelector.storyboard file from Resources group to main folder

it fixed my problem.

antonioreyna commented 8 years ago

whatis the fix for this? i moved the file but no luck :(

antonioreyna commented 8 years ago

this is my error:

Unknown class _TtC38WWCalendarTimeSelectorStoryboardBundle22WWCalendarTimeSelector in Interface Builder file.
Could not cast value of type 'UIViewController' (0x1af5bdf60) to 'WWCalendarTimeSelector.WWCalendarTimeSelector' (0x1016a1908).
Could not cast value of type 'UIViewController' (0x1af5bdf60) to 'WWCalendarTimeSelector.WWCalendarTimeSelector' (0x1016a1908).
cesarmtz93 commented 8 years ago

i have the same issue! any help?

antonioreyna commented 8 years ago

if I remember correctly you need yo set the module name in the storyboard on that viewcontroller

cesarmtz93 commented 8 years ago

@antonioreyna thanks for the help, but now I'm getting EXC_BAD_ACCESS in this line clockView.delegate = self in the method viewdidload class WWCalendarTimeSelector, any ideas on why this happened?

Abel7x commented 8 years ago

@cesarmtz93 I found a solution... as @antonioreyna said... you also have to specify the "module" on the "Clock View" screen shot 2016-10-22 at 12 03 35 pm

bintu1234 commented 8 years ago

@Abel7x Hi what i need to specify in module i am giving WWCalendarTimeSelector but it is showing same error.

sunil1790 commented 8 years ago

Hey All, first of all thanks to this awesome calendar, I was also facing this issue UIViewController' to 'WWCalendarTimeSelector.WWCalendarTimeSelector to remove this I simply drag and drop all files to my main project rather than getting it from Cocoapods

--No import coz you are using it directly
class YourViewController: UIViewController{
    fileprivate var singleDate: Date = Date()
    fileprivate var multipleDates: [Date] = []

    override func viewDidAppear(_ animated: Bool) {
           showCalendar()
   }

func showCalendar() {
        let selector = WWCalendarTimeSelector.instantiate()
        selector.delegate = self
        /*
          Any other options are to be set before presenting selector!
        */
        presentViewController(selector, animated: true, completion: nil)
    }
}

extension YourViewController: WWCalendarTimeSelectorProtocol{
    func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, date: Date) {
        print("Selected Date- \(date)")
        singleDate = date
        //dateLabel.text = date.stringFromFormat("d' 'MMMM' 'yyyy', 'h':'mma")
    }

    func WWCalendarTimeSelectorDone(_ selector: WWCalendarTimeSelector, dates: [Date]) {
        print("Selected Multiple Dates \n\(dates)\n---")
        if let date = dates.first {
            singleDate = date

            //dateLabel.text = date.stringFromFormat("d' 'MMMM' 'yyyy', 'h':'mma")
        }
        else {
            //dateLabel.text = "No Date Selected"
        }
        multipleDates = dates
    }
}

And you will get it ...

asadali737 commented 7 years ago

I am also facing the exact problem. None of the above mentioned solution worked for me. :(

I only want to install it through Pods.

sunil1790 commented 7 years ago

Did You tried to drag and drop Coz it works for me and I am using it in my project, Swift 3.0 screen shot 2016-11-26 at 3 45 27 pm

sgermain06 commented 7 years ago

I had to go into the storyboard and set the module to WWCalendarTimeSelector on 2 things:

After that, I was able to load the clock view just fine, and I installed it from cocoapods.

sachithamh commented 7 years ago

this problem comes when you use pod to install to WWCalendarTimeSelector you can fix this following simple 3 steps:

step 1: open your project project navigator>Pods>WWCalendarTimeSelector>Resources>WWCalendarTimeSelector.storyboard

step 2: in WWCalendarTimeSelector.storyboard open calendar Time Selector Scence select calendar Time Selector view controller and goto show the identity inspector and set Module as WWCalendarTimeSelector

step 3 : open calendar Time Selector view controller expand the view expand the Bottom Container view again expand Background Content View select Clock View and in the show the identity inspector and set Module as WWCalendarTimeSelector

1

screen shot 2017-03-16 at 3 03 18 pm

2

screen shot 2017-03-16 at 3 03 45 pm

3

screen shot 2017-03-16 at 3 03 57 pm

4

screen shot 2017-03-16 at 3 05 14 pm

5

screen shot 2017-03-16 at 3 05 02 pm

6

screen shot 2017-03-16 at 3 05 46 pm

7

screen shot 2017-03-16 at 3 05 50 pm

🥇 💯

akhilclement commented 7 years ago
screen shot 2017-04-08 at 4 13 50 pm screen shot 2017-04-08 at 4 13 58 pm
akhilclement commented 7 years ago

check the Inherit From Target solved my issue.. in Swift 3.1

RizkiMufrizal commented 7 years ago

To resolve this problem, i use

pod 'WWCalendarTimeSelector', :git => 'git@github.com:weilsonwonder/WWCalendarTimeSelector.git', :branch => 'master'

in my Podfile

rahul-inspired-iosdeveloper commented 6 years ago

Can I add this lib to my swift 4 project via pod ???

rahul-inspired-iosdeveloper commented 6 years ago

I have added this lib to my Swift 4 project but it showing too many issues in "WWCalendarTimeSelectorStyle" class. Can anybody help me????

Ksen17 commented 6 years ago

I have added this lib to my Swift 4 project but it showing too many issues in "WWCalendarTimeSelectorStyle" class. Can anybody help me????

fixed it myself

But the main issue is still here