Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- swiftdata
- Subject
- ribs
- swift 5.9
- JSON
- Combine
- RxSwift
- xcode
- Firebase Analytics
- observable
- swift 6
- ios
- realm
- SeSAC
- swift database
- swift
- Tuist
- GCD
- arc
- SwiftUI
- Firebase
- Tuist Swift
- Subscribe
- Swift Tuist
- KeyPath
- ios database
- 카카오뱅크 ios
- ios swiftdata
- 네트워크 통신
- swift db
Archives
- Today
- Total
천원의 개발
IOS TableView 초기설정 본문
class ViewController: UIViewController, UITableViewDataSource {
let test = [String] = ["first", "second", "third"]
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableView.dataSource = self
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return test.count // table 개수를 text함수 개수로 설정
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "여기에는 프로토타입 셀 식별자이름", for: indexPath)
cell.textLabel?.text = test[indexPath.row] //셀 데이터를 요청하는 행 번호에 해당
return cell
}
}
'iOS&Swift🍎' 카테고리의 다른 글
IOS Firebase에 데이터 추가 하기 (0) | 2022.04.02 |
---|---|
IOS TableView 커스텀 (0) | 2022.03.31 |
IOS Firebase를 활용한 로그인 화면 구현 (0) | 2022.03.29 |
IOS Firebase를 활용하여 회원가입 구현 (0) | 2022.03.29 |
IOS 글씨에 애니메이션 효과 주기 (0) | 2022.03.27 |