Add monthly check-in sharing

This commit is contained in:
alexandrev-tibco
2026-02-01 11:32:20 +01:00
parent b5ba6c47a8
commit edfd7a2a56
2 changed files with 56 additions and 0 deletions
@@ -6,6 +6,29 @@ class ShareService {
private init() {}
func shareText(_ content: String) {
guard let viewController = ShareService.topViewController() else { return }
let activityVC = UIActivityViewController(
activityItems: [content],
applicationActivities: nil
)
if let popover = activityVC.popoverPresentationController {
popover.sourceView = viewController.view
popover.sourceRect = CGRect(
x: viewController.view.bounds.midX,
y: viewController.view.bounds.midY,
width: 0,
height: 0
)
}
DispatchQueue.main.async {
viewController.present(activityVC, animated: true)
}
}
func shareTextFile(content: String, fileName: String) {
guard let viewController = ShareService.topViewController() else { return }