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
| pod 'EarlGrey' |
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
| app.buttons["nameButton"].tap() | |
| // Bir metin alanına text eklemek de benzer şekildedir: | |
| let textField = app.textFields["Username"] | |
| textField.tap() | |
| textField.typeText("<text to write>") |
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 goLabel = app.staticTexts["Go!"] | |
| let exists = NSPredicate(format: "exists == true") | |
| expectation(for: exists, evaluatedWithObject: goLabel, handler: nil) |
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
| XCTAssert(app.staticTexts["Welcome"].exists) |
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
| imageView.adjustsImageSizeForAccessibilityContentSizeCategory = 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
| networkRequest.fetchData() { [weak self] result in | |
| guard let self = self else { return } | |
| switch result { | |
| case .Succeeded(let data): | |
| self.processData(data) | |
| case .Failed(let err): | |
| self.handleError(err) | |
| } |
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
| DispatchQueue.main.async { [weak self] in | |
| guard let self = self else { | |
| return | |
| } | |
| // Do stuff with self, knowing it is held strongly after the guard statement | |
| } |
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
| var bools = [true, false] | |
| bools[0].toggle() | |
| //bools == [false, false] |
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
| var numbers = [5, 6, 7, 8, 9, 10, 11] | |
| numbers.removeAll(where: { $0 % 2 == 1 }) | |
| // numbers == [6, 8, 10] |
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 names = ["Sofia", "Camilla", "Martina", "Mateo", "Nicolás"] | |
| let allHaveAtLeastFive = names.allSatisfy({ $0.count >= 5 }) | |
| // allHaveAtLeastFive == true |