Skip to content

Conversation

@pedro0527
Copy link
Collaborator

🍎 iOS Pull request

  • 7주차 세미나 과제

✅ 작업(과제) 내용

  • 7주차 과제

  • TVING 메인 화면 (3주차 과제 UI)을 SwiftUI 프레임워크를 사용해서 구현
  • 기본과제, 심화과제 3주차와 동일
  • 다음주 화요일 (6월 3일) 23:59까지 입니다.
  • PR 6월 3일 오후 10시부터 올려주세요

💡 새로 알게 된 내용

var body: some View {
        ScrollView(.horizontal) {
            HStack {
                ForEach(kbos.indices, id: \.self) { index in
                    let kbo = kbos[index]
                    Image(kbo.image)
                        .resizable()
                        .frame(width: 80, height: 50)
                        .background(index % 2 == 0 ? .white : .black)
                }
            }
        }
        .padding(.horizontal, 8)
        .padding(.vertical, 25)
    }
  • indices를 통해서 index 값을 받아오고 index의 홀짝에 따라서 배경색을 설정했습니다.

📸 스크린샷

구현 영상
WEEK7

💭 Issue

Copy link

@sem-git sem-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고 많이 하셨습니다
SwiftUI = 이수용 축하드립니다

Comment on lines +11 to +18
let header = HeaderView()
let today = TodayView()
let live = LiveView()
let movie = MovieView()
let kbo = KboView()
let category = CategoryView()
let pd = PdView()
let bottom = BottomView()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SwiftUI에서는 뷰가 상태 기반으로 다시 그려지는 걸로 알고 있어서,
let으로 선언해두기보단 body에서 직접 선언하는 쪽으로 권장드립니다 ~~

Comment on lines +24 to +26
Image("main")
.resizable()
.frame(width: .infinity, height: 400)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UIKit에서 했던 것과 마찬가지로

Image(.main)

으로 불러올 수도 있습니다!

Comment on lines +16 to +18
Text("실기간 인기 영화")
.font(.headline)
.foregroundColor(.white)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오타가 있네요이

Comment on lines +16 to +18
ForEach(kbos.indices, id: \.self) { index in
let kbo = kbos[index]
Image(kbo.image)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id가 index 이기 때문에 kbo 변수를 만들지 않고 바로 kbos[index] 로 사용해도 될 것 같네요
just 개인 취향 ㅎㅎ

@dudwntjs
Copy link

dudwntjs commented Jun 6, 2025

첨에 구조 스유천재 이수용꺼 보고 해가지고 Model과 View를 나눠서 작성한 거까지 비슷해가지고 머 할 말이 없네요
완벽합니다오

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants