Skip to content

Commit

Permalink
Fixes title and toolbar not showing
Browse files Browse the repository at this point in the history
Signed-off-by: Takasur Azeem <[email protected]>
  • Loading branch information
takasurazeem committed Aug 3, 2023
1 parent f0f7532 commit 56ce911
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 14 additions & 0 deletions QuranQuiz/Quiz/Main/View/QuizView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import SwiftUI
import PDFKit

struct QuizView: View {
@StateObject var viewModel: ViewModel
Expand Down Expand Up @@ -66,6 +67,19 @@ struct QuizView: View {
)
.createFlyer()
)
.navigationTitle("PDF Preview")
.toolbar {
// FIXME: - Not a good place to put it here. Move to a file of its own.
ToolbarItem(placement: .navigationBarTrailing) {
if let document = PDFDocument(data: PDFCreator(
title: "",
verses: []
)
.createFlyer()) {
ShareLink(item: document, preview: SharePreview("PDF"))
}
}
}
}
}
}
Expand Down
8 changes: 0 additions & 8 deletions QuranQuiz/Quiz/PDFPreview/View/QuizPDFPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ struct QuizPDFPreview: View {
PDFKitView(documentData: documentData)
}
}
.navigationTitle("PDF Preview")
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
if let documentData, let document = PDFDocument(data: documentData) {
ShareLink(item: document, preview: SharePreview("PDF"))
}
}
}
}
}

Expand Down

0 comments on commit 56ce911

Please sign in to comment.