Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions SwiftLeeds.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
0B4CB3D428EAF19100246E62 /* SwiftLeedsAppClip.app in Embed App Clips */ = {isa = PBXBuildFile; fileRef = 0B4CB3C528EAF19000246E62 /* SwiftLeedsAppClip.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
0B4CB3DD28EAF57900246E62 /* MyConferenceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AECB295827417F9D00CDC983 /* MyConferenceView.swift */; };
0B4CB3DE28EAF57E00246E62 /* MyConferenceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC22522898281300746247 /* MyConferenceViewModel.swift */; };
0B4CB3DF28EAF58400246E62 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE32CDEF286CCF9D00DF0AFF /* Constants.swift */; };
0B4CB3E028EAF58A00246E62 /* Schedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC22542898288F00746247 /* Schedule.swift */; };
0B4CB3E328EAF5A200246E62 /* Activity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C1B2128BFCF4700AF7318 /* Activity.swift */; };
0B4CB3E428EAF5AF00246E62 /* Presentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C1B2328BFCFC700AF7318 /* Presentation.swift */; };
Expand Down Expand Up @@ -68,7 +67,6 @@
74B14FB028CE21D7004C0A40 /* TimeineProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74B14FAF28CE21D7004C0A40 /* TimeineProvider.swift */; };
74B14FB228CE2221004C0A40 /* SwiftLeedsWidgetEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74B14FB128CE2221004C0A40 /* SwiftLeedsWidgetEntry.swift */; };
74B14FB428CE2245004C0A40 /* SwiftLeedsWidgetEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74B14FB328CE2245004C0A40 /* SwiftLeedsWidgetEntryView.swift */; };
74E62F7028CA68D2004422F9 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE32CDEF286CCF9D00DF0AFF /* Constants.swift */; };
74E62F7228CA98EA004422F9 /* SwiftLeedsSmallWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E62F7128CA98EA004422F9 /* SwiftLeedsSmallWidgetView.swift */; };
74E62F7428CAAB30004422F9 /* SwiftLeedsMediumWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E62F7328CAAB30004422F9 /* SwiftLeedsMediumWidgetView.swift */; };
74E62F7728CADBD8004422F9 /* Schedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC22542898288F00746247 /* Schedule.swift */; };
Expand All @@ -94,7 +92,6 @@
7BE081542EE5BF13004BCD1F /* SharedAssets in Frameworks */ = {isa = PBXBuildFile; productRef = 7BE081532EE5BF13004BCD1F /* SharedAssets */; };
AE1C8010289E9F3800996659 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE1C800F289E9F3800996659 /* String.swift */; };
AE1C801428A7BCD000996659 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = AE1C801328A7BCD000996659 /* Settings.bundle */; };
AE32CDF0286CCF9D00DF0AFF /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE32CDEF286CCF9D00DF0AFF /* Constants.swift */; };
AE5EFD73289DC1D000464FE1 /* CachedAsyncImage in Frameworks */ = {isa = PBXBuildFile; productRef = AE5EFD72289DC1D000464FE1 /* CachedAsyncImage */; };
AE5EFD75289E7CBF00464FE1 /* ActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5EFD74289E7CBF00464FE1 /* ActivityView.swift */; };
AE8C1B2228BFCF4700AF7318 /* Activity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C1B2128BFCF4700AF7318 /* Activity.swift */; };
Expand Down Expand Up @@ -228,7 +225,6 @@
7B8108412E5CA00E00CCB2F5 /* SwiftLeedsPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = SwiftLeedsPackage; sourceTree = "<group>"; };
AE1C800F289E9F3800996659 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
AE1C801328A7BCD000996659 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
AE32CDEF286CCF9D00DF0AFF /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
AE5EFD74289E7CBF00464FE1 /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = "<group>"; };
AE8C1B2128BFCF4700AF7318 /* Activity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Activity.swift; sourceTree = "<group>"; };
AE8C1B2328BFCFC700AF7318 /* Presentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presentation.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -479,7 +475,6 @@
AECB29862741AC5800CDC983 /* App */ = {
isa = PBXGroup;
children = (
AE32CDEF286CCF9D00DF0AFF /* Constants.swift */,
AECB29832741ABFD00CDC983 /* Info.plist */,
AECB295627417F9D00CDC983 /* SwiftLeedsApp.swift */,
740162D92A7053A000C2D1B3 /* AppState.swift */,
Expand Down Expand Up @@ -803,7 +798,6 @@
files = (
0B4CB3E028EAF58A00246E62 /* Schedule.swift in Sources */,
0B4CB3EE28EAF5FB00246E62 /* String.swift in Sources */,
0B4CB3DF28EAF58400246E62 /* Constants.swift in Sources */,
0B4CB3F128EAF61000246E62 /* StackedTileView.swift in Sources */,
0B4CB3DE28EAF57E00246E62 /* MyConferenceViewModel.swift in Sources */,
AE9367902A93467500F2DB3F /* ScheduleView.swift in Sources */,
Expand Down Expand Up @@ -848,7 +842,6 @@
74E62F7A28CAE4DF004422F9 /* Speaker.swift in Sources */,
74E62F7728CADBD8004422F9 /* Schedule.swift in Sources */,
74B14FB228CE2221004C0A40 /* SwiftLeedsWidgetEntry.swift in Sources */,
74E62F7028CA68D2004422F9 /* Constants.swift in Sources */,
74B14FB428CE2245004C0A40 /* SwiftLeedsWidgetEntryView.swift in Sources */,
0B59B5732E70EA6600820C3C /* About.swift in Sources */,
);
Expand Down Expand Up @@ -895,7 +888,6 @@
FA57DE482875B06500911F03 /* StackedTileView.swift in Sources */,
FA534D8228A1909300A3BFBB /* Local.swift in Sources */,
AE93678F2A93455400F2DB3F /* ScheduleView.swift in Sources */,
AE32CDF0286CCF9D00DF0AFF /* Constants.swift in Sources */,
FA57DE472875B06500911F03 /* CommonTileView.swift in Sources */,
FA57DE462875B06500911F03 /* CommonTileButton.swift in Sources */,
74F5EF852A49CE6A008D9413 /* TabsMainView.swift in Sources */,
Expand Down
10 changes: 0 additions & 10 deletions SwiftLeeds/App/Constants.swift

This file was deleted.

2 changes: 1 addition & 1 deletion SwiftLeeds/Views/About/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct AboutView: View {
VStack(spacing: Padding.cellGap) {
FancyHeaderView(
title: "About",
foregroundImageName: Assets.Image.swiftLeedsIcon
foregroundImage: Image.swiftLeedsIcon
)

VStack(spacing: Padding.cellGap) {
Expand Down
45 changes: 28 additions & 17 deletions SwiftLeeds/Views/Components/FancyHeaderView.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import CachedAsyncImage
import DesignKit
import SharedAssets
import SwiftUI

struct FancyHeaderView: View {
private let title: String
private let foregroundImageURLs: [URL]
private let foregroundImageName: String?
private let foregroundImage: Image?

private let foregroundImageWidth: Double = 160
private let aspectRatio = 1.66

@State private var foregroundGroupViewHeight: CGFloat = .zero

// MARK: - Initialisers
init(title: String, foregroundImageURLs: [URL] = [], foregroundImageName: String? = nil) {
init(title: String, foregroundImageURLs: [URL] = [], foregroundImage: Image? = nil) {
self.title = title
self.foregroundImageURLs = foregroundImageURLs
self.foregroundImageName = foregroundImageName
self.foregroundImage = foregroundImage
}

var body: some View {
Expand All @@ -25,7 +26,7 @@ struct FancyHeaderView: View {
.edgesIgnoringSafeArea(.top)
.aspectRatio(aspectRatio, contentMode: .fill)
.background(
createRectangleImage(for: Image(Assets.Image.leedsPlayhouse), aspectRatio: aspectRatio)
createRectangleImage(for: Image.leedsPlayhouse, aspectRatio: aspectRatio)
.aspectRatio(contentMode: .fill)
.accessibilityHidden(true)
)
Expand Down Expand Up @@ -70,17 +71,17 @@ struct FancyHeaderView: View {
createRectangleImage(for: image)
.accessibilityHidden(true)
case .failure(_):
createRectangleImage(for: Image(Assets.Image.swiftLeedsIcon))
createRectangleImage(for: Image.swiftLeedsIcon)
@unknown default:
loadingView()
}
}
}
}
} else if let foregroundImageName = foregroundImageName {
createRectangleImage(for: Image(foregroundImageName))
} else if let foregroundImage = foregroundImage {
createRectangleImage(for: foregroundImage)
} else {
createRectangleImage(for: Image(Assets.Image.swiftLeedsIcon))
createRectangleImage(for: Image.swiftLeedsIcon)
}
}

Expand All @@ -107,7 +108,7 @@ struct FancyHeaderView: View {
}

private var foregroundImageCount: Int {
let count = foregroundImageURLs.count + (foregroundImageName == nil ? 0 : 1)
let count = foregroundImageURLs.count + (foregroundImage == nil ? 0 : 1)
// Ensure we always have at least 1 for the fallback image
return count == 0 ? 1 : count
}
Expand All @@ -122,22 +123,32 @@ struct FancyHeaderView_Previews: PreviewProvider {
Group {
VStack {
Text(verbatim: "Local Asset")
FancyHeaderView(title: "Some Long Text here",
foregroundImageName: Assets.Image.swiftLeedsIcon)
FancyHeaderView(
title: "Some Long Text here",
foregroundImage: Image.swiftLeedsIcon
)
Text(verbatim: "Remote Data")
FancyHeaderView(title: "Swift Taylor",
foregroundImageURLs: [URL(string: "https://cdn-az.allevents.in/events5/banners/458482c4fc7489448aa3d77f6e2cd5d0553fa5edd7178dbf18cf986d2172eaf2-rimg-w1200-h675-gmir.jpg?v=1655230338")!])
FancyHeaderView(
title: "Swift Taylor",
foregroundImageURLs: [URL(string: "https://cdn-az.allevents.in/events5/banners/458482c4fc7489448aa3d77f6e2cd5d0553fa5edd7178dbf18cf986d2172eaf2-rimg-w1200-h675-gmir.jpg?v=1655230338")!]
)

}
ScrollView {
Text(verbatim: "Local Asset")
VStack {
FancyHeaderView(title: "Kannan Prasad",
foregroundImageName: Assets.Image.swiftLeedsIcon)
FancyHeaderView(
title: "Kannan Prasad",
foregroundImage: Image.swiftLeedsIcon
)
}
Text(verbatim: "Remote Data")
FancyHeaderView(title: "Swift Taylor",
foregroundImageURLs: [URL(string: "https://cdn-az.allevents.in/events5/banners/458482c4fc7489448aa3d77f6e2cd5d0553fa5edd7178dbf18cf986d2172eaf2-rimg-w1200-h675-gmir.jpg?v=1655230338")!])
FancyHeaderView(
title: "Swift Taylor",
foregroundImageURLs: [
URL(string: "https://cdn-az.allevents.in/events5/banners/458482c4fc7489448aa3d77f6e2cd5d0553fa5edd7178dbf18cf986d2172eaf2-rimg-w1200-h675-gmir.jpg?v=1655230338")!
]
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion SwiftLeeds/Views/Sponsors/SponsorsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct SponsorsView: View {
VStack(spacing: 0) {
FancyHeaderView(
title: "Sponsors",
foregroundImageName: Assets.Image.swiftLeedsIcon
foregroundImage: Image.swiftLeedsIcon
)

if isLoading {
Expand Down
30 changes: 24 additions & 6 deletions SwiftLeedsWidget/SwiftLeedsMediumWidgetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension SwiftLeedsMediumWidgetView {
}

private var logoView: some View {
Image(Assets.Image.swiftLeedsIconWithNoBackground)
Image.swiftLeedsIcon
.resizable()
.aspectRatio(contentMode: .fill)
.transition(.opacity)
Expand All @@ -88,11 +88,29 @@ extension SwiftLeedsMediumWidgetView {

struct SwiftLeedsMediumWidgetView_Previews: PreviewProvider {
static var previews: some View {
SwiftLeedsMediumWidgetView(slot: Schedule.Slot(id: UUID(), date: Date(), startTime: "11:00 AM", duration: 1, activity: nil, presentation: Presentation.donnyWalls))
.previewContext(WidgetPreviewContext(family: .systemMedium))
SwiftLeedsMediumWidgetView(
slot: Schedule.Slot(
id: UUID(),
date: Date(),
startTime: "11:00 AM",
duration: 1,
activity: nil,
presentation: Presentation.donnyWalls
)
)
.previewContext(WidgetPreviewContext(family: .systemMedium))

SwiftLeedsMediumWidgetView(slot: Schedule.Slot(id: UUID(), date: Date(), startTime: "11:00 AM", duration: 1, activity: nil, presentation: Presentation.donnyWalls))
.environment(\.colorScheme, .dark)
.previewContext(WidgetPreviewContext(family: .systemMedium))
SwiftLeedsMediumWidgetView(
slot: Schedule.Slot(
id: UUID(),
date: Date(),
startTime: "11:00 AM",
duration: 1,
activity: nil,
presentation: Presentation.donnyWalls
)
)
.environment(\.colorScheme, .dark)
.previewContext(WidgetPreviewContext(family: .systemMedium))
}
}
5 changes: 3 additions & 2 deletions SwiftLeedsWidget/SwiftLeedsSmallWidgetView.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import SharedAssets
import SwiftUI
import WidgetKit

struct SwiftLeedsSmallWidgetView: View {

// MARK: - Pivate Properties
// MARK: - Private Properties

private let slot: Schedule.Slot

Expand Down Expand Up @@ -65,7 +66,7 @@ extension SwiftLeedsSmallWidgetView {
}

private var logoView: some View {
Image(Assets.Image.swiftLeedsIconWithNoBackground)
Image.swiftLeedsIcon
.resizable()
.aspectRatio(contentMode: .fill)
.transition(.opacity)
Expand Down