diff --git a/Display.xcodeproj/project.pbxproj b/Display.xcodeproj/project.pbxproj
index 6ba682acd3..54df2cdfeb 100644
--- a/Display.xcodeproj/project.pbxproj
+++ b/Display.xcodeproj/project.pbxproj
@@ -1404,7 +1404,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
- OTHER_CFLAGS = "-DMINIMAL_ASDK";
+ OTHER_CFLAGS = "-DMINIMAL_ASDK=1";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1446,7 +1446,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_CFLAGS = "-DMINIMAL_ASDK";
+ OTHER_CFLAGS = "-DMINIMAL_ASDK=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
@@ -1572,7 +1572,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
- OTHER_CFLAGS = "-DMINIMAL_ASDK";
+ OTHER_CFLAGS = "-DMINIMAL_ASDK=1";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1652,7 +1652,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_CFLAGS = "-DMINIMAL_ASDK";
+ OTHER_CFLAGS = "-DMINIMAL_ASDK=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
@@ -1732,7 +1732,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_CFLAGS = "-DMINIMAL_ASDK";
+ OTHER_CFLAGS = "-DMINIMAL_ASDK=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
diff --git a/Display.xcodeproj/xcuserdata/peter.xcuserdatad/xcschemes/xcschememanagement.plist b/Display.xcodeproj/xcuserdata/peter.xcuserdatad/xcschemes/xcschememanagement.plist
index 17298f558b..e65b00a6be 100644
--- a/Display.xcodeproj/xcuserdata/peter.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/Display.xcodeproj/xcuserdata/peter.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -12,7 +12,7 @@
DisplayMac.xcscheme
orderHint
- 25
+ 24
DisplayTests.xcscheme
diff --git a/Display/ActionSheetCheckboxItem.swift b/Display/ActionSheetCheckboxItem.swift
index 36a5b2e340..80c89e559b 100644
--- a/Display/ActionSheetCheckboxItem.swift
+++ b/Display/ActionSheetCheckboxItem.swift
@@ -38,8 +38,8 @@ public class ActionSheetCheckboxItemNode: ActionSheetItemNode {
private var item: ActionSheetCheckboxItem?
private let button: HighlightTrackingButton
- private let titleNode: ASTextNode
- private let labelNode: ASTextNode
+ private let titleNode: ImmediateTextNode
+ private let labelNode: ImmediateTextNode
private let checkNode: ASImageNode
override public init(theme: ActionSheetControllerTheme) {
@@ -47,14 +47,13 @@ public class ActionSheetCheckboxItemNode: ActionSheetItemNode {
self.button = HighlightTrackingButton()
- self.titleNode = ASTextNode()
+ self.titleNode = ImmediateTextNode()
self.titleNode.maximumNumberOfLines = 1
self.titleNode.isUserInteractionEnabled = false
self.titleNode.displaysAsynchronously = false
- self.labelNode = ASTextNode()
+ self.labelNode = ImmediateTextNode()
self.labelNode.maximumNumberOfLines = 1
- self.labelNode.truncationMode = .byTruncatingTail
self.labelNode.isUserInteractionEnabled = false
self.labelNode.displaysAsynchronously = false
@@ -115,8 +114,8 @@ public class ActionSheetCheckboxItemNode: ActionSheetItemNode {
self.button.frame = CGRect(origin: CGPoint(), size: size)
- let labelSize = self.labelNode.measure(CGSize(width: size.width - 44.0 - 15.0 - 8.0, height: size.height))
- let titleSize = self.titleNode.measure(CGSize(width: size.width - 44.0 - labelSize.width - 15.0 - 8.0, height: size.height))
+ let labelSize = self.labelNode.updateLayout(CGSize(width: size.width - 44.0 - 15.0 - 8.0, height: size.height))
+ let titleSize = self.titleNode.updateLayout(CGSize(width: size.width - 44.0 - labelSize.width - 15.0 - 8.0, height: size.height))
self.titleNode.frame = CGRect(origin: CGPoint(x: 44.0, y: floorToScreenPixels((size.height - titleSize.height) / 2.0)), size: titleSize)
self.labelNode.frame = CGRect(origin: CGPoint(x: size.width - 15.0 - labelSize.width, y: floorToScreenPixels((size.height - labelSize.height) / 2.0)), size: labelSize)
diff --git a/Display/GridNode.swift b/Display/GridNode.swift
index 2dab6c4d8b..cc3c7c9b37 100644
--- a/Display/GridNode.swift
+++ b/Display/GridNode.swift
@@ -588,7 +588,7 @@ open class GridNode: GridNodeScroller, UIScrollViewDelegate {
}
if scrollToItem.adjustForTopInset {
- additionalOffset += -gridLayout.insets.top + self.initialOffset
+ additionalOffset += -gridLayout.insets.top// + self.initialOffset
}
} else if scrollToItem.adjustForTopInset {
additionalOffset = -gridLayout.insets.top
@@ -712,7 +712,7 @@ open class GridNode: GridNodeScroller, UIScrollViewDelegate {
var lowestHeaderNode: ASDisplayNode?
var lowestHeaderNodeIndex: Int?
for (_, headerNode) in self.sectionNodes {
- if let index = self.subnodes.index(of: headerNode) {
+ if let index = self.subnodes?.index(of: headerNode) {
if lowestHeaderNodeIndex == nil || index < lowestHeaderNodeIndex! {
lowestHeaderNodeIndex = index
lowestHeaderNode = headerNode
@@ -1039,7 +1039,7 @@ open class GridNode: GridNodeScroller, UIScrollViewDelegate {
var topVisible: (Int, GridItem) = (topIndex, self.items[topIndex])
let bottomVisible: (Int, GridItem) = (bottomIndex, self.items[bottomIndex])
- let lowerDisplayBound = presentationLayoutTransition.layout.contentOffset.y
+ let lowerDisplayBound = presentationLayoutTransition.layout.contentOffset.y + presentationLayoutTransition.layout.layout.insets.top
//let upperDisplayBound = presentationLayoutTransition.layout.contentOffset.y + self.gridLayout.size.height
for item in presentationLayoutTransition.layout.items {
diff --git a/Display/ListView.swift b/Display/ListView.swift
index 33cef91732..bd5063b751 100644
--- a/Display/ListView.swift
+++ b/Display/ListView.swift
@@ -61,7 +61,7 @@ final class ListViewBackingView: UIView {
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
- if let target = target, target.limitHitTestToNodes {
+ if let target = self.target, target.limitHitTestToNodes {
if !target.internalHitTest(point, with: event) {
return nil
}
@@ -1695,7 +1695,7 @@ open class ListView: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDel
if let _ = previousFrame, animated && node.index != nil && nodeIndex != self.itemNodes.count - 1 {
let nextNode = self.itemNodes[nodeIndex + 1]
- if nextNode.index == nil && nextNode.subnodes.isEmpty {
+ if nextNode.index == nil && nextNode.subnodes == nil || nextNode.subnodes!.isEmpty {
let nextHeight = nextNode.apparentHeight
if abs(nextHeight - previousApparentHeight) < CGFloat.ulpOfOne {
if let animation = nextNode.animationForKey("apparentHeight") {
@@ -1836,7 +1836,7 @@ open class ListView: ASDisplayNode, UIScrollViewDelegate, UIGestureRecognizerDel
var lowestHeaderNode: ASDisplayNode?
var lowestHeaderNodeIndex: Int?
for (_, headerNode) in self.itemHeaderNodes {
- if let index = self.subnodes.index(of: headerNode) {
+ if let index = self.subnodes?.index(of: headerNode) {
if lowestHeaderNodeIndex == nil || index < lowestHeaderNodeIndex! {
lowestHeaderNodeIndex = index
lowestHeaderNode = headerNode
diff --git a/Display/NavigationBarBadge.swift b/Display/NavigationBarBadge.swift
index eb5c6e4849..d55b1c7924 100644
--- a/Display/NavigationBarBadge.swift
+++ b/Display/NavigationBarBadge.swift
@@ -52,13 +52,7 @@ final class NavigationBarBadgeNode: ASDisplayNode {
let backgroundSize = CGSize(width: max(18.0, badgeSize.width + 10.0 + 1.0), height: 18.0)
let backgroundFrame = CGRect(origin: CGPoint(), size: backgroundSize)
self.backgroundNode.frame = backgroundFrame
- let textOffset: CGFloat
- if UIScreenPixel.isLessThanOrEqualTo(1.0 / 3.0) {
- textOffset = UIScreenPixel * 2.0
- } else {
- textOffset = UIScreenPixel
- }
- self.textNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels(backgroundFrame.midX - badgeSize.width / 2.0), y: floorToScreenPixels((backgroundFrame.size.height - badgeSize.height) / 2.0) + textOffset), size: badgeSize)
+ self.textNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels(backgroundFrame.midX - badgeSize.width / 2.0), y: floorToScreenPixels((backgroundFrame.size.height - badgeSize.height) / 2.0)), size: badgeSize)
return backgroundSize
}
diff --git a/Display/NavigationButtonNode.swift b/Display/NavigationButtonNode.swift
index 7bda908127..b6a74ce8b6 100644
--- a/Display/NavigationButtonNode.swift
+++ b/Display/NavigationButtonNode.swift
@@ -120,14 +120,16 @@ private final class NavigationButtonItemNode: ASTextNode {
self.displaysAsynchronously = false
}
- override public func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
+ func updateLayout(_ constrainedSize: CGSize) -> CGSize {
let superSize = super.calculateSizeThatFits(constrainedSize)
if let node = self.node {
let nodeSize = node.measure(constrainedSize)
- return CGSize(width: max(nodeSize.width, superSize.width), height: max(nodeSize.height, superSize.height))
+ let size = CGSize(width: max(nodeSize.width, superSize.width), height: max(nodeSize.height, superSize.height))
+ node.frame = CGRect(origin: CGPoint(), size: nodeSize)
+ return size
} else if let imageNode = self.imageNode {
- let nodeSize = imageNode.measure(constrainedSize)
+ let nodeSize = imageNode.image?.size ?? CGSize()
let size = CGSize(width: max(nodeSize.width, superSize.width), height: max(nodeSize.height, superSize.height))
imageNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - nodeSize.width) / 2.0) + 5.0, y: floorToScreenPixels((size.height - nodeSize.height) / 2.0)), size: nodeSize)
return size
@@ -135,14 +137,6 @@ private final class NavigationButtonItemNode: ASTextNode {
return superSize
}
- override public func layout() {
- super.layout()
-
- if let node = self.node {
- node.frame = CGRect(origin: CGPoint(), size: node.calculatedSize)
- }
- }
-
private func touchInsideApparentBounds(_ touch: UITouch) -> Bool {
var apparentBounds = self.bounds
let hitTestSlop = self.hitTestSlop
@@ -330,7 +324,7 @@ final class NavigationButtonNode: ASDisplayNode {
totalSize.width += 16.0
nodeOrigin.x += 16.0
}
- var nodeSize = node.calculateSizeThatFits(constrainedSize)
+ var nodeSize = node.updateLayout(constrainedSize)
nodeSize.width = ceil(nodeSize.width)
nodeSize.height = ceil(nodeSize.height)
totalSize.width += nodeSize.width
diff --git a/Display/PeekControllerGestureRecognizer.swift b/Display/PeekControllerGestureRecognizer.swift
index ba8c9bf4ce..7dcce11f9b 100644
--- a/Display/PeekControllerGestureRecognizer.swift
+++ b/Display/PeekControllerGestureRecognizer.swift
@@ -127,9 +127,13 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
override public func touchesEnded(_ touches: Set, with event: UIEvent) {
super.touchesEnded(touches, with: event)
- if self.activateBySingleTap, self.candidateContent != nil, self.presentedController == nil {
- self.longTapTimerFired()
- self.pressTimerFired()
+ if self.activateBySingleTap, self.presentedController == nil {
+ self.longTapTimer?.invalidate()
+ self.pressTimer?.invalidate()
+ if let tapLocation = self.tapLocation {
+ self.checkCandidateContent(at: tapLocation, forceActivate: true)
+ }
+ self.state = .ended
} else {
let velocity = self.velocity(in: self.view)
@@ -184,7 +188,10 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
(presentedController.displayNode as? PeekControllerNode)?.activateMenu()
self.menuActivation = nil
self.presentedController = nil
+ self.candidateContent = nil
self.state = .ended
+ self.candidateContentDisposable.set(nil)
+ return
}
}
}
@@ -216,30 +223,50 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
}
}
- private func checkCandidateContent(at touchLocation: CGPoint) {
+ private func checkCandidateContent(at touchLocation: CGPoint, forceActivate: Bool = false) {
+ //print("check begin")
if let contentSignal = self.contentAtPoint(touchLocation) {
- self.candidateContentDisposable.set((contentSignal |> deliverOnMainQueue).start(next: { [weak self] result in
+ self.candidateContentDisposable.set((contentSignal
+ |> deliverOnMainQueue).start(next: { [weak self] result in
if let strongSelf = self {
- switch strongSelf.state {
- case .possible, .changed:
- if let (sourceNode, content) = result {
- if let currentContent = strongSelf.candidateContent {
- if !currentContent.1.isEqual(to: content) {
- strongSelf.tapLocation = touchLocation
- strongSelf.candidateContent = (sourceNode, content)
- strongSelf.menuActivation = content.menuActivation()
- if let presentedController = strongSelf.presentedController, presentedController.isNodeLoaded {
- presentedController.sourceNode = {
- return sourceNode
- }
- (presentedController.displayNode as? PeekControllerNode)?.updateContent(content: content)
+ let processResult: Bool
+ if forceActivate {
+ processResult = true
+ } else {
+ switch strongSelf.state {
+ case .possible, .changed:
+ processResult = true
+ default:
+ processResult = false
+ }
+ }
+ //print("check received, will process: \(processResult), force: \(forceActivate), state: \(strongSelf.state)")
+ if processResult {
+ if let (sourceNode, content) = result {
+ if let currentContent = strongSelf.candidateContent {
+ if !currentContent.1.isEqual(to: content) {
+ strongSelf.tapLocation = touchLocation
+ strongSelf.candidateContent = (sourceNode, content)
+ strongSelf.menuActivation = content.menuActivation()
+ if let presentedController = strongSelf.presentedController, presentedController.isNodeLoaded {
+ presentedController.sourceNode = {
+ return sourceNode
}
+ (presentedController.displayNode as? PeekControllerNode)?.updateContent(content: content)
}
- } else {
- if let presentedController = strongSelf.present(content, sourceNode) {
+ }
+ } else {
+ if let presentedController = strongSelf.present(content, sourceNode) {
+ if forceActivate {
+ strongSelf.candidateContent = nil
+ if case .press = content.menuActivation() {
+ (presentedController.displayNode as? PeekControllerNode)?.activateMenu()
+ }
+ } else {
strongSelf.candidateContent = (sourceNode, content)
strongSelf.menuActivation = content.menuActivation()
strongSelf.presentedController = presentedController
+
strongSelf.state = .began
switch content.menuActivation() {
@@ -256,11 +283,12 @@ public final class PeekControllerGestureRecognizer: UIPanGestureRecognizer {
}
}
}
- } else if strongSelf.presentedController == nil {
+ }
+ } else if strongSelf.presentedController == nil {
+ if strongSelf.state != .possible && strongSelf.state != .ended {
strongSelf.state = .failed
}
- default:
- break
+ }
}
}
}))
diff --git a/Display/TabBarController.swift b/Display/TabBarController.swift
index 439722e0cb..d3770e25c8 100644
--- a/Display/TabBarController.swift
+++ b/Display/TabBarController.swift
@@ -34,7 +34,7 @@ open class TabBarController: ViewController {
}
}
- private var controllers: [ViewController] = []
+ public private(set) var controllers: [ViewController] = []
private var _selectedIndex: Int?
public var selectedIndex: Int {
@@ -50,10 +50,6 @@ open class TabBarController: ViewController {
_selectedIndex = index
self.updateSelectedIndex()
- } else {
- if let controller = self.currentController {
- controller.scrollToTopWithTabBar?()
- }
}
}
}
@@ -116,7 +112,13 @@ open class TabBarController: ViewController {
}
strongSelf.pendingControllerDisposable.set((strongSelf.controllers[index].ready.get() |> deliverOnMainQueue).start(next: { _ in
if let strongSelf = self {
- strongSelf.selectedIndex = index
+ if strongSelf.selectedIndex == index {
+ if let controller = strongSelf.currentController {
+ controller.scrollToTopWithTabBar?()
+ }
+ } else {
+ strongSelf.selectedIndex = index
+ }
}
}))
}
diff --git a/Display/TextAlertController.swift b/Display/TextAlertController.swift
index 7664f9df26..bd456c204a 100644
--- a/Display/TextAlertController.swift
+++ b/Display/TextAlertController.swift
@@ -35,7 +35,7 @@ private final class TextAlertContentActionNode: HighlightableButtonNode {
super.init()
self.titleNode.maximumNumberOfLines = 2
- let font = Font.regular(17.0)
+ var font = Font.regular(17.0)
var color = theme.accentColor
switch action.type {
case .defaultAction, .genericAction:
@@ -43,6 +43,12 @@ private final class TextAlertContentActionNode: HighlightableButtonNode {
case .destructiveAction:
color = theme.destructiveColor
}
+ switch action.type {
+ case .defaultAction:
+ font = Font.semibold(17.0)
+ case .destructiveAction, .genericAction:
+ break
+ }
self.setAttributedTitle(NSAttributedString(string: action.title, font: font, textColor: color, paragraphAlignment: .center), for: [])
self.highligthedChanged = { [weak self] value in
diff --git a/Display/TextNode.swift b/Display/TextNode.swift
index fed6925ed3..a3d0a260fd 100644
--- a/Display/TextNode.swift
+++ b/Display/TextNode.swift
@@ -479,6 +479,9 @@ public class TextNode: ASDisplayNode {
return (layout, {
node.cachedLayout = layout
if updated {
+ if layout.size.width.isZero && layout.size.height.isZero {
+ node.contents = nil
+ }
node.setNeedsDisplay()
}
diff --git a/Display/VolumeControlStatusBar.swift b/Display/VolumeControlStatusBar.swift
index 923bd6ed2f..c7cdea2f5f 100644
--- a/Display/VolumeControlStatusBar.swift
+++ b/Display/VolumeControlStatusBar.swift
@@ -15,6 +15,7 @@ final class VolumeControlStatusBar: UIView {
var valueChanged: ((Float, Float) -> Void)?
private var disposable: Disposable?
+ private var ignoreAdjustmentOnce = false
init(frame: CGRect, shouldBeVisible: Signal) {
self.control = MPVolumeView(frame: CGRect(origin: CGPoint(), size: CGSize(width: 100.0, height: 20.0)))
@@ -24,12 +25,22 @@ final class VolumeControlStatusBar: UIView {
self.addSubview(self.control)
self.observer = NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: volumeNotificationKey), object: nil, queue: OperationQueue.main, using: { [weak self] notification in
- if let strongSelf = self {
- if let volume = notification.userInfo?[volumeParameterKey] as? Float {
+ if let strongSelf = self, let userInfo = notification.userInfo {
+ /*guard let category = userInfo["AVSystemController_AudioCategoryNotificationParameter"] as? String else {
+ return
+ }*/
+
+ if let volume = userInfo[volumeParameterKey] as? Float {
let previous = strongSelf.currentValue
- strongSelf.currentValue = volume
- if strongSelf.control.superview != nil {
- strongSelf.valueChanged?(previous, volume)
+ if !previous.isEqual(to: volume) {
+ strongSelf.currentValue = volume
+ if strongSelf.ignoreAdjustmentOnce {
+ strongSelf.ignoreAdjustmentOnce = false
+ } else {
+ if strongSelf.control.superview != nil {
+ strongSelf.valueChanged?(previous, volume)
+ }
+ }
}
}
}
@@ -42,10 +53,12 @@ final class VolumeControlStatusBar: UIView {
}
if value {
if strongSelf.control.superview == nil {
+ strongSelf.ignoreAdjustmentOnce = true
strongSelf.addSubview(strongSelf.control)
}
} else {
strongSelf.control.removeFromSuperview()
+ strongSelf.ignoreAdjustmentOnce = false
}
})
}
diff --git a/Display/WindowContent.swift b/Display/WindowContent.swift
index 7b03ce1768..d22af96f4f 100644
--- a/Display/WindowContent.swift
+++ b/Display/WindowContent.swift
@@ -154,7 +154,7 @@ private func encodeText(_ string: String, _ key: Int) -> String {
return result
}
-private func doesViewTreeDisableInteractiveTransitionGestureRecognizer(_ view: UIView) -> Bool {
+public func doesViewTreeDisableInteractiveTransitionGestureRecognizer(_ view: UIView) -> Bool {
if view.disablesInteractiveTransitionGestureRecognizer {
return true
}
@@ -204,7 +204,7 @@ private func applyThemeToPreviewingEffectView(_ view: UIView) {
}
}
-private func getFirstResponderAndAccessoryHeight(_ view: UIView, _ accessoryHeight: CGFloat? = nil) -> (UIView?, CGFloat?) {
+public func getFirstResponderAndAccessoryHeight(_ view: UIView, _ accessoryHeight: CGFloat? = nil) -> (UIView?, CGFloat?) {
if view.isFirstResponder {
return (view, accessoryHeight)
} else {
@@ -283,12 +283,12 @@ private func safeInsetsForScreenSize(_ size: CGSize) -> UIEdgeInsets {
return UIEdgeInsets()
}
-private final class KeyboardGestureRecognizerDelegate: NSObject, UIGestureRecognizerDelegate {
- func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+public final class WindowKeyboardGestureRecognizerDelegate: NSObject, UIGestureRecognizerDelegate {
+ public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
- func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+ public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return false
}
}
@@ -330,7 +330,7 @@ public class Window1 {
}
private var windowPanRecognizer: WindowPanRecognizer?
- private let keyboardGestureRecognizerDelegate = KeyboardGestureRecognizerDelegate()
+ private let keyboardGestureRecognizerDelegate = WindowKeyboardGestureRecognizerDelegate()
private var keyboardGestureBeginLocation: CGPoint?
private var keyboardGestureAccessoryHeight: CGFloat?
diff --git a/Display/WindowPanRecognizer.swift b/Display/WindowPanRecognizer.swift
index 85efc21149..7d92acd37a 100644
--- a/Display/WindowPanRecognizer.swift
+++ b/Display/WindowPanRecognizer.swift
@@ -1,13 +1,13 @@
import Foundation
-final class WindowPanRecognizer: UIGestureRecognizer {
- var began: ((CGPoint) -> Void)?
- var moved: ((CGPoint) -> Void)?
- var ended: ((CGPoint, CGPoint?) -> Void)?
+public final class WindowPanRecognizer: UIGestureRecognizer {
+ public var began: ((CGPoint) -> Void)?
+ public var moved: ((CGPoint) -> Void)?
+ public var ended: ((CGPoint, CGPoint?) -> Void)?
private var previousPoints: [(CGPoint, Double)] = []
- override func reset() {
+ override public func reset() {
super.reset()
self.previousPoints.removeAll()
@@ -40,7 +40,7 @@ final class WindowPanRecognizer: UIGestureRecognizer {
}
}
- override func touchesBegan(_ touches: Set, with event: UIEvent) {
+ override public func touchesBegan(_ touches: Set, with event: UIEvent) {
super.touchesBegan(touches, with: event)
if let touch = touches.first {
@@ -50,7 +50,7 @@ final class WindowPanRecognizer: UIGestureRecognizer {
}
}
- override func touchesMoved(_ touches: Set, with event: UIEvent) {
+ override public func touchesMoved(_ touches: Set, with event: UIEvent) {
super.touchesMoved(touches, with: event)
if let touch = touches.first {
@@ -60,7 +60,7 @@ final class WindowPanRecognizer: UIGestureRecognizer {
}
}
- override func touchesEnded(_ touches: Set, with event: UIEvent) {
+ override public func touchesEnded(_ touches: Set, with event: UIEvent) {
super.touchesEnded(touches, with: event)
if let touch = touches.first {
@@ -70,7 +70,7 @@ final class WindowPanRecognizer: UIGestureRecognizer {
}
}
- override func touchesCancelled(_ touches: Set, with event: UIEvent) {
+ override public func touchesCancelled(_ touches: Set, with event: UIEvent) {
super.touchesCancelled(touches, with: event)
if let touch = touches.first {