Skip to content

Commit

Permalink
Use safe title
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Mar 16, 2021
1 parent 0171b67 commit 3d7b387
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Widgets/Views.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct LargeComicWidgetView: View {
HStack {
ComicBadgeHeader(comic: entry.comic)

Text(entry.comic.title).font(.headline).lineLimit(1).foregroundColor(.white)
Text(entry.comic.safeTitle).font(.headline).lineLimit(1).foregroundColor(.white)
}
.padding()
}
Expand All @@ -65,7 +65,7 @@ struct SmallComicWidgetView: View {
VStack(alignment: .leading) {
ComicBadgeHeader(comic: entry.comic)

Text(verbatim: entry.comic.title).font(.headline).lineLimit(1).padding(.bottom, 1)
Text(verbatim: entry.comic.safeTitle).font(.headline).lineLimit(1).padding(.bottom, 1)

Text(verbatim: entry.comic.alt).font(.caption)

Expand Down
1 change: 1 addition & 0 deletions XKCDY/Support/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ extension ComicResponse {
obj.publishedAt = publishedAt
obj.news = news
obj.title = title
obj.safeTitle = safeTitle
obj.transcript = transcript
obj.alt = alt
obj.sourceURL = URL(string: sourceUrl)
Expand Down
2 changes: 1 addition & 1 deletion XKCDY/Views/ComicDetailsSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct ComicDetailsSheet: View {
}
.padding(30)
}
.navigationBarTitle(Text(comic.title), displayMode: .inline)
.navigationBarTitle(Text(comic.safeTitle), displayMode: .inline)
.navigationBarItems(trailing: Button(action: self.onDismiss) {
Text("Done").bold()
})
Expand Down
4 changes: 2 additions & 2 deletions XKCDY/Views/ComicPagerOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct ComicPagerOverlay: View {
}

VStack {
Text(self.store.comic.title)
Text(self.store.comic.safeTitle)
.font(.title)
.multilineTextAlignment(.center)

Expand Down Expand Up @@ -197,7 +197,7 @@ struct ComicPagerOverlay: View {
if self.imageToShare == nil {
URLActivityViewController(url: self.store.comic.sourceURL!)
} else {
UIImageActivityViewController(uiImage: self.imageToShare!, title: self.store.comic.title, url: self.store.comic.sourceURL!)
UIImageActivityViewController(uiImage: self.imageToShare!, title: self.store.comic.safeTitle, url: self.store.comic.sourceURL!)
}
} else if self.activeSheet == .details {
ComicDetailsSheet(comic: self.store.comic, onDismiss: {
Expand Down
2 changes: 1 addition & 1 deletion XKCDY/Views/SharableComicView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct SharableComicView: View {
.font(Font.system(size: self.getFontSize()).bold())
.foregroundColor(Color.white)

Text(comic.title)
Text(comic.safeTitle)
.lineLimit(1)
.foregroundColor(Color.white)

Expand Down
2 changes: 1 addition & 1 deletion XKCDYIntents/IntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension Comic {
let comic = ComicSiri(identifier: String(id), display: title)

comic.publishedAt = Calendar.current.dateComponents([.year, .month, .day], from: publishedAt)
comic.title = title
comic.title = safeTitle
comic.transcript = transcript
comic.alt = alt
comic.sourceUrl = sourceURL
Expand Down

0 comments on commit 3d7b387

Please sign in to comment.