ehdrhelr / baseball Goto Github PK
View Code? Open in Web Editor NEWThis project forked from codesquad-members-2021/baseball
그룹프로젝트 #3
This project forked from codesquad-members-2021/baseball
그룹프로젝트 #3
이슈를 파서 논의하면 더 수월할 것 같아서 하나 생성해보았습니다 :)
PR까지
=> ViewDidAppear에서 다시 그려주면 될 것이다!
struct Info {
let userID: String
let game: Game
}
struct Game: Hashable, Decodable {
let id: Int
let home: Team
let away: Team
}
struct Team: Hashable, Decodable {
let team: String
let status: String
}
[{
"away": {
"team": "Captin",
"status": "selected"
},
"home": {
"team": "Marvel",
"status": "unselected"
}
},
{
"away": {
"team": "Twins",
"status": "selected"
},
"home": {
"team": "Tigers",
"status": "unselected"
}
}]
{
"userID": "user123",
"game": {
"away": {
"team": "Captin",
"status": "selected"},
"home": {
"team": "Marvel",
"status": "unselected"}
}
}
👉🏻 테이블뷰 안에 버튼 넣고 버튼 터치 시 액션 진행
일단 공부할 예정~
self가 가지고 있는 요소의 delegate를 self로 지정해서 강한 참조가 발생한 게 아닐까요..?
tableView의 dataSource나 delegate가 weak
으로 되어있으니 viewModel의 delegate도 weak하게 설정해주면 되는 것 같기도 하네요!!
private func configureDataSource() {
self.dataSource = UITableViewDiffableDataSource.init(tableView: self.gameListTableView) { (tableView, indexPath, game) -> UITableViewCell in
let cell = self.gameListTableView.dequeueReusableCell(withIdentifier: GameCell.reuseIdentifier) as! GameCell
self.viewModel.setCellInfo(with: game)
self.viewModel.delegate = self // <- ?
cell.updateUI(with: self.viewModel)
self.bindSelection(with: cell)
return cell
}
}
다만 메모리 그래프가 여전히 안 열려서 확인은 전혀 못해봤어요
OS 업데이트 문젠가 싶어서 업데이트 데이터 다운로드 중입니다ㅎㅎ..
5월 4일 추가
게임 모델
구현self.navigation
을 호출할 수 없음self.navigation
으로 화면 이동
self.navigation
쓸 수 있는 방법 찾기storyboard reference
를 써서 연결하기오늘 오후 iOS 회의 시 발견한 현상
-> selectionVC에서 gamePlayVC로 넘어갈 때 animated를 false -> true로 바꾸면 깨지지 않게 됨
func didPressButton(with gameInfo: GameInfo) {
let nextVC = ControllerFactory.instantiate(viewController: GamePlayViewController.self) as! GamePlayViewController
nextVC.getInfo(with: gameInfo)
self.navigationController?.pushViewController(nextVC, animated: true) // <-
}
홈 -> 1루 -> 2루 -> 3루 -> 홈
애니메이션을 연속적으로 실행시켜 놓은 상태만약 찾지 못할 경우 위치를 두번 설정해주면 되긴 하지만...
그러나 맑은 정신일 때 다시 보고 찾아보겠습니다!
수비 턴
PITCH 버튼 누를 시 GET 요청 (all 로직 @서버)공격 턴
PITCH 후 게임 상황 변화 시 GET애니메이션 구현과 별개의 이슈로 다뤄야 할 것 같아서 하나 더 팠습니다!
Combine / Notification 등 객체 간 정보 이동 방식이 좀 더 명확해지고 나서,
game 객체의 정보 변화에 따라 특정 애니메이션을 어떻게 호출시킬 지 논의 + 구현하면 좋을 것 같습니다 :)
(대충 애니메이션 모양새 완성 + PR 수정 끝나면 지식을 합쳐서 구현하면 될 것 같다는 얘기)
didSelect
를 쓰면 되겠지만 cell 안에서도 팀이 두 개로 나뉘어서 사용자 입력을 받는다..👉🏻 테이블뷰 안에 버튼 넣고 버튼 터치 시 액션 진행
failure(Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [],
debugDescription: "The given data was not valid JSON.",
underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840
"No string key for value in object around character 178."
UserInfo={NSDebugDescription=No string key for value in object around character 178.}))))
dataCorrupted
의 경우, 서버가 주는 JSON 데이터가 잘못된 경우가 많다고 한다A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.