Skip to content

Crash on date picker #579

@chinkal07

Description

@chinkal07

App is getting crashed on selecting Date..

function used in app:
let actionSheetDatePicker = ActionSheetDatePicker(title: "", datePickerMode: .date, selectedDate: date, target: self, action: #selector(self.dateWasSelected(selectedDate:element:)), origin: dateView)
actionSheetDatePicker?.addCustomButton(withTitle: "Today", value: Date())
// actionSheetDatePicker?.addCustomButton(withTitle: "Select Date", value: Date())

    actionSheetDatePicker?.toolbarButtonsColor = UIColor.white
    actionSheetDatePicker?.toolbarBackgroundColor = UIColor.appTheme
    actionSheetDatePicker?.maximumDate = Date()
    
    // Allow 7 days future date for all prep item type
    if router?.dataStore?.addItemType is PrepItemType {
        actionSheetDatePicker?.maximumDate = Date().adjust(.day, offset: 7)
    }
    
    if #available(iOS 13.4, *) {
        actionSheetDatePicker?.datePickerStyle = .wheels
    }
    
    actionSheetDatePicker?.show()

Crash found on file: AbstractActionSheetPicker
line 305: dispatch_async(dispatch_get_main_queue(), ^{

XCode error: Enqueued from com.apple.main-thread (Thread 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions