Skip to content

Commit

Permalink
Updates to support Xcode 14 beta 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Apple committed Jun 17, 2022
1 parent 4506c44 commit d7c68bb
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 66 deletions.
35 changes: 0 additions & 35 deletions App/Account/AccountMonogramView.swift

This file was deleted.

7 changes: 6 additions & 1 deletion App/Account/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ struct AccountView: View {
if case let .authenticated(username) = accountStore.currentUser {
Section {
HStack {
AccountMonogramView(username: username)
Image(systemName: "person.fill")
.font(.system(.largeTitle, design: .rounded))
.fontWeight(.semibold)
.foregroundColor(.white)
.frame(width: 60, height: 60)
.background(Color.accentColor.gradient, in: Circle())

Text(username)
.font(.system(.title3, design: .rounded))
Expand Down
5 changes: 2 additions & 3 deletions App/City/DetailedMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ struct DetailedMapView: ViewControllerRepresentable {
view.autoresizingMask = [.width, .height]
#endif

let configuration = MKStandardMapConfiguration(mapMode: .default, landscape: .detailed)
let configuration = MKStandardMapConfiguration(elevationStyle: .realistic, emphasisStyle: .default)
configuration.pointOfInterestFilter = .excludingAll
configuration.showsTraffic = false
configuration.showsBuildings = true
mapView.configuration = configuration
mapView.preferredConfiguration = configuration
mapView.isZoomEnabled = false
mapView.isPitchEnabled = false
mapView.isScrollEnabled = false
Expand Down
11 changes: 7 additions & 4 deletions App/Donut/DonutEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ struct DonutEditor: View {
}
#endif
}
.navigationTitle(donut.name) {
Button {
.toolbar {
ToolbarTitleActions {
Button {

} label: {
Label("My Action", systemImage: "star")
} label: {
Label("My Action", systemImage: "star")
}
}
}
.navigationTitle(donut.name)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
.toolbarRole(.editor)
Expand Down
5 changes: 1 addition & 4 deletions App/Store/SubscriptionStoreView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ struct SubscriptionOptionView: View {
@Environment(\.colorScheme) private var colorScheme

private var savingsText: String? {
if let savings = savings {
return "\(savings.formattedPrice(with: subscription.priceLocale)) (Save \(savings.formattedPercent))"
}
return nil
savings.map { "\($0.formattedPrice(for: subscription)) (Save \($0.formattedPercent))" }
}

private static var backgroundColor: Color {
Expand Down
12 changes: 2 additions & 10 deletions App/Truck/SocialFeedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,9 @@ struct SocialFeedPlusMarketingView: View {
.frame(maxWidth: .infinity)
}
#if os(iOS)
.listRowBackground(
Image("store/Social Feed Background")
.resizable()
.scaledToFill()
)
.listRowBackground(Rectangle().fill(.indigo.gradient))
#elseif os(macOS)
.background {
Image("store/Social Feed Background")
.resizable()
.scaledToFill()
}
.background(.indigo.gradient)
.cornerRadius(10)
#endif
}
Expand Down
6 changes: 0 additions & 6 deletions Food Truck.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
E0510740283C187300FCE3E6 /* StoreSupportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37C22282333C9007B925B /* StoreSupportView.swift */; };
E0510741283C187300FCE3E6 /* DonutEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BF328233374007B925B /* DonutEditor.swift */; };
E0510742283C187300FCE3E6 /* SalesHistoryChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = E039E3532834AC4800508176 /* SalesHistoryChart.swift */; };
E0510744283C187300FCE3E6 /* AccountMonogramView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE128233197007B925B /* AccountMonogramView.swift */; };
E0510746283C187300FCE3E6 /* RefundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37C24282333C9007B925B /* RefundView.swift */; platformFilter = ios; };
E0510747283C187300FCE3E6 /* UnlockFeatureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37C21282333C9007B925B /* UnlockFeatureView.swift */; };
E0510748283C187300FCE3E6 /* CardNavigationHeaderLabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09DC3642833222500040525 /* CardNavigationHeaderLabelStyle.swift */; };
Expand Down Expand Up @@ -64,7 +63,6 @@
E0C37BC92823189D007B925B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E0C37BC82823189D007B925B /* Assets.xcassets */; };
E0C37BDF28232B8B007B925B /* FoodTruckKit in Frameworks */ = {isa = PBXBuildFile; productRef = E0C37BDE28232B8B007B925B /* FoodTruckKit */; };
E0C37BE328233197007B925B /* SignUpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE028233197007B925B /* SignUpView.swift */; };
E0C37BE428233197007B925B /* AccountMonogramView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE128233197007B925B /* AccountMonogramView.swift */; };
E0C37BEB282331AA007B925B /* DetailedMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE6282331AA007B925B /* DetailedMapView.swift */; };
E0C37BEC282331AA007B925B /* CityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE7282331AA007B925B /* CityView.swift */; };
E0C37BED282331AA007B925B /* CityWeatherCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C37BE8282331AA007B925B /* CityWeatherCard.swift */; };
Expand Down Expand Up @@ -181,7 +179,6 @@
E0C37BCA2823189D007B925B /* Entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Entitlements.entitlements; sourceTree = "<group>"; };
E0C37BDC282326EF007B925B /* FoodTruckKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = FoodTruckKit; sourceTree = "<group>"; };
E0C37BE028233197007B925B /* SignUpView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignUpView.swift; sourceTree = "<group>"; };
E0C37BE128233197007B925B /* AccountMonogramView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountMonogramView.swift; sourceTree = "<group>"; };
E0C37BE228233197007B925B /* AccountView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
E0C37BE6282331AA007B925B /* DetailedMapView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailedMapView.swift; sourceTree = "<group>"; };
E0C37BE7282331AA007B925B /* CityView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CityView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -348,7 +345,6 @@
E0C37BD3282318D1007B925B /* Account */ = {
isa = PBXGroup;
children = (
E0C37BE128233197007B925B /* AccountMonogramView.swift */,
E0C37BE228233197007B925B /* AccountView.swift */,
E0C37BE028233197007B925B /* SignUpView.swift */,
);
Expand Down Expand Up @@ -609,7 +605,6 @@
E0510741283C187300FCE3E6 /* DonutEditor.swift in Sources */,
E0510742283C187300FCE3E6 /* SalesHistoryChart.swift in Sources */,
E0C4A528283E8FD5007D5B83 /* ShowTopDonutsIntent.swift in Sources */,
E0510744283C187300FCE3E6 /* AccountMonogramView.swift in Sources */,
E0510746283C187300FCE3E6 /* RefundView.swift in Sources */,
E0510747283C187300FCE3E6 /* UnlockFeatureView.swift in Sources */,
E0510748283C187300FCE3E6 /* CardNavigationHeaderLabelStyle.swift in Sources */,
Expand Down Expand Up @@ -660,7 +655,6 @@
E0C37C28282333C9007B925B /* StoreSupportView.swift in Sources */,
E0C37BFC28233374007B925B /* DonutEditor.swift in Sources */,
E039E3552834AC4800508176 /* SalesHistoryChart.swift in Sources */,
E0C37BE428233197007B925B /* AccountMonogramView.swift in Sources */,
E0C37C2A282333C9007B925B /* RefundView.swift in Sources */,
E0C37C27282333C9007B925B /* UnlockFeatureView.swift in Sources */,
E09DC3692833222700040525 /* CardNavigationHeaderLabelStyle.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion FoodTruckKit/Sources/Account/AccountStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public final class AccountStore: NSObject, ObservableObject, ASAuthorizationCont

// MARK: - Private

private static let relyingPartyIdentifier = "zkiraly.github.io"
private static let relyingPartyIdentifier = "example.com"
private var currentController: ASAuthorizationController?
private var currentContinuation: CheckedContinuation<ASAuthorizationCredential, Error>?

Expand Down
6 changes: 4 additions & 2 deletions FoodTruckKit/Sources/Store/Subscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public struct SubscriptionSavings {
return percentSavings.formatted(.percent.precision(.significantDigits(3)))
}

public func formattedPrice(with locale: Locale) -> String {
return "\(granularPrice.formatted(.currency(code: locale.currencyCode!)))/\(granularPricePeriod.localizedDescription.lowercased())"
public func formattedPrice(for subscription: Subscription) -> String {
let currency = granularPrice.formatted(subscription.priceFormatStyle)
let period = granularPricePeriod.formatted(subscription.subscriptionPeriodUnitFormatStyle)
return "\(currency)/\(period)"
}
}

0 comments on commit d7c68bb

Please sign in to comment.