diff --git a/StudApp/Downloads/DownloadListController.swift b/StudApp/Downloads/DownloadListController.swift index c2c9d253..36d93d28 100644 --- a/StudApp/Downloads/DownloadListController.swift +++ b/StudApp/Downloads/DownloadListController.swift @@ -230,7 +230,7 @@ final class DownloadListController: UITableViewController, DataSourceDelegate { present(previewController, animated: true, completion: nil) } - override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { + override func tableView(_ tableView: UITableView, didDeselectRowAt _: IndexPath) { guard tableView.isEditing else { return } updateRemoveButton() } @@ -305,7 +305,7 @@ final class DownloadListController: UITableViewController, DataSourceDelegate { } @IBAction - func removeButtonTapped(_ sender: Any) { + func removeButtonTapped(_: Any) { let controller = UIAlertController(confirmationWithAction: Strings.Actions.remove.localized, barButtonItem: removeButton) { _ in self.tableView.indexPathsForSelectedRows? .compactMap { self.viewModel?[rowAt: $0] } @@ -379,11 +379,11 @@ extension DownloadListController: UIViewControllerPreviewingDelegate, QLPreviewC // MARK: - QuickLook Previewing extension DownloadListController: QLPreviewControllerDataSource { - public func numberOfPreviewItems(in controller: QLPreviewController) -> Int { + public func numberOfPreviewItems(in _: QLPreviewController) -> Int { return viewModel?.numberOfRows ?? 0 } - public func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { + public func previewController(_: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { return viewModel![rowAt: index] } } diff --git a/StudAppSnapshots/SnapshotHelper.swift b/StudAppSnapshots/SnapshotHelper.swift index 28a57ec2..4cb71f96 100644 --- a/StudAppSnapshots/SnapshotHelper.swift +++ b/StudAppSnapshots/SnapshotHelper.swift @@ -163,8 +163,7 @@ open class Snapshot: NSObject { waitForLoadingIndicatorToDisappear(within: timeout) } - // more information about this, check out https://docs.fastlane.tools/actions/snapshot/#how-does-it-work - print("snapshot: \(name)") + print("snapshot: \(name)") // more information about this, check out https://docs.fastlane.tools/actions/snapshot/#how-does-it-work sleep(1) // Waiting for the animation to be finished (kind of) @@ -177,16 +176,9 @@ open class Snapshot: NSObject { return } - guard let window = app.windows.allElementsBoundByIndex.first(where: { $0.frame.isEmpty == false }) else { - print("Couldn't find an element window in XCUIApplication with a non-empty frame.") - return - } - + let window = app.windows.firstMatch let screenshot = window.screenshot() - guard - let simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], - let screenshotsDir = screenshotsDirectory - else { return } + guard let simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return } let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png") do { try screenshot.pngRepresentation.write(to: path) @@ -203,8 +195,7 @@ open class Snapshot: NSObject { #endif let networkLoadingIndicator = XCUIApplication().otherElements.deviceStatusBars.networkLoadingIndicators.element - let networkLoadingIndicatorDisappeared = XCTNSPredicateExpectation( - predicate: NSPredicate(format: "exists == false"), object: networkLoadingIndicator) + let networkLoadingIndicatorDisappeared = XCTNSPredicateExpectation(predicate: NSPredicate(format: "exists == false"), object: networkLoadingIndicator) _ = XCTWaiter.wait(for: [networkLoadingIndicatorDisappeared], timeout: timeout) } @@ -278,7 +269,7 @@ private extension XCUIElementQuery { } var deviceStatusBars: XCUIElementQuery { - let deviceWidth = XCUIApplication().frame.width + let deviceWidth = XCUIApplication().windows.firstMatch.frame.width let isStatusBar = NSPredicate { evaluatedObject, _ in guard let element = evaluatedObject as? XCUIElementAttributes else { return false } @@ -298,4 +289,4 @@ private extension CGFloat { // Please don't remove the lines below // They are used to detect outdated configuration files -// SnapshotHelperVersion [1.10] +// SnapshotHelperVersion [1.12] diff --git a/StudAppSnapshots/StudAppSnapshots.swift b/StudAppSnapshots/StudAppSnapshots.swift index df9395f4..f62010f7 100644 --- a/StudAppSnapshots/StudAppSnapshots.swift +++ b/StudAppSnapshots/StudAppSnapshots.swift @@ -40,8 +40,8 @@ final class StudAppSnapshots: XCTestCase { XCUIDevice.shared.orientation = .landscapeLeft } - app.buttons[MockStrings.Semesters.winter1718.localized(language: deviceLanguage)].tap() - app.buttons[MockStrings.Semesters.summer18.localized(language: deviceLanguage)].tap() + app.buttons[MockStrings.Semesters.winter1819.localized(language: deviceLanguage)].tap() + app.buttons[MockStrings.Semesters.summer19.localized(language: deviceLanguage)].tap() if app.runsOniPad { app.staticTexts[MockStrings.Courses.coding.localized(language: deviceLanguage)].tap() @@ -58,7 +58,7 @@ final class StudAppSnapshots: XCTestCase { XCUIDevice.shared.orientation = .landscapeLeft } - app.buttons[MockStrings.Semesters.summer18.localized(language: deviceLanguage)].tap() + app.buttons[MockStrings.Semesters.summer19.localized(language: deviceLanguage)].tap() app.staticTexts[MockStrings.Courses.coding.localized(language: deviceLanguage)].tap() snapshot("02-Course") diff --git a/StudKit/MockStrings.swift b/StudKit/MockStrings.swift index b6650413..0238c4eb 100644 --- a/StudKit/MockStrings.swift +++ b/StudKit/MockStrings.swift @@ -50,7 +50,7 @@ public enum MockStrings { } public enum Semesters: String, Localizable { - case winter1617, summer17, winter1718, summer18 + case winter1718, summer18, winter1819, summer19 } public enum Users: String, Localizable { diff --git a/StudKit/StudIp/MockResponses.swift b/StudKit/StudIp/MockResponses.swift index 5beb9b0c..59242029 100644 --- a/StudKit/StudIp/MockResponses.swift +++ b/StudKit/StudIp/MockResponses.swift @@ -32,13 +32,13 @@ struct MockResponses { // MARK: - Semesters private(set) lazy var semesters = [ - SemesterResponse(id: "S0", title: MockStrings.Semesters.winter1617.localized, + SemesterResponse(id: "S0", title: MockStrings.Semesters.winter1718.localized, beginsAt: Date(timeIntervalSince1970: 1_475_338_860), endsAt: Date(timeIntervalSince1970: 1_488_388_860)), - SemesterResponse(id: "S1", title: MockStrings.Semesters.summer17.localized, + SemesterResponse(id: "S1", title: MockStrings.Semesters.summer18.localized, beginsAt: Date(timeIntervalSince1970: 1_491_004_800), endsAt: Date(timeIntervalSince1970: 1_504_224_000)), - SemesterResponse(id: "S2", title: MockStrings.Semesters.winter1718.localized, + SemesterResponse(id: "S2", title: MockStrings.Semesters.winter1819.localized, beginsAt: Date(timeIntervalSince1970: 1_504_282_860), endsAt: Date(timeIntervalSince1970: 1_519_924_860)), - SemesterResponse(id: "S3", title: MockStrings.Semesters.summer18.localized, + SemesterResponse(id: "S3", title: MockStrings.Semesters.summer19.localized, beginsAt: Date(timeIntervalSince1970: 1_522_540_800), endsAt: Date(timeIntervalSince1970: 1_535_760_000)), ] diff --git a/StudKit/ViewModels/Files/DownloadListViewModel.swift b/StudKit/ViewModels/Files/DownloadListViewModel.swift index 53086fa6..efeb4fb9 100644 --- a/StudKit/ViewModels/Files/DownloadListViewModel.swift +++ b/StudKit/ViewModels/Files/DownloadListViewModel.swift @@ -19,7 +19,7 @@ import CoreData public final class FetchedDownloadsController: NSFetchedResultsController { - override public func sectionIndexTitle(forSectionName sectionName: String) -> String? { + public override func sectionIndexTitle(forSectionName sectionName: String) -> String? { let name = sectionName .components(separatedBy: "-") .dropFirst() diff --git a/StudKit/de.lproj/Localizable.strings b/StudKit/de.lproj/Localizable.strings index 7e47175c..630641f8 100644 --- a/StudKit/de.lproj/Localizable.strings +++ b/StudKit/de.lproj/Localizable.strings @@ -221,10 +221,10 @@ // MARK: Semesters -"Semesters.winter1617" = "Winter 2016/17"; -"Semesters.summer17" = "Sommer 2017"; "Semesters.winter1718" = "Winter 2017/18"; "Semesters.summer18" = "Sommer 2018"; +"Semesters.winter1819" = "Winter 2018/19"; +"Semesters.summer19" = "Sommer 2019"; // MARK: Users diff --git a/StudKit/en.lproj/Localizable.strings b/StudKit/en.lproj/Localizable.strings index 3ad21a91..b728a167 100644 --- a/StudKit/en.lproj/Localizable.strings +++ b/StudKit/en.lproj/Localizable.strings @@ -221,10 +221,10 @@ // MARK: Semesters -"Semesters.winter1617" = "Winter 2016/17"; -"Semesters.summer17" = "Summer 2017"; "Semesters.winter1718" = "Winter 2017/18"; "Semesters.summer18" = "Summer 2018"; +"Semesters.winter1819" = "Winter 2018/19"; +"Semesters.summer19" = "Summer 2019"; // MARK: Users diff --git a/fastlane/Snapfile b/fastlane/Snapfile index 36d0a9da..a72a9fde 100644 --- a/fastlane/Snapfile +++ b/fastlane/Snapfile @@ -2,7 +2,8 @@ devices([ "iPhone 8", "iPhone 8 Plus", "iPhone SE", - "iPhone X", + "iPhone XS", + "iPhone XS Max", "iPad Pro (12.9-inch)", "iPad Pro (10.5-inch)", "iPad Pro (9.7-inch)"