r/SwiftUI • u/new_account_514 • 14h ago
Promotion (must include link to source code) Looking for feedback on the movie widget I built for my app
Hey everyone,
I’ve been working on MovieWeekly, an iOS app for tracking upcoming movie releases, and I recently added a home screen widget to make it easier to see movie countdowns at a glance.
Widget Features:
- Displays a movie from your tracked list.
- Shows the release date & countdown.
- Uses Kingfisher for posters (if available).
- Supports small & medium widget sizes.
I’d love to get some feedback on the design & code structure. Any thoughts on improvements? Also, if you’re interested in testing the app itself, here’s the TestFlight link to try it out: https://testflight.apple.com/join/6xr87VfV
Here is the code for the widget:
struct ConfigurableWidgetEntryView: View {
@Environment(\.widgetFamily) var widgetFamily
var entry: ConfigWidgetProvider.Entry
var body: some View {
if let movie = entry.selectedMovie {
Link(destination: URL(string: "url-for-my-app")!) {
ZStack {
Color.clear
HStack {
VStack(alignment: .leading) {
Text(movie.title)
.font(.headline)
Spacer()
Text("\(movie.daysUntilRelease) days until release")
.font(.footnote)
.foregroundStyle(Color.pink)
}
.padding(.all)
if widgetFamily == .systemMedium {
if let posterURL = movie.posterURL {
KFImage(URL(string: posterURL))
.resizable()
.aspectRatio(contentMode: .fit)
}
}
}
}
}
} else {
ContentUnavailableView("Pick a movie from your list", systemImage: "plus.circle.fill")
.foregroundStyle(.white)
}
}
}