์ฐ์ ๊ฐ๋จํ UI ๊ตฌ์ฑ ํ, UISegmentedControl๊ณผ UIStackView๋ฅผ ํ์ฉํ์ฌ ๋ฉ๋ด๋ฅผ ์ถ๋ ฅํ๋ ๊ธฐ๋ฅ์ ๊ตฌํํด๋ณด์๋ค!
๊ทธ๋ฆฌ๊ณ ์ดํ ํ๋จ์ UITableView๋ฅผ ํฌํจ์์ผ, ์ฃผ๋ฌธํ ๋ชฉ๋ก์ ์ถ๋ ฅ์์ผฐ๋ค!
์ด๋, ์๋์ DataSet์ด๋ผ๋ ๋ฐฐ์ด์ ๊ฐ๊ฐ์ ๋งค๋ด์ ๋ฐ๋ฅธ ์์๋ค์ ์ ์ฅํด์ฃผ๊ณ ์ธ๊ทธ๋จผํธ์ ๊ฐ์ด ๋ฐ๋๋ ๋ง๋ค ์ถ๋ ฅํ๋ ๋ฐฐ์ด์ ์ด๊ธฐํ ํด์ฃผ๋ ๋ฐฉ์์ผ๋ก ์ ์ํ์๋ค.
let coffeeDataSet = [
Item(name: "์๋ฉ๋ฆฌ์นด๋
ธ", image: "coffee1.jpg", price: 2500),
Item(name: "์นดํ๋ผ๋ผ", image: "coffee2.jpg", price: 4000),
Item(name: "์์คํ๋ ์", image: "coffee3.jpg", price: 2000)
]
let teaDataSet = [
Item(name: "์ผ๋ชจ๋ง์ผํฐ", image: "tea1.jpg", price: 4000),
Item(name: "์์ด์คํฐ", image: "tea2.jpg", price: 3500),
Item(name: "๋ ๋ชฌํฐ", image: "tea3.jpg", price: 4000),
Item(name: "๊ทธ๋ฆฐํฐ", image: "tea4.jpg", price: 3500)
]
let cakeDataSet = [
Item(name: "๋ธ๋ฃจ๋ฒ ๋ฆฌ์น์ฆ์ผ์ต", image: "cake1.jpg", price: 6000),
Item(name: "๋ฐ์คํฌ ์น์ฆ์ผ์ต", image: "cake2.jpg", price: 5500),
Item(name: "๋น๊ทผ ์ผ์ต", image: "cake3.jpg", price: 6500)
]
var currentDataSet: [Item] = []
์ ์ฒด ์ฝ๋๋ ๋์ค์ Github์์ ์ ๋ฆฌํด๋ณผ ๊ณํ์ด๋ค!