squimer / datepickerdialog-ios-swift Goto Github PK
View Code? Open in Web Editor NEWDate picker dialog for iOS
License: MIT License
Date picker dialog for iOS
License: MIT License
My problem is simple. The user click on DatePickerDialog, the modal shows up. But now he realized that he don't want to set up date. Is there a way how to set up a blank date? Maybe a button with erased function, or empty date after click on cancel.
Thanks in advance for help.
Is it able to show only years in the picker? Just without days and months.
How to restrict the future date ?
I have tried many ways, but cannot get the dateFormatter to work. Can someone show me how to set this up?
I get this error when i do import "cannot load underlying module for datepickerdialog". thanks in advance
..../Pods/DatePickerDialog/Sources/DatePickerDialog.swift:107:77: 'M_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.
If we select 4 March 2017... the displayed date will be 3 March 2017
I am getting this error - Module compiled with Swift 3.1 cannot be imported in Swift 4.0
I used pod with master branch
initializer does not override a designated initializer from its superclass
I have a simple view that has 2 text fields. The first text field takes normal input via the keyboard, the second textfield is my date field. When I when I tap on the date field when the keyboard is already showing the date picker dialogbox shows but the keyboard is not dismissed. I've tried to dismiss the keyboard via "view.endEditing(true)" and also firstTextField.resignFirstResponder() but nothing works. On some devices the keyboard covers the date picker dialogbox which leaves the user in a state where they have to force quit the app.
In SplitView Mode on iOS9
UIScreen.mainScreen().bounds delivers the size of the screen. But we want the size of the app.
You can use UIScreen.mainScreen().applicationFrame instead of UIScreen.mainScreen().bounds
btw: i think you forgot to add a listener to the cancel button ;-)
self.cancelButton.addTarget(self, action: "buttonTapped:", forControlEvents: UIControlEvents.TouchUpInside)
best regards
Alex
My first controller containes button with action on open DatePickerDialog. When i present another controller and than present back my first controller, it said fatal error on line 80. appdelegate.window == nil. What's wrong?
How can I put Constraints in selecting date? (e.g. set minimum date and maximum date)
Can anyone give an example of how to modify this so add a textfield, either above or below the picker?
When the textField is tapped once, it works fine, but after canceling or selecting a date, if I want to modify the date and tap on the textField, the picker does not come up again. I have to select a different textField in order for it to work again.
Let us say, user presses Home Button and i want to dismiss the date picker. How do i do it? I don't see any API?
After doing carthage update the framewrok file name is:
DatePickerDialogFramework.framework
Instead of:
DatePickerDialog.framework
In the README.mdown
documentation:
You are assuming it to be: DatePickerDialog.framework
as in: $(SRCROOT)/Carthage/Build/iOS/DatePickerDialog.framework
Is the meaning of the title,But I quit application, then the second time, to open is no problem.
initializer does not override a designated initializer from its superclass
This could simply be an iOS 10 bug but running an app on an iPhone 6S running iOS 10 device causes the DatePickerDialog to dismiss (since the close() function gets called) itself when the user raises their iPhone or sets the iPhone down. (Similar motions to the raise-to-wake gesture on iPhone 6S/+ devices)
The deviceOrientationDidChange method is subscribed to the UIDeviceOrientationDidChange event and calls close() when the event is triggered. iOS 10 is apparently providing the device a UIDeviceOrientationDidChange event on a 'raise' gesture.
A temporary fix--for apps that only support portrait mode-- is to comment the call to close()
There's any plan to support swift3??
Thanks to your nice work, I use it very well but I have to upgrade swift version....
Hello everybody!
I have a big problem and hope one of you can help me.
When I open my App the first time, with the entry point from the storyboard, everything works fine. But when I open it the second time, where I set the entry point trough the AppDelegate class the dialog don't appear on the screen. I've seen a issue where someone had a similar problem, but there was no solution for this.
Thanks in advance!
I want background black color, font color white
change many views, not working.
DatePickerDialog().show("选择预约日期", doneButtonTitle: "确定", cancelButtonTitle: "取消", datePickerMode: UIDatePickerMode.DateAndTime) {
(date) -> Void in
print("选中时间\(date)")
self.pickedDate = date
self.tableView.reloadData()
//self.textField.text = "\(date)"
}
this work in swift2.1
thanks for fixing the orientation crash. i tested your example project in the ios simulator (iPhone6, iPad Air 2). In landscape mode the dialog is not centered.
best regards
Alex
i can't add default time for using DatePickerDialog as time picker
thank you
Hi,
Great project! I have an issue building on Swift 2.3 fails with numerous errors on the DatePickerDialog.swift file. How can I build on Swift 2.3?
Dialog doesn't appear on my project.
Dialog view's frame seems to be correct:
(0.0, 0.0, 320.0, 568.0)
Also I tried to bring subview front by adding this line in the func show:
method:
UIApplication.sharedApplication().windows.first!.bringSubviewToFront(self)
I'm using a navigation view controller under a tab bar controller. When debugging nothing seems to be wrong. I think it's only a visibility problem.
Any idea?
Got this warning after XCode 8.3.1 Update
'M_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.
let rotation = CATransform3DMakeRotation((CGFloat)(-startRotation + M_PI * 270 / 180), 0, 0, 0)
When i press cancel the label showing the date resets its content.
When i open the dialog it disappear after a while, randomly, on my iPhone 5s iOS 9.0.2
How can I format de return value? For example "dd-mm-YYYY"
Thanks!
How to get time from dialog?
even though mode id Time dialog returning date
Hello Dear,
I am using storyboard. If i set entry point using storyboard then dialog working fine. When i set rootViewController programmatically in AppDelegate, DatePickerDialog not working anymore.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.makeKeyAndVisible()
storyboard = UIStoryboard(name: "Main", bundle: nil)
let homeViewController = self.storyboard?.instantiateViewControllerWithIdentifier("HomeView") as? HomeViewController
let userTypeController = self.storyboard?.instantiateViewControllerWithIdentifier("UserTypeView") as? UserTypeController
if self.window != nil {
let userDataExist = CommonUserFunction.isUserDataExist() as Bool
if userDataExist == true {
let navigationController:UINavigationController = storyboard!.instantiateInitialViewController() as! UINavigationController
navigationController.viewControllers = [homeViewController!]
self.window!.rootViewController = navigationController
}
else{
let navigationController:UINavigationController = storyboard!.instantiateInitialViewController() as! UINavigationController
navigationController.viewControllers = [userTypeController!]
self.window!.rootViewController = navigationController
}
}
please Help...Thanks in advance...
Hi, thanks for this tiny picker.
i wondered why my app was crashing without any messages in the log. after a while i recognized that it crashed after a orientation change. i think the NSNofiticationCenter Observer needs to be removed when the View dissapears.. As i my app is only for portrait mode i just removed the Observer.
best regards
Alex
Hello,
Can you please point out how to enable 24H format instead of using AM and PM for the time?
Thank you.
Hey all,
i'm working on a datePicker for booking system.
I need to disable some dates because there aren't available for booking (restaurant closed on 28/11/2016 for example)
is there any way to do it ?
Thank You !
i want set minuteInterval.
but i don't access datePicker
datePicer is private property.
As discussed in #33, we should have tests for this library
Date Picker is returning n-5 hours
Please allow the user to have custom features. Like I want the background to have a blur when the picker view is presented, the pickerview's background to be a black instead of the default gray, and the pickerview's text's to be white instead of the default black!
I would rather write some tests than correcting the example project.
If one has the use case to implement a date picker dialog, the readme contains enough information of how to use this project (which is pretty simple). So I recommend to just leave it out.
Hi and big thanks for great pop-up view. Just foк your information, rotation device is not working on iPads.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.