일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 스위프트
- type
- IOS
- 코딩테스트
- Xcode
- 이니셜라이저
- interpace
- Protocol
- initalizer
- delegate
- tuist
- initializer
- Class
- Method
- Git
- extension
- Foundation
- enum
- struct
- String
- Terminal
- UIKit
- Unicode
- instance
- init
- Swift
- optional
- property
- url
- 디자인패턴
- Today
- Total
목록prepare (2)
아리의 iOS 탐구생활

테이블뷰나 컬렉션뷰나... didSelectRowAt 메소드가 호출되었을 때 화면전환을 해주고 싶으면 어떻게 해야하는지 알아보는 시간! 아래처럼 스토리보드에서 Segue를 생성해주자 이후 생성한 Segue를 클릭하고, 우측 인스펙터에서... 위와 같이 identifier를 지정해준다. 이후 코드로 돌아가서 Delegate 프로토콜을 채택해주고, didSelectRowAt 메소드를 호출하여 performSegue 메소드를 호출해주면 끝~ // 코드 예시~ extension ItemListViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { perfor..

Apple Developer Documentation developer.apple.com 새로운 ViewController 클래스를 만들게 되면 아래 prepare 메소드가 주석처리 되어있다. /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new..