diff --git a/Amperfy.xcodeproj/project.pbxproj b/Amperfy.xcodeproj/project.pbxproj index d47d3183..5524dba3 100644 --- a/Amperfy.xcodeproj/project.pbxproj +++ b/Amperfy.xcodeproj/project.pbxproj @@ -1247,7 +1247,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.0.2; PRODUCT_BUNDLE_IDENTIFIER = "net.hildebrand-it.amperfy-music"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1274,7 +1274,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.0.2; PRODUCT_BUNDLE_IDENTIFIER = "net.hildebrand-it.amperfy-music"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Amperfy/Common/Utilities.swift b/Amperfy/Common/Utilities.swift index 75b7738f..e1f8187a 100644 --- a/Amperfy/Common/Utilities.swift +++ b/Amperfy/Common/Utilities.swift @@ -213,6 +213,14 @@ extension UIAlertController { } } } + + func setOptionsForIPadToDisplayPopupCentricIn(view: UIView) { + if let popoverController = self.popoverPresentationController { + popoverController.sourceView = view + popoverController.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.midY, width: 0, height: 0) + popoverController.permittedArrowDirections = [] + } + } } extension UISlider { diff --git a/Amperfy/Screens/View/AlbumDetailTableHeader.swift b/Amperfy/Screens/View/AlbumDetailTableHeader.swift index ba93a5bf..1c8c24ca 100644 --- a/Amperfy/Screens/View/AlbumDetailTableHeader.swift +++ b/Amperfy/Screens/View/AlbumDetailTableHeader.swift @@ -28,6 +28,7 @@ class AlbumDetailTableHeader: UIView { @IBAction func optionsButtonPressed(_ sender: Any) { if let album = self.album, let rootView = self.rootView { let alert = createAlert(forAlbum: album) + alert.setOptionsForIPadToDisplayPopupCentricIn(view: rootView.view) rootView.present(alert, animated: true, completion: nil) } } diff --git a/Amperfy/Screens/View/ArtistDetailTableHeader.swift b/Amperfy/Screens/View/ArtistDetailTableHeader.swift index e3d52033..649399fa 100644 --- a/Amperfy/Screens/View/ArtistDetailTableHeader.swift +++ b/Amperfy/Screens/View/ArtistDetailTableHeader.swift @@ -28,6 +28,7 @@ class ArtistDetailTableHeader: UIView { @IBAction func optionsButtonPressed(_ sender: Any) { if let artist = self.artist, let rootView = self.rootView { let alert = createAlert(forArtist: artist) + alert.setOptionsForIPadToDisplayPopupCentricIn(view: rootView.view) rootView.present(alert, animated: true, completion: nil) } } diff --git a/Amperfy/Screens/View/PlaylistDetailTableHeader.swift b/Amperfy/Screens/View/PlaylistDetailTableHeader.swift index 16feb73a..ffe1227e 100644 --- a/Amperfy/Screens/View/PlaylistDetailTableHeader.swift +++ b/Amperfy/Screens/View/PlaylistDetailTableHeader.swift @@ -76,6 +76,7 @@ class PlaylistDetailTableHeader: UIView { @IBAction func optionsButtonPressed(_ sender: Any) { if let playlist = self.playlist, let rootView = self.rootView { let alert = createAlert(forPlaylist: playlist, statusNotifyier: rootView) + alert.setOptionsForIPadToDisplayPopupCentricIn(view: rootView.view) rootView.present(alert, animated: true, completion: nil) } } diff --git a/Amperfy/Screens/View/SongTableCell.swift b/Amperfy/Screens/View/SongTableCell.swift index 41be6e92..073b7ea9 100644 --- a/Amperfy/Screens/View/SongTableCell.swift +++ b/Amperfy/Screens/View/SongTableCell.swift @@ -104,6 +104,7 @@ class SongTableCell: UITableViewCell { generator.impactOccurred() isAlertPresented = true let alert = createAlert(forSong: song, rootView: rootView, displayMode: forceTouchDisplayMode) + alert.setOptionsForIPadToDisplayPopupCentricIn(view: rootView.view) rootView.present(alert, animated: true, completion: nil) } } diff --git a/Amperfy/Screens/ViewController/LatestSongsVC.swift b/Amperfy/Screens/ViewController/LatestSongsVC.swift index 01f0e157..52da512b 100644 --- a/Amperfy/Screens/ViewController/LatestSongsVC.swift +++ b/Amperfy/Screens/ViewController/LatestSongsVC.swift @@ -68,6 +68,7 @@ class LatestSongsVC: UITableViewController { })) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) alert.pruneNegativeWidthConstraintsToAvoidFalseConstraintWarnings() + alert.setOptionsForIPadToDisplayPopupCentricIn(view: self.view) present(alert, animated: true, completion: nil) } diff --git a/Amperfy/Screens/ViewController/PopupPlayerVC.swift b/Amperfy/Screens/ViewController/PopupPlayerVC.swift index 4a92068f..09eaa55b 100644 --- a/Amperfy/Screens/ViewController/PopupPlayerVC.swift +++ b/Amperfy/Screens/ViewController/PopupPlayerVC.swift @@ -92,6 +92,7 @@ class PopupPlayerVC: UIViewController, UITableViewDelegate, UITableViewDataSourc })) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) alert.pruneNegativeWidthConstraintsToAvoidFalseConstraintWarnings() + alert.setOptionsForIPadToDisplayPopupCentricIn(view: self.view) self.present(alert, animated: true, completion: nil) }