Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
[수정] 코드 개선 (#10)
Browse files Browse the repository at this point in the history
* [수정] NavigationStack 적용 (NavigationView is deprecated)

* [추가] Mocking 데이터에 SPI 추가

* [추가] @observable 을 수정하지 말도록 안내하는 문구 추가

* [수정] 안내 문구 수정
  • Loading branch information
x-0o0 authored Jan 2, 2024
1 parent eb54014 commit 42b6bc4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SwiftCinema/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CinemaUI

struct ContentView: View {
var body: some View {
NavigationView {
NavigationStack {
MovieList()
}
}
Expand Down
4 changes: 2 additions & 2 deletions swift-cinema/Sources/CinemaUI/MovieList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct MovieList: View {
// 수정하지 마십시오
Section {
#if targetEnvironment(simulator)
Text("실제 기기에서 돌리십시오")
Text("실제 기기에서 실행하십시오")

NavigationLink("개발자 계정이 없어서 실제 기기 실행이 불가합니까?") {
SubmissionDetailView(
Expand Down Expand Up @@ -53,7 +53,7 @@ public struct MovieList: View {
}

#Preview {
NavigationView {
NavigationStack {
MovieList()
}
.environment(MovieCollectionFetcher())
Expand Down
2 changes: 1 addition & 1 deletion swift-cinema/Sources/CinemaUI/MovieRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Note: See the `License.txt` file for this sample’s licensing information.
*/

import Models
@_spi(Mocks) import Models
import SwiftUI

struct MovieRow: View {
Expand Down
2 changes: 1 addition & 1 deletion swift-cinema/Sources/CinemaUI/SubmissionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct SubmissionDetailView: View {
}

#Preview {
NavigationView {
NavigationStack {
SubmissionDetailView(
needsAlternative: false
)
Expand Down
2 changes: 1 addition & 1 deletion swift-cinema/Sources/Fetcher/MovieCollectionFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Models
import SwiftUI

@Observable
@Observable // 수정하지 마십시오
public class MovieCollectionFetcher {
/// 영화 순위 별로 나열된 영화 정보
public var movies: [Movie] = [] {
Expand Down
2 changes: 1 addition & 1 deletion swift-cinema/Sources/Models/Movie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct Movie: Identifiable, Decodable {
}

extension Movie {
public static var kuflix = Movie(
@_spi(Mocks) public static var kuflix = Movie(
name: "Kuflix",
rank: Int.random(in: 1...10).description,
code: UUID().uuidString
Expand Down

0 comments on commit 42b6bc4

Please sign in to comment.