This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TooltipTouchDetectWindow: UIWindow, TouchableNodeWindowType { | |
| public var touchableNodeTable = NSHashTable<AnyTouchableNode>(options: .weakMemory) | |
| override final public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | |
| let touchedView = super.hitTest(point, with: event) | |
| let touchedTooltipNodes = touchableNodeTable.allObjects.lazy.filter { tooltip -> Bool in | |
| tooltip.view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class TooltipBodyView: UIView { | |
| override func didMoveToWindow() { | |
| super.didMoveToWindow() | |
| // 2. | |
| addToTooltipManagementTable() | |
| } | |
| func addToTooltipManagementTable() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TooltipTouchDetectWindow: UIWindow, TouchableNodeWindowType { | |
| // 1. | |
| public var touchableNodeTable = NSHashTable<AnyTouchableNode>(options: .weakMemory) | |
| override final public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | |
| // 3. | |
| let view = super.hitTest(point, with: event) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import PlaygroundSupport | |
| // https://developer.apple.com/design/human-interface-guidelines/ios/controls/edit-menus/ | |
| // https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/UsingCopy,Cut,andPasteOperations/UsingCopy,Cut,andPasteOperations.html#//apple_ref/doc/uid/TP40009542-CH11-SW1 | |
| public final class CopyableView<T: UIView, Value>: UIView { | |
| public override var canBecomeFirstResponder: Bool { | |
| return true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| protocol Styleable { | |
| associatedtype Base: AnyObject | |
| var style: StyleObject<Base> { get } | |
| } | |
| extension Styleable { | |
| public var style: StyleObject<Self> { |