4/// Renders a small heart to indicate a photo is a "Favorite".
6/// This is meant to match the way favorite items are marked in Photos.
7struct FavoriteHeartIcon: ViewModifier {
11 init(_ isFavorite: Bool, _ isFocused: Bool) {
12 self.isFavorite = isFavorite
13 self.isFocused = isFocused
16 func body(content: Content) -> some View {
18 content.overlay(alignment: Alignment(horizontal: .leading, vertical: .bottom)) {
19 Image(systemName: "heart.fill")
20 .foregroundColor(.white)
22 .font(isFocused ? .title3 : .body)
32 func favoriteHeartIcon(_ isFavorite: Bool, _ isFocused: Bool) -> some View {
33 modifier(FavoriteHeartIcon(isFavorite, isFocused))