기본 콘텐츠로 건너뛰기

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) NSLog("yearMonth = \(year).\(month)") NSLog("firstWeekDay = \(weekOfFirstDay)") NSLog("end of month = \(lastday)")

objc, constraint, programmatically, ex

[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.subview1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];                 [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.lblTermsOfUse attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.subview2 attribute:NSLayoutAttributeTop multiplier:1 constant:20]];

Kotlin, Calendar, Date

private fun getFirstWeek (year:Int , month:Int):Int{ var strMonth = "0" if (month < 10 ) strMonth += month else strMonth = month.toString() var strDate = year.toString() + strMonth + "01" val format = SimpleDateFormat( "yyyyMMdd" ) val date = format.parse(strDate) val calendar = Calendar.getInstance() calendar. time = date return calendar.get(Calendar. DAY_OF_WEEK ) } private fun getWeekStr (week:Int):String{ when (week){ 1 -> return "日" 2 -> return "月" 3 -> return "火" 4 -> return "水" 5 -> return "木" 6 -> return "金" 7 -> return "土" } return "" }

iOS, DB Error: 26 "file is not a database"

error after "pod update" 암호화라이브러리에서 문제가 있는듯. 버전에 따라 암호화형식이 바뀌는 모양. SQLCipher ( 3.4 . 2 ) -> SQLCipher ( 4.0.1 )   Podfile ***   ## 수정전. 버전 지정이 없음. pod 'FMDB/SQLCipher'   # 버정지정을 해봄.  # FMDB/SQLCipher로는 SQLCipher의 버전이 아닌 FMDB의 버전으로 인식되었다. pod 'FMDB/SQLCipher', '3.4.2' # FMDB와 SQLCipher를 따로따로 # 버전지정은 성공했으나, 데이터베이스의 인식에 실패 (Error: 26 "file is not a database") pod 'FMDB', '~>2.5' pod 'SQLCipher', '3.4.2'   # FMDB의 버전지정을 FMDB/SQLCipher로 해봄. # 데이터 베이스의 인식에 성공. pod 'FMDB/SQLCipher', '~>2.5'  pod 'SQLCipher', '3.4.2'   ***********