iOS15 [iOS] swift tab bar 사용시 presentingViewController 하나의 뷰 컨트롤러에서 다른 뷰컨트롤러를 modal로 띄웠을때 sheet로 띄우는 설정이었다면 그 전 뷰 컨트롤러가 presentingViewController가 되는데 tab bar controller를 이용하게 되면 presentingViewController가 UITabBarController가 된다. 그래서 현재 뷰를 dismiss할때 ViewController의 viewDidLoad를 해야하는데 못하는 상황 발생.. 해결 방법은 TabBarController의 children을 사용하면 된다..!! 스택오버플로우 찾아보면서 똑같은 질문이 있어서 답변을 봤는데 거기엔 definesPresentationContext를 true로 하고 modalPresentationStyle를 current cont.. 2021. 3. 8. [iOS] 아이패드에서 UIAlertController actionSheet사용시 오류 "Your application has presented a UIAlertController () of style UIAlertControllerStyleActionSheet from App.ViewController (). The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a b.. 2021. 3. 4. [iOS] Core Data 잊어버릴까봐 나만 알아볼수있게 정리좀 해둘게요. 나중에 정리할게요! - persistentContainer ( 이것들을 모두 포함하는 개념) - model ≒ 스키마 - context ≒ 트랜젝션 { managed object 소유(?) } - coordinator : 중계자(?) - storage : 물리적 저장소(?) model -- coordinator -- context { managed object } | storage context (트랜젝션) 에 처리하고 싶은 데이터를 담아서 저장하면 coordinator 가 storage 에 영구적으로 저장하는 형식? 인 것 같다. 근데 UIImage를 저장하고 싶은데 찾아본 결과 Binary Data로 저장하면 된다고 해서 했더니 오류나서 다시 찾아보는 .. 2021. 2. 13. [iOS] CollectionView 1. 스토리보드에서 Object의 CollectionView 배치, CollectionViewCell 배치, cell 내부에 UI컴포넌트 배치 2. 셀 클래스 선언 (커스텀 셀) class MyCell: UICollectionViewCell{ @IBOutlet weak var Label : UILabel! } ViewController랑 같은 파일에 선언해도 되고 따로 파일 만들어서 선언해도 된다. (후자 추천) 선언 후 스토리보드 CollectionViewCell의 identity inspector에서 class명 입력해서 연결 3. ViewController에서 UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegate.. 2021. 2. 12. [iOS] tableView in storyboard TableViewController.swift와 storyboard에서 TableViewController 연결 : class명을 파일명과 일치시킴 Object에서 TableView, TableViewCell 가져와서 배치 cell의 사이즈 조정 (row size) TableViewCell의 size inspector에서 row height 조절 TableView의 size inspector에서도 row height 조절 custom cell Object에서 imageView, Label 등 가져와서 배치 auto layout 설정 각 UI컴포넌트마다 contraint 설정 (size, rate, spacing..) in TableViewController TableViewCon.. 2021. 2. 5. [iOS] UIAlertController, UIAlertAction 이런 알림창을 띄우고 처리해야 할 때 사용하는 객체가 UIAlertController와 UIAlertAction let alert = UIAlertController(title: "안내", message: "계속하시겠습니까?", preferredStyle: .alert) let actionYes = UIAlertAction(title: "예", style: .default, handler: nil) let actionNo = UIAlertAction(title: "아니오", style: .cancle, handler: nil) alert.addAction(action) alert.addAction(action2) present(alert, animated: true, completion: nil) 우선 .. 2021. 1. 30. 이전 1 2 다음