This file contains 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 PaddingLabel: UILabel { | |
private let inset: UIEdgeInsets | |
init(inset: UIEdgeInsets = .zero) { | |
self.inset = inset | |
super.init(frame: .zero) | |
} | |
required init?(coder: NSCoder) { | |
fatalError() |
This file contains 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
extension XCUIElement { | |
private func waitForPredicate(object: NSObject, format: String, timeout: TimeInterval) -> Bool { | |
let predicate = NSPredicate(format: format) | |
let expectation = XCTNSPredicateExpectation(predicate: predicate, object: object) | |
let waiter = XCTWaiter() | |
switch waiter.wait(for: [expectation], timeout: timeout) { | |
case .completed: | |
return true | |
default: |
This file contains 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 "ViewController.h" | |
@interface MyClass: NSObject | |
@end | |
@implementation MyClass | |
- (void)dealloc { | |
NSLog(@"MyClass Released!"); | |
[super dealloc]; | |
} |
This file contains 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 | |
final class Debouncer { | |
private var interval: TimeInterval | |
private var timer: Timer? | |
init(interval: TimeInterval) { | |
self.interval = interval | |
} | |