val cal = Calendar.getInstance()cal.set(Calendar.YEAR, calObject.get(Calendar.YEAR))//cal.set(Calendar.DAY_OF_YEAR, 1)cal.set(Calendar.MONTH,5)cal.set(Calendar.DAY_OF_MONTH, 12)cal.set(Calendar.HOUR_OF_DAY, 0) // ! clear would not reset the hour of day !val bb = cal.time.toString()cal.clear(Calendar.MINUTE)cal.clear(Calendar.SECOND)cal.clear(Calendar.MILLISECOND)val cc = cal.timeInMillis.toString()calObject.set(Calendar.HOUR_OF_DAY, 0)calObject.clear(Calendar.MINUTE)calObject.clear(Calendar.SECOND)calObject.clear(Calendar.MILLISECOND)val dd = calObject.timeInMillis.toString()val touchTime = if (calObject.get(Calendar.HOUR_OF_DAY) >= 8) calObject.timeInMillis else calObject.timeInMillis + calObject.timeZone.rawOffset val nowDateMills = touchTime / (3600000 * 24) * (3600000 * 24) - calObject.timeZone.rawOffset val ee = nowDateMills.toString()//val sqlMonthBase = cal
preselect collectionview https://stackoverflow.com/questions/45610785/how-to-preselect-and-highlight-a-cell-from-a-uicollectionview https://hackernoon.com/uicollectionviewcell-selection-made-easy-41dae148379d if collectionview allow multiple selection remeber add this, cell item could be Deselect collectionView. selectItem (at: indexPath, animated: true , scrollPosition: . top ) https://stackoverflow.com/questions/15330844/uicollectionview-select-and-deselect-issue save indexpath userdefault https://stackoverflow.com/questions/34804294/how-to-save-nsindexpath-locally https://stackoverflow.com/questions/37001643/how-to-add-nsindexpath-to-nsuserdefaults-in-swift navigation presneted viewcontroller dismiss https://stackoverflow.com/questions/31205002/why-is-it-bad-practice-to-have-a-viewcontroller-dismiss-itself indexpath comparison if selectIndexPath . contains (indexPath) { cell. isSelect...
留言
張貼留言