혼자하려니 진도가 정말정말 느리다 ㅜ_ㅜ 화이티이이잉
알게된 것
- xib으로 tableViewCell을 커스텀하였습니다. 세로길이를 고정시키기 위해서 viewDidLoad()에 코드 작성하였습니다.
heightForRowAt 은 왜 안썻지..
self.gameTableView.rowHeight = 128
- Cell의 갯수만큼만 line(선)을 표시하였습니다.
➡️ Cell 의 배경색이 지정되어 있어서 충분히 구분감을 주기 때문에 굳이 선을 표시할 필요가 없어 후에 선을 지우게 되었습니다.
self.gameTableView.tableFooterView = UIView()
- 네비게이션 바를 투명하게 하는 코드
➡️ 네비게이션의 타이틀만 표시하기 위해서 작성하였습니다.
func clearNavigationBarBackgroundColor() { self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController?.navigationBar.shadowImage = UIImage() self.navigationController?.navigationBar.isTranslucent = true self.navigationController?.view.backgroundColor = .clear }
- 특정 Cell 클릭 시 다음 segue로 넘기기 (didSelectRowAt 사용)
Identifier는 스토리보드의 show로 넘기는 segue 입니다.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) switch indexPath.row { case 1: performSegue(withIdentifier: "OXQuiz", sender: nil) default: return } }
못한 것
- 네비게이션 타이틀 폰트 변경
-> 이걸 변경하니 테이블 뷰의 모든 것이 같이 사라집니다..
// 실패한 코드 guard let font: UIFont = UIFont(name: "넥슨Lv1고딕 Low OTF Light", size: 18) else { return } self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font]
- 헤드의 배경색, 폰트 변경
'iOS > PROJECT' 카테고리의 다른 글
[두깃] 깃허브 유저 정보 확인하기 (2022.04.08) (0) | 2022.04.09 |
---|---|
[두깃] 시작화면 UI (2022.04.07) (0) | 2022.04.07 |
[소리마당 Proj] OX Quiz 구현 (0) | 2021.08.15 |
[소리마당 Proj] 마이페이지 구현 (0) | 2021.08.11 |
[소리마당 Proj] ~런치스크린, 회원가입, 로그인 페이지 구현 (0) | 2021.07.23 |