diff --git a/Gemfile b/Gemfile index 3131afd..e8d93d6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem 'fastlane', '2.206.2' \ No newline at end of file +gem 'fastlane', '2.228.0' diff --git a/SwiftLeeds/Views/Components/FancyHeaderView.swift b/SwiftLeeds/Views/Components/FancyHeaderView.swift index c7edeab..f6682a2 100644 --- a/SwiftLeeds/Views/Components/FancyHeaderView.swift +++ b/SwiftLeeds/Views/Components/FancyHeaderView.swift @@ -113,7 +113,9 @@ struct FancyHeaderView: View { } private var foregroundImageCount: Int { - foregroundImageURLs.count + (foregroundImageName == nil ? 0 : 1) + let count = foregroundImageURLs.count + (foregroundImageName == nil ? 0 : 1) + // Ensure we always have at least 1 for the fallback image + return count == 0 ? 1 : count } private var shadowColor: Color { diff --git a/SwiftLeeds/Views/My Conference/ActivityView.swift b/SwiftLeeds/Views/My Conference/ActivityView.swift index eb36ee3..e6dc1ba 100644 --- a/SwiftLeeds/Views/My Conference/ActivityView.swift +++ b/SwiftLeeds/Views/My Conference/ActivityView.swift @@ -28,22 +28,29 @@ struct ActivityView: View { foregroundImageURLs: foregroundImageURLs ) - StackedTileView( - primaryText: activity.subtitle, - secondaryText: activity.description, - secondaryColor: Color.primary - ) - .padding(Padding.screen) + let hasSubtitle = activity.subtitle != nil && !activity.subtitle!.isEmpty + let hasDescription = activity.description != nil && !activity.description!.isEmpty + + if hasSubtitle || hasDescription { + StackedTileView( + primaryText: activity.subtitle, + secondaryText: activity.description, + secondaryColor: Color.primary + ) + .padding(Padding.screen) + } } } private var foregroundImageURLs: [URL] { - if let image = activity.image?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed), let url = URL(string: image) { + if let image = activity.image, + !image.isEmpty, + let encodedImage = image.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed), + let url = URL(string: encodedImage) { return [url] } else { return [] } - } } diff --git a/SwiftLeeds/Views/My Conference/MyConferenceViewModel.swift b/SwiftLeeds/Views/My Conference/MyConferenceViewModel.swift index 5b81a75..9bca1a2 100644 --- a/SwiftLeeds/Views/My Conference/MyConferenceViewModel.swift +++ b/SwiftLeeds/Views/My Conference/MyConferenceViewModel.swift @@ -52,7 +52,9 @@ class MyConferenceViewModel: ObservableObject { for date in individualDates { let key = Helper.shortDateFormatter.string(from: date) - slots[key] = schedule.data.slots.filter { Calendar.current.compare(date, to: $0.date ?? Date(), toGranularity: .day) == .orderedSame } + slots[key] = schedule.data.slots + .filter { Calendar.current.compare(date, to: $0.date ?? Date(), toGranularity: .day) == .orderedSame } + .sorted { $0.startTime < $1.startTime } } hasLoaded = true diff --git a/SwiftLeeds/Views/My Conference/SpeakerView.swift b/SwiftLeeds/Views/My Conference/SpeakerView.swift index 8a55fab..d377dff 100644 --- a/SwiftLeeds/Views/My Conference/SpeakerView.swift +++ b/SwiftLeeds/Views/My Conference/SpeakerView.swift @@ -27,9 +27,12 @@ struct SpeakerView: View { private var content: some View { VStack(spacing: Padding.stackGap) { if presentation.speakers.isEmpty == false { + let imageURLs = presentation.speakers.compactMap { speaker in + speaker.profileImage.isEmpty ? nil : URL(string: speaker.profileImage) + } FancyHeaderView( title: presentation.speakers.joinedNames, - foregroundImageURLs: presentation.speakers.map { URL(string: $0.profileImage)! } + foregroundImageURLs: imageURLs ) } @@ -69,11 +72,13 @@ struct SpeakerView: View { } ForEach(presentation.speakers) { speaker in - StackedTileView( - primaryText: "About\(presentation.speakers.count == 1 ? "" : ": \(speaker.name)")", - secondaryText: speaker.biography, - secondaryColor: Color.primary - ) + if !speaker.biography.isEmpty { + StackedTileView( + primaryText: "About\(presentation.speakers.count == 1 ? "" : ": \(speaker.name)")", + secondaryText: speaker.biography, + secondaryColor: Color.primary + ) + } if let twitter = speaker.twitter, twitter.isEmpty == false { CommonTileView(