swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

[SR-13576] UIDatePicker crashes app when enabling/disabling 24-hour time multiple times #56014

Closed swift-ci closed 9 months ago

swift-ci commented 4 years ago
Previous ID SR-13576
Radar rdar://problem/69308996
Original Reporter tassiomm (JIRA User)
Type Bug
Environment **XCode Version:** 11.3.1 **Device:** iPhone 6s Plus **Device iOS Version:** 13.6 Xcode Project: **Swift 5** **Target:** iOS 13.2
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Standard Library | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: a3245dac2c3ee77de8e819d6cd8bd781

Issue Description:

UIDatePicker will crash if user switches 24-hour time multiple times and opening the app between switches.

Reproducible test case:

Create a new Single View App Project in Swift. Go to ViewController that XCode already created and paste the code:

 import UIKit
 class ViewController: UIViewController {
     private var someDatePicker = UIDatePicker()
 }

Steps:

typesanitizer commented 4 years ago

@swift-ci create

swift-ci commented 4 years ago

Comment by Tassio Moreira Marques (JIRA)

Note: For reference, setting the calendar prevents the bug from happening:

someDatePicker.calendar = Calendar(identifier: .gregorian)
AnthonyLatsis commented 1 year ago

This sounds very much like an issue with UIKit (not the compiler or Standard Library). @tassiomm Assuming you are the author, please use the feedback assistant for these sorts of SDK bugs.