-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Network] #110 - 식당 제보하기 기능 완료 #115
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.
레전드 개발자 발생 나이스하다
/// 식당 제보하기 Response | ||
struct PostHankkiResponseData: Codable { | ||
var name: String | ||
var id: Int64 |
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.
detail good
for i in 0..<collectionView.numberOfItems(inSection: sectionNumber) { | ||
let indexPath = IndexPath(row: i, section: sectionNumber) | ||
if let cell = collectionView.cellForItem(at: indexPath) as? MenuCollectionViewCell { | ||
for subview in cell.contentView.subviews { | ||
if let textField = subview as? UITextField { | ||
if textField.tag == i * 2 { | ||
menuName = textField.text ?? "" | ||
} else if textField.tag == i * 2 + 1 { | ||
menuPrice = textField.text ?? "" | ||
} | ||
} | ||
} | ||
|
||
let menuData = MenuData(name: menuName, price: Int(menuPrice) ?? 0) | ||
menuCellData.append(menuData) | ||
} | ||
} |
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.
아주 NICE LGTM
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.
개 굿이오 마마
window = UIWindow(windowScene: windowScene) | ||
window?.rootViewController = SplashViewController() | ||
window?.rootViewController = navigationController |
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.
@@ -55,15 +56,21 @@ extension BaseTargetType { | |||
} | |||
|
|||
var headers: [String: String]? { | |||
var header = ["Content-Type": "application/json"] | |||
var header: [String: String] = [:] |
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 selectedImageData: Data? | ||
|
||
var menus: [MenuData] = [MenuData()] |
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.
이건 그냥 빈 배열로 넣어야하면 안되나요?
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.
기본으로 메뉴 셀 하나는 처음부터 보여야 해서 이렇게 했습니다!
🔥 Pull requests
👷 작업한 내용
🚨 참고 사항
멀티파트 통신을 위한 헤더 타입이 추가되었습니다.
📸 스크린샷
🖥️ 주요 코드 설명
createMultipartFormData
함수를 통해 멀티파트 통신할 때 사용되는[MultipartFormData]
타입의 데이터를 만듭니다.convertToJSON
함수를 통해 PostHankkiRequestDTO 형태의 구조체를 JSON 형태로 변경합니다.collectMenuCellData
함수를 통해 메뉴 컬렉션뷰 셀을 하나씩 돌면서 셀 안에 있는 2개의 텍스트필드(메뉴 이름과 가격)의 값을 순차적으로 가져와[MenuData]
형태를 만듭니다.filter
함수를 사용하여 메뉴 이름 또는 가격 값이 비어있는 것은 제외시켰습니다.✅ Check List
📟 관련 이슈