스위프트2 filter 및 tableView section 활용하기 var contentCount = authHistories.filter({$0.regDtString.split(separator: ",").first! > authSection[indexPath.section]}).count cell.authTimeLabel.text = authHistories[indexPath.row + contentCount].regDtString 만약 여러가지 목록 중에서 해당 일자를 기준으로 그 이후에 일어난 사건에 대해 섹션으로 분리를 해야한다면, filter를 사용해서 일자값만 추출한 다음에 기준으로 잡을 해당 일자보다 더 앞선 컨텐츠만 count로 잡을 수 있습니다. 그런 다음 셀의 위치를 알려줄 때에는 indexPath.row에 contentCount를 더해서 전달해주면 .. 2022. 12. 30. [사진]UIImagePickerController로 아이폰 기기 앨범의 이미지 선택하기 let imagePickerController = UIImagePickerController() func changeProfileImage() { let ac = UIAlertController(title: "PROFILE_CHANGE_TITLE".localized(), message: "PROFILE_CHANGE_INST".localized(), preferredStyle: .actionSheet) ac.addAction(UIAlertAction(title:"PROFILE_CHANGE_PHOTO".localized(), style: .default, handler: { action in print("camera clicked") })) ac.addAction(UIAlertAction(title:"PRO.. 2022. 12. 21. 이전 1 다음