mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 17:23:25 +01:00
Fixes tapping buttons underneath navigation bar on SourceDetailViewController/AppViewController
This commit is contained in:
@@ -10,8 +10,22 @@ import UIKit
|
||||
|
||||
import Roxas
|
||||
|
||||
class NavigationBar: UINavigationBar
|
||||
class NavigationBarAppearance: UINavigationBarAppearance
|
||||
{
|
||||
// We sometimes need to ignore user interaction so
|
||||
// we can tap items underneath the navigation bar.
|
||||
var ignoresUserInteraction: Bool = false
|
||||
|
||||
override func copy(with zone: NSZone? = nil) -> Any
|
||||
{
|
||||
let copy = super.copy(with: zone) as! NavigationBarAppearance
|
||||
copy.ignoresUserInteraction = self.ignoresUserInteraction
|
||||
return copy
|
||||
}
|
||||
}
|
||||
|
||||
class NavigationBar: UINavigationBar
|
||||
{
|
||||
@IBInspectable var automaticallyAdjustsItemPositions: Bool = true
|
||||
|
||||
private let backgroundColorView = UIView()
|
||||
@@ -80,4 +94,15 @@ class NavigationBar: UINavigationBar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?
|
||||
{
|
||||
if let appearance = self.topItem?.standardAppearance as? NavigationBarAppearance, appearance.ignoresUserInteraction
|
||||
{
|
||||
// Ignore touches.
|
||||
return nil
|
||||
}
|
||||
|
||||
return super.hitTest(point, with: event)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user