-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/settings view #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค์ฐ ๋๋ฑ๋๋ฑ ์ผ๋ฌด์ง์ญ๋๋ค. ๊ณ ์ํ์ จ์๋๋ค.
didSet { | ||
fields.forEach { field in | ||
field.register(for: self.tableView) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ field๊ฐ ๋์ ์ผ๋ก ์ถ๊ฐ๋ ์ผ์ด ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewdidload์์ fields์ ์ด๊ธฐ๊ฐ์ด ๋ค์ด๊ฐ๋๋ค. ๋์ ์ผ๋ก ์ถ๊ฐ๋ ์ผ์ ์์ง๋ง, ํ๋กํผํฐ ์ต์ ๋ฒ๋ก ์ฒ๋ฆฌํ๋ฉด view did load ๋ฉ์๋์์ ๋ฐ๋ก ๋ค๋ฅธ ๋ฉ์๋๋ฅผ ํธ์ถํ ํ์๊ฐ ์์ด์ ธ์ ์ ๋ ๊ฒ ๊ตฌํํ์ด์ :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ์ ๋ ๊ณ ์ ์ ์ธ ๊ฐ์ด var๋ก ์ ์ธ๋๋ ๊ฒ์ด ์ข ๊ทธ๋ ๊ธฐ๋ ํ๊ณ ์ ์๊ฐ์ผ๋ก ์ฝ๊ฐ ์ธ๋ชจ์๋ ํจ์๊ฐ ๋ง๋ค์ด์ก๋ค๊ณ ๋ ์๊ฐ์ ํด์ viewDidLoad์์ ํ๋ฒ๋ง ํธ์ถํด์ฃผ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋น
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํผ๋๋ฐฑ ๋ฐ์ํ์ต๋๋ค! ์ด์ ์๋์ ๋ฉ์๋๋ฅผ ํธ์ถํด์ ์ฒ๋ฆฌํ๋ ์ฝ๋๋ก ๋ฐ๊ฟจ์ต๋๋ค :)
private func register() {
fields.forEach { field in
field.register(for: self.tableView)
}
}
๊ณ ์ ๋ง์ผ์ จ์ต๋๋ค! ํน์ Toggle๊ฐ์ ๊ฒฝ์ฐ๋ ์ ๋ด๋ถ์์ ๋ค๊ณ ์๋๋ฐ Settings View Controller์์ ์ด๋ค ์์ผ๋ก ์ฒ๋ฆฌํ์ค ๊ฑด์ง ์ฌ์ญค๋ด๋ ๋ ๊น์? |
- `fields`์ private let์ผ๋ก ๋ณ๊ฒฝ, `register`๋ฅผ ํด์ฃผ๋ private ๋ฉ์๋ ์ถ๊ฐ
์ง๊ธ์ ๊ตฌ์กฐ์ฒด๋ก ๋์ด์๋ |
ViewModel์ ์ด์ฉํ๋ฉด ์กฐ๊ธ๋ ๋ฐ์ดํฐ ๊ด๋ฆฌํ๊ธฐ๊ฐ ํธํด์ง๊ฒ ๋ค์! ์ข์ต๋๋ค! |
๋ฒ์จ ์ค์ ๋ทฐ๊ฐ ๊ตฌ์ฑ์ด ๋์๋ค์ ๊ณ ์ํ์ จ์ต๋๋ค!! |
๐ Issue Number
Close #49
๐ ์์ ๋ด์ญ
๐ ์์ ์ ํ
๐ ์ฒดํฌ๋ฆฌ์คํธ
๐ PR ํน์ด ์ฌํญ
fields
ํ๋กํผํฐ๋ฅผ ํตํด์ ๋ธ๋ฆฌ๊ฒ์ดํธ ๋ฉ์๋๋ฅผ ์คํํ๋๋ฐ, ๋์ค์fields
๋ถ๋ถ์ ๋ฐ๋ก ViewModel ํํธ๋ฅผ ๋ง๋ค์ด์ ์ฒ๋ฆฌํด์ผํ ๊ฒ ๊ฐ์ต๋๋ค. ๋ก๊ทธ์ธ๊ณผ ๋ก๊ทธ์์์ ์ํ์ ๋ฐ๋ผ ํ ์คํธ๊ฐ ๋ณ๊ฒฝ๋์ด์ผ ํ๊ณ , ํ ๊ธ ์ญ์ ๋๋ฅผ๋๋ง๋ค ์ํ๋ฅผ ๋ณ๊ฒฝํด์ผํ ํ ๋๊น์.