Giter Club home page Giter Club logo

Comments (4)

itsmeichigo avatar itsmeichigo commented on June 28, 2024 1

Please look again at the demo project, there's sample code there. If you want to be notified when picker is dismissed, use this:

       picker.dismissHandler = {
            picker.removeFromSuperview()
        }

For donePicking, do this:

       picker.completionHandler = { date in
            let formatter = DateFormatter()
            formatter.dateFormat = "hh:mm aa dd/MM/YYYY"
            self.title = formatter.string(from: date)
        }

If you just want to be notified for selected dates, make sure to set delegate of the picker:
picker.delegate = self

And implement the delegate function:

    func dateTimePicker(_ picker: DateTimePicker, didSelectDate: Date) {
        title = picker.selectedDateString
    }

from datetimepicker.

itsmeichigo avatar itsmeichigo commented on June 28, 2024

Hi, in order to get callback for Done and Cancel button, please make sure that you implement dismissHandler and completionHandler.

from datetimepicker.

GeorgeXCV avatar GeorgeXCV commented on June 28, 2024

Still don't quite understand. I don't get why dismissView() and donePicking() just aren't called. The buttons have touch gestures to trigger these functions? After adding picker, I only expected to have to code logic for "send date selected here". I have no way to reference the cancel and done buttons, calling dismissHandler does nothing.

from datetimepicker.

GeorgeXCV avatar GeorgeXCV commented on June 28, 2024

Got it working now. I completely missed the demo project, hence the confusion. Thank you!

from datetimepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.