
push 와 pop 시 ViewLifeCycle 문제 viewDidLoad 에서 realm 에서 데이터를 가져와서 뷰에 뿌려주는 형식인데 이 경우 push 하고 pop 해서 뷰로 돌아올 경우 업데이트가 되지 않았다. 원인 push 할 경우에 view 가 사라지지만 메모리에는 남아있다는 것을 놓쳤다. 즉, viewDidLoad 는 한번만 호출되는데 notificationToken 을 viewDidLoad 에서 설정해주었던 것이 문제였다. viewWillDisappear 에서 notificationToken 을 invalidate() 하기 때문에 뷰가 사라질 때 저장한 notificationToken 이 해제가 되었다. 그 후에 push 된 뷰에서 db 를 수정하고 pop 해서 메인 뷰를 viewWillAp..

UITextField 에 입력시 키보드 위 toolbar 구현 미리 알림에서 UITextField 에 입력을 할 때 키보드 위 toolbar 를 구현하려고 한다. 계획 UIToolbar 객체를 만들어서 textField 가 first responder 될 때 즉 focus 될 때 receiver 에 accessory view 를 보이게 할 것이다. inputAccessoryView 이 속성은 일반적으로 UITextField, UITextView 의 시스템제공 키보드에 악세사리 뷰를 연결하는데 사용. first responder 될 때 즉, focus 될 때 악세사리 뷰를 보여줄 수 있다. //set UIToolbar private func setToolbar() -> UIToolbar { let tool..

UITalbeView editingStyle allowsMultipleSelectionDuringEditing allowsMultipleSelectionDuringEditing editing mode 에서 체크마크 속서이 없어서 구현에 어려움을 느꼈다. 하지만 allowsMultipleSelectionDuringEditing 속성을 통해서 해결했다. 이렇게 선택된 row 들의 정보는 아래의 속성을 통해서 리턴 가능하다. tableView.indexPathForSelectedRow 현재 선택되어있는 cell의 index를 return tableView.indexPathsForSelectedRows tableView가 선택된 cell들의 index를 배열로 return합니다.(multiple selectio..

UITalbeViewCell SwipeAction UITableViewDatasource - trailingSwipeActionConfigurationForRowAt func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { //info let info = UIContextualAction(style: .normal, title: "세부사항") { action, view, completion in //세부사항을 클릭하면 모달창을 띄우게 함. guard let nextVC = self.storyboard?.instant..

UITextView placeholder 효과 구현하기 UITextFieldDelegate TextField 는 placehoder 기능을 지원하지만 여러줄을 입력받는 TextView 는 그렇지 않다. 그래서 TextViewDelegate 를 통해서 커스텀해주어야 한다. private func setTextViewPlaceholder() { if textView.text == "" { textView.text = "메모" textView.textColor = UIColor.lightGray } else if textView.text == "메모"{ textView.text = "" textView.textColor = UIColor.black } } ... extension ScheduleListTopC..
section 에 따라서 커스텀 셀 설정 UITableViewDataSource section 별로 custom cell 을 리턴해주면 된다. IndexPath 의 section 에 따라서 custom 한 cell 을 리턴해주면된다. 마찬가지로 didSelectRowAt 메서드에서도 section 에 따라서 cell 을 present 할 수 있다. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if indexPath.section == 0 { guard let topCell = tableView.dequeueReusableCell(withIdentifier: ScheduleLis..
UITextField 가 비어있다면 UIButton 비활성화 시키기 @IBAction func textFieldValueChanged(_ sender: UITextField) { if textField.text?.isEmpty == true { saveBtn.isEnabled = true } else { saveBtn.isEnabled = false } } UITextFieldDelegate 를 활용해서 구현했다. @IBOutlet weak var textField: UITextField! override func viewDidLoad() { super.viewDidLoad() textField.delegate = self } extension AddListViewController: UITextFiel..
- RxCocoa
- SwiftUI
- Protocol
- WWDC22
- Objective-C
- containerBackground
- Notification
- async/await
- MVVM
- watchOS
- OpenSourceLibrary
- rxswift
- 2022 KAKAO TECH INTERNSHIP
- Algorithm
- WWDC
- IOS
- Firebase
- UserDefaults
- github
- Swift
- configurable widget
- APNS
- Widget
- MOYA
- CloneCoding
- 서버통신
- YPImagePicker
- urlsession
- projectsetting
- WidgetKit
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- Total
- Today
- Yesterday