기본 콘텐츠로 건너뛰기

8월, 2019의 게시물 표시

iOS, DarkMode off, ActionSheetStringPicker

ActionSheetStringPicker dark mode off ** set overrideUserInterfaceStyle after showActionSheetPicker *** code ActionSheetStringPicker *picker = ...     [picker showActionSheetPicker]; if (@available(iOS 13.0, *)) {         picker.pickerView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;     } else { //         Fallback on earlier versions     }

Swift, Date, Calendar

let year = 2019 let month = 7 let nowDate:Date = Date() let calendar = Calendar.current let date = calendar.date(from: DateComponents(year: year, month: month, day: 1,                                                    hour: 12, minute: 0, second: 0)) let weekOfFirstDay = Calendar.current.component(.weekday, from: date!) // sunday = 1, saturday = 7 let toLastDay = DateComponents(month: 1, day: -1) let endOfMonth = calendar.date(byAdding: toLastDay, to: date!) let lastday = calendar.component(.day, from: endOfMonth!) let format = DateFormatter() format.dateFormat = "yyyy-MM-dd HH:mm:ss" let formattedDate = format.string(from: date!) let nowDateFormatted = format.string(from: nowDate) NSLog(formattedDate) NSLog(nowDateFormatted...