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 LRUCache<T: Hashable, U> { | |
// ... | |
/// Returns the element at the specified key. Nil if it doesn't exist. | |
func retrieveObject(at key: T) -> U? { | |
guard let existingNode = dictionary[key] else { | |
return nil | |
} | |
linkedList.moveToHead(node: existingNode) |
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
let element = UIAccessibilityElement(accessibilityContainer: self) | |
element.accessibilityLabel = [titleLabel.text, subtitleLabel.text].compactmap { $0 }.joined(seperator: ", ") | |
element.accessibilityFrameInContainerSpace = titleLabel.frame.union(subtitleLabel.frame) | |
accessibilityElements = [element, bottomView, button].compactMap { $0 } |
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
let callAction = UIAccessibilityCustomAction( | |
name: "Call", | |
target: self, | |
selector: #selector(callButtonPressed) | |
) | |
let emailAction = UIAccessibilityCustomAction( | |
name: "Send email", | |
target: self, | |
selector: #selector(emailButtonPressed) |
OlderNewer