Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit a122c20

Browse files
committed
Bug fixes, Fix sharing themes on iPad
1 parent c942a34 commit a122c20

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

Slide for Reddit/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
326326
}
327327

328328
#if DEBUG
329-
SettingValues.isPro = false
329+
SettingValues.isPro = true
330330
UserDefaults.standard.set(true, forKey: SettingValues.pref_pro)
331331
UserDefaults.standard.synchronize()
332332
UIApplication.shared.isIdleTimerDisabled = true

Slide for Reddit/CommentViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,10 +2407,14 @@ class CommentViewController: MediaViewController, UITableViewDelegate, UITableVi
24072407
(navigationController)?.setNavigationBarHidden(true, animated: true)
24082408

24092409
(self.navigationController)?.setToolbarHidden(true, animated: true)
2410-
self.createJumpButton()
24112410
}
24122411
self.isToolbarHidden = true
2413-
isHiding = false
2412+
2413+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
2414+
guard let strongSelf = self else { return }
2415+
strongSelf.createJumpButton()
2416+
strongSelf.isHiding = false
2417+
}
24142418
}
24152419

24162420
func showUI() {

Slide for Reddit/SettingsTheme.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,16 @@ class SettingsTheme: BubbleSettingTableViewController, ColorPickerViewDelegate {
588588
let textShare = UserDefaults.standard.string(forKey: "Theme+" + inputTheme) ?? UserDefaults.standard.string(forKey: "Theme+" + inputTheme.replacingOccurrences(of: "#", with: "<H>").addPercentEncoding) ?? UserDefaults.standard.string(forKey: "Theme+" + inputTheme.replacingOccurrences(of: "#", with: "<H>")) ?? ""
589589

590590
let activityViewController = UIActivityViewController(activityItems: [textShare], applicationActivities: nil)
591-
activityViewController.popoverPresentationController?.sourceView = self.shareButton.customView
592-
self.present(activityViewController, animated: true, completion: nil)
591+
if let presenter = activityViewController.popoverPresentationController {
592+
presenter.sourceView = tableView.cellForRow(at: indexPath)
593+
presenter.sourceRect = tableView.cellForRow(at: indexPath)?.bounds ?? CGRect.zero
594+
}
595+
let window = UIApplication.shared.keyWindow!
596+
if let modalVC = window.rootViewController?.presentedViewController {
597+
modalVC.present(activityViewController, animated: true, completion: nil)
598+
} else {
599+
window.rootViewController!.present(activityViewController, animated: true, completion: nil)
600+
}
593601
}))
594602
alert.addAction(UIAlertAction(title: "Delete Theme", style: .destructive, handler: { (_) in
595603
let title = self.customThemes[indexPath.row - 1].title

0 commit comments

Comments
 (0)