From 298bead557f4a1a6d9aa9d8a280fcd97923de704 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 21:57:03 +0200 Subject: [PATCH 01/12] chore: update dependencies of example app --- Example/Podfile | 2 +- Example/Podfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index a24d42b..ad16584 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -7,7 +7,7 @@ target 'Example-iOS' do use_frameworks! sharedPods - pod 'SheetyColors' + pod 'SheetyColors', '1.0.0' pod 'AppCenter/Analytics', '1.14.0' pod 'Fabric' pod 'Answers' diff --git a/Example/Podfile.lock b/Example/Podfile.lock index fb37e6c..6d66528 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -62,7 +62,7 @@ PODS: - nanopb/encode (= 0.3.901) - nanopb/decode (0.3.901) - nanopb/encode (0.3.901) - - SheetyColors (0.3.1): + - SheetyColors (1.0.0): - Capable/Colors (~> 1.0.0) DEPENDENCIES: @@ -71,7 +71,7 @@ DEPENDENCIES: - Capable (from `../`) - Fabric - Firebase/Core - - SheetyColors + - SheetyColors (= 1.0.0) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -94,7 +94,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Answers: e7317ccd30e7bf55c3bacfe28adbe2304b082e49 AppCenter: 02c5efe08d3bbab5421ae41d5f7aa7238906b817 - Capable: f102b9cb3167470fac31d07d175b95ecb4f9ca9a + Capable: 49d8637d06ee50dac258757071ea27cbce0e1bf6 Fabric: d2b22f443ba195d8a7cc204da230977c72733b40 Firebase: 8d77bb33624ae9b62d745d82ec023de5f70f7e4f FirebaseAnalytics: 629301c2b9925f3537d4093a17a72751ae5b7084 @@ -103,8 +103,8 @@ SPEC CHECKSUMS: GoogleAppMeasurement: 51d8d9ea48f0ca44484d29cfbdef976fbd4fc336 GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 - SheetyColors: 71fc251618928f399503138093229e3ea700b35f + SheetyColors: dbf4b6b427d10f0316a2237b8a00cd8d576466dd -PODFILE CHECKSUM: b6b60cbce08e7b88bb2acc2c5dee948795b58baf +PODFILE CHECKSUM: 5dbd3f14150c8d61f0a07bd9d65f8e2e2ba37daf -COCOAPODS: 1.6.0.rc.2 +COCOAPODS: 1.7.5 From d3f1fc332b76443e972bd18544a1839160faa4b6 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 21:57:26 +0200 Subject: [PATCH 02/12] feature: support darkmode inside example app --- Example/Source/iOS/Base.lproj/Main.storyboard | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/Example/Source/iOS/Base.lproj/Main.storyboard b/Example/Source/iOS/Base.lproj/Main.storyboard index 2b01819..22e05bd 100644 --- a/Example/Source/iOS/Base.lproj/Main.storyboard +++ b/Example/Source/iOS/Base.lproj/Main.storyboard @@ -1,11 +1,9 @@ - - - - + + - + @@ -36,7 +34,7 @@ - + @@ -57,21 +55,21 @@ - + - + - + From 8ecf4bb7689457cddaba62f3b5a00af2fd59f109 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 21:58:20 +0200 Subject: [PATCH 03/12] feature: add new accessibility settings --- Source/Features/Models/CapableFeature.swift | 12 ++++-- .../Notifications/Notifications.swift | 27 ++++++++++++ .../Statuses/FeatureStatusesProvider.swift | 43 ++++++++++++++++--- .../FeatureStatusesProviderProtocol.swift | 4 +- 4 files changed, 76 insertions(+), 10 deletions(-) diff --git a/Source/Features/Models/CapableFeature.swift b/Source/Features/Models/CapableFeature.swift index 8ef1404..a470534 100644 --- a/Source/Features/Models/CapableFeature.swift +++ b/Source/Features/Models/CapableFeature.swift @@ -35,9 +35,6 @@ public enum CapableFeature: String, CaseIterable { #if os(OSX) - /// Helps color blind users to differentiate settings differently, e.g. by using shapes rather than colors. - case differentiateWithoutColor - /// Enables users to navigate through items of the screen without having to use a mouse. case fullKeyboardAccess @@ -56,6 +53,12 @@ public enum CapableFeature: String, CaseIterable { /// Merges stereo audio channels to help users that are hard of hearing or deaf in one ear. case monoAudio + + /// Displays on/off labels for UISwitch controls. + case onOffSwitchLabels + + /// Allows users who are sensitive to motion to disable automatic video playback. + case videoAutoplay #endif @@ -68,6 +71,9 @@ public enum CapableFeature: String, CaseIterable { #if os(iOS) || os(tvOS) || os(OSX) + /// Helps color blind users to differentiate settings differently, e.g. by using shapes rather than colors. + case differentiateWithoutColor + /// Helps people with low vision, color blindness, or sensitivity to brightness to read the display content. case invertColors diff --git a/Source/Features/Notifications/Notifications.swift b/Source/Features/Notifications/Notifications.swift index f4ea554..6a5abd3 100644 --- a/Source/Features/Notifications/Notifications.swift +++ b/Source/Features/Notifications/Notifications.swift @@ -98,6 +98,11 @@ extension Notifications { if features.contains(.closedCaptioning) { addObserver(forNotification: UIAccessibility.closedCaptioningStatusDidChangeNotification, selector: #selector(self.closedCaptioningStatusChanged)) } + if features.contains(.differentiateWithoutColor) { + if #available(iOS 13.0, tvOS 13.0, *) { + addObserver(forNotification: NSNotification.Name(rawValue: UIAccessibility.differentiateWithoutColorDidChangeNotification), selector: #selector(self.differentiateWithoutColorStatusChanged)) + } + } if features.contains(.grayscale) { addObserver(forNotification: UIAccessibility.grayscaleStatusDidChangeNotification, selector: #selector(self.grayscaleStatusChanged)) } @@ -107,6 +112,11 @@ extension Notifications { if features.contains(.monoAudio) { addObserver(forNotification: UIAccessibility.monoAudioStatusDidChangeNotification, selector: #selector(self.monoAudioStatusChanged)) } + if features.contains(.onOffSwitchLabels) { + if #available(iOS 13.0, tvOS 13.0, *) { + addObserver(forNotification: UIAccessibility.onOffSwitchLabelsDidChangeNotification, selector: #selector(self.onOffSwitchLabelsStatusChanged)) + } + } if features.contains(.switchControl) { addObserver(forNotification: UIAccessibility.switchControlStatusDidChangeNotification, selector: #selector(self.switchControlStatusChanged)) } @@ -116,6 +126,11 @@ extension Notifications { if features.contains(.reduceTransparency) { addObserver(forNotification: UIAccessibility.reduceTransparencyStatusDidChangeNotification, selector: #selector(self.reduceTransparencyStatusChanged)) } + if features.contains(.videoAutoplay) { + if #available(iOS 13.0, tvOS 13.0, *) { + addObserver(forNotification: UIAccessibility.videoAutoplayStatusDidChangeNotification, selector: #selector(self.videoAutoplayStatusChanged)) + } + } if features.contains(.voiceOver) { if #available(iOS 11.0, tvOS 11.0, *) { addObserver(forNotification: UIAccessibility.voiceOverStatusDidChangeNotification, selector: #selector(self.voiceOverStatusChanged)) @@ -232,6 +247,10 @@ extension Notifications { @objc func closedCaptioningStatusChanged() { self.postNotification(withFeature: .closedCaptioning, statusString: self.featureStatusesProvider.isClosedCaptioningEnabled.statusString) } + + @objc func differentiateWithoutColorStatusChanged() { + self.postNotification(withFeature: .differentiateWithoutColor, statusString: self.featureStatusesProvider.isDifferentiateWithoutColorEnabled.statusString) + } @objc func grayscaleStatusChanged() { self.postNotification(withFeature: .grayscale, statusString: self.featureStatusesProvider.isGrayscaleEnabled.statusString) @@ -245,9 +264,17 @@ extension Notifications { self.postNotification(withFeature: .monoAudio, statusString: self.featureStatusesProvider.isMonoAudioEnabled.statusString) } + @objc func onOffSwitchLabelsStatusChanged() { + self.postNotification(withFeature: .onOffSwitchLabels, statusString: self.featureStatusesProvider.isOnOffSwitchLabelsEnabled.statusString) + } + @objc func reduceTransparencyStatusChanged() { self.postNotification(withFeature: .reduceTransparency, statusString: self.featureStatusesProvider.isReduceTransparencyEnabled.statusString) } + + @objc func videoAutoplayStatusChanged() { + self.postNotification(withFeature: .videoAutoplay, statusString: self.featureStatusesProvider.isVideoAutoplayEnabled.statusString) + } #endif diff --git a/Source/Features/Statuses/FeatureStatusesProvider.swift b/Source/Features/Statuses/FeatureStatusesProvider.swift index d3748aa..1b007bf 100644 --- a/Source/Features/Statuses/FeatureStatusesProvider.swift +++ b/Source/Features/Statuses/FeatureStatusesProvider.swift @@ -56,7 +56,7 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { #endif #if os(iOS) || os(tvOS) - + var isBoldTextEnabled: Bool { return UIAccessibility.isBoldTextEnabled } @@ -65,6 +65,15 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return UIAccessibility.isClosedCaptioningEnabled } + var isDifferentiateWithoutColorEnabled: Bool { + if #available(iOS 13.0, tvOS 13.0, *) { + return UIAccessibility.shouldDifferentiateWithoutColor + } else { + Logger.warning("Unable to determine status for isDifferentiateWithoutColorEnabled since it is only available on iOS 13 / tvOS 13 or later.") + return false + } + } + var isGrayscaleEnabled: Bool { return UIAccessibility.isGrayscaleEnabled } @@ -76,6 +85,15 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { var isMonoAudioEnabled: Bool { return UIAccessibility.isMonoAudioEnabled } + + var isOnOffSwitchLabelsEnabled: Bool { + if #available(iOS 13.0, tvOS 13.0, *) { + return UIAccessibility.isOnOffSwitchLabelsEnabled + } else { + Logger.warning("Unable to determine status for isOnOffSwitchLabelsEnabled since it is only available on iOS 13 / tvOS 13 or later.") + return false + } + } var isReduceMotionEnabled: Bool { return UIAccessibility.isReduceMotionEnabled @@ -89,6 +107,15 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return UIAccessibility.isSwitchControlRunning } + var isVideoAutoplayEnabled: Bool { + if #available(iOS 13.0, tvOS 13.0, *) { + return UIAccessibility.isVideoAutoplayEnabled + } else { + Logger.warning("Unable to determine status for isVideoAutoplayEnabled since it is only available on iOS 13 / tvOS 13 or later.") + return false + } + } + var isVoiceOverEnabled: Bool { return UIAccessibility.isVoiceOverRunning } @@ -211,9 +238,6 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { #if os(OSX) - if feature == .differentiateWithoutColor { - return self.isDifferentiateWithoutColorEnabled - } if feature == .fullKeyboardAccess { return self.isFullKeyboardAccessEnabled } @@ -234,19 +258,26 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { if feature == .monoAudio { return self.isMonoAudioEnabled } + if feature == .onOffSwitchLabels { + return self.isOnOffSwitchLabelsEnabled + } + if feature == .videoAutoplay { + return self.isVideoAutoplayEnabled + } #endif #if os(iOS) || os(tvOS) || os(macOS) + if feature == .differentiateWithoutColor { + return self.isDifferentiateWithoutColorEnabled + } if feature == .invertColors { return self.isInvertColorsEnabled } - if feature == .reduceTransparency { return self.isReduceTransparencyEnabled } - if feature == .switchControl { return self.isSwitchControlEnabled } diff --git a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift index 732ecb9..cc405e8 100644 --- a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift +++ b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift @@ -26,6 +26,8 @@ protocol FeatureStatusesProviderProtocol { var isClosedCaptioningEnabled: Bool { get } var isGrayscaleEnabled: Bool { get } var isMonoAudioEnabled: Bool { get } + var isOnOffSwitchLabelsEnabled: Bool { get } + var isVideoAutoplayEnabled: Bool { get } #endif #if os(iOS) || os(tvOS) || os(watchOS) @@ -33,13 +35,13 @@ protocol FeatureStatusesProviderProtocol { #endif #if os(iOS) || os(tvOS) || os(OSX) + var isDifferentiateWithoutColorEnabled: Bool { get } var isInvertColorsEnabled: Bool { get } var isReduceTransparencyEnabled: Bool { get } var isSwitchControlEnabled: Bool { get } #endif #if os(OSX) - var isDifferentiateWithoutColorEnabled: Bool { get } var isFullKeyboardAccessEnabled: Bool { get } var isIncreaseContrastEnabled: Bool { get } #endif From ecc47176fbfb00cfbed8d12ee22e9bec5171a23e Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 21:58:42 +0200 Subject: [PATCH 04/12] tests: verify functioning of new APIs --- .../Features/FeatureNotificationsTests.swift | 33 +++++++++++++++ .../FeatureStatusesProviderTests.swift | 40 ++++++++++++++----- .../Mocks/FeatureStatusesProviderMock.swift | 24 ++++++++--- 3 files changed, 81 insertions(+), 16 deletions(-) diff --git a/Tests/Features/FeatureNotificationsTests.swift b/Tests/Features/FeatureNotificationsTests.swift index af3d9da..bd09e0c 100644 --- a/Tests/Features/FeatureNotificationsTests.swift +++ b/Tests/Features/FeatureNotificationsTests.swift @@ -280,6 +280,17 @@ class FeatureNotificationsTests: QuickSpec { } } + context("when DifferentiateWithoutColor was activated by the user") { + beforeEach { + featureStatusesProviderMock!.differentiateWithoutColor = true + sut!.differentiateWithoutColorStatusChanged() + } + + it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { + verifyFeatureDidChangeNotificationWasPosted(withFeature: .differentiateWithoutColor, statusString: "enabled") + } + } + context("when Grayscale was activated by the user") { beforeEach { featureStatusesProviderMock!.grayscaleEnabled = true @@ -313,6 +324,17 @@ class FeatureNotificationsTests: QuickSpec { } } + context("when OnOffSwitchLabels was activated by the user") { + beforeEach { + featureStatusesProviderMock!.onOffSwitchLabelsEnabled = true + sut!.onOffSwitchLabelsStatusChanged() + } + + it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { + verifyFeatureDidChangeNotificationWasPosted(withFeature: .videoAutoplay, statusString: "enabled") + } + } + context("when ReduceMotion was activated by the user") { beforeEach { featureStatusesProviderMock!.reduceMotionEnabled = true @@ -334,6 +356,17 @@ class FeatureNotificationsTests: QuickSpec { verifyFeatureDidChangeNotificationWasPosted(withFeature: .reduceTransparency, statusString: "enabled") } } + + context("when VideoAutoplay was activated by the user") { + beforeEach { + featureStatusesProviderMock!.videoAutoplayEnabled = true + sut!.videoAutoplayStatusChanged() + } + + it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { + verifyFeatureDidChangeNotificationWasPosted(withFeature: .videoAutoplay, statusString: "enabled") + } + } #endif diff --git a/Tests/Features/FeatureStatusesProviderTests.swift b/Tests/Features/FeatureStatusesProviderTests.swift index 774a810..24da34b 100644 --- a/Tests/Features/FeatureStatusesProviderTests.swift +++ b/Tests/Features/FeatureStatusesProviderTests.swift @@ -118,16 +118,6 @@ class FeatureStatusesProviderTests: QuickSpec { #if os(OSX) - context("for DifferentiateWithoutColor") { - beforeEach { - sut!.differentiateWithoutColor = true - } - - it("returns correct state") { - expect(sut!.isFeatureEnabled(feature: .differentiateWithoutColor)).to(beTrue()) - } - } - context("for FullKeyboardAccess") { beforeEach { sut!.fullKeyboardAccess = true @@ -191,9 +181,39 @@ class FeatureStatusesProviderTests: QuickSpec { expect(sut!.isFeatureEnabled(feature: .monoAudio)).to(beTrue()) } } + + context("for OnOffSwitchLabels") { + beforeEach { + sut!.onOffSwitchLabelsEnabled = true + } + + it("returns correct state") { + expect(sut!.isFeatureEnabled(feature: .onOffSwitchLabels)).to(beTrue()) + } + } + + context("for VideoAutoplay") { + beforeEach { + sut!.videoAutoplayEnabled = true + } + + it("returns correct state") { + expect(sut!.isFeatureEnabled(feature: .videoAutoplay)).to(beTrue()) + } + } #endif + context("for DifferentiateWithoutColor") { + beforeEach { + sut!.differentiateWithoutColor = true + } + + it("returns correct state") { + expect(sut!.isFeatureEnabled(feature: .differentiateWithoutColor)).to(beTrue()) + } + } + context("for ReduceMotion") { beforeEach { sut!.reduceMotionEnabled = true diff --git a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift index 3f5a204..393f334 100644 --- a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift +++ b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift @@ -28,7 +28,6 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { #endif #if os(OSX) - var differentiateWithoutColor = false var fullKeyboardAccess = false var increaseContrast = false #endif @@ -38,8 +37,11 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { var closedCaptioningEnabled = false var grayscaleEnabled = false var monoAudioEnabled = false + var onOffSwitchLabelsEnabled = false + var videoAutoplayEnabled = false #endif + var differentiateWithoutColor = false var invertColorsEnabled = false var reduceMotionEnabled = false var reduceTransparencyEnabled = false @@ -84,10 +86,6 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { #if os(OSX) - override var isDifferentiateWithoutColorEnabled: Bool { - return self.differentiateWithoutColor - } - override var isFullKeyboardAccessEnabled: Bool { return self.fullKeyboardAccess } @@ -115,9 +113,21 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { override var isMonoAudioEnabled: Bool { return self.monoAudioEnabled } + + override var isOnOffSwitchLabelsEnabled: Bool { + return self.onOffSwitchLabelsEnabled + } + + override var isVideoAutoplayEnabled: Bool { + return self.videoAutoplayEnabled + } #endif + override var isDifferentiateWithoutColorEnabled: Bool { + return self.differentiateWithoutColor + } + override var isInvertColorsEnabled: Bool { return self.invertColorsEnabled } @@ -155,7 +165,6 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { #if os(OSX) - self.differentiateWithoutColor = true self.fullKeyboardAccess = true self.increaseContrast = true @@ -167,9 +176,12 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { self.closedCaptioningEnabled = true self.grayscaleEnabled = true self.monoAudioEnabled = true + self.onOffSwitchLabelsEnabled = true + self.videoAutoplayEnabled = true #endif + self.differentiateWithoutColor = true self.invertColorsEnabled = true self.reduceMotionEnabled = true self.reduceTransparencyEnabled = true From 8128ff7476feeb8a261a173123387d21f5f4bf3c Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 21:59:01 +0200 Subject: [PATCH 05/12] docs: update readme (feature section) --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb5e0cd..3bae323 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ The following table contains all features that are available AND settable on eac | .boldText | :white_check_mark: | | :white_check_mark: |  :white_check_mark:**\*** | | .closedCaptioning | :white_check_mark: | | :white_check_mark: | | | .darkerSystemColors | :white_check_mark: | | | | -| .differentiateWithoutColor | | :white_check_mark: | | | +| .differentiateWithoutColor | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | .fullKeyboardAccess | |  :white_check_mark:**\*** | | | | .grayscale | :white_check_mark: | | :white_check_mark: | | | .guidedAccess | :white_check_mark: | | | | @@ -364,12 +364,14 @@ The following table contains all features that are available AND settable on eac | .invertColors | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | .largerText | :white_check_mark: | | |  :white_check_mark:**\*** | | .monoAudio | :white_check_mark: | | :white_check_mark: | | +| .onOffSwitchLabels | :white_check_mark: | | :white_check_mark: | | | .reduceMotion | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | .reduceTransparency | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | .shakeToUndo | :white_check_mark: | | | | | .speakScreen | :white_check_mark: | | | | | .speakSelection | :white_check_mark: | | | | | .switchControl | :white_check_mark: | :white_check_mark: | :white_check_mark: | | +| .videoAutoplay | :white_check_mark: | | :white_check_mark: | | | .voiceOver | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | *\* Feature status can be read but notifications are not available.* From 164bf7da17c2c8b298b8a17f36b061e222fcfdb0 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 23:01:21 +0200 Subject: [PATCH 06/12] chore: make APIs that are available but non-settable from tvOS --- README.md | 4 +- Source/Features/Models/CapableFeature.swift | 16 +++--- .../Notifications/Notifications.swift | 26 ++++----- .../Statuses/FeatureStatusesProvider.swift | 53 ++++++++++--------- .../FeatureStatusesProviderProtocol.swift | 5 +- .../Features/FeatureNotificationsTests.swift | 46 ++++++++-------- .../FeatureStatusesProviderTests.swift | 10 ++-- .../Mocks/FeatureStatusesProviderMock.swift | 9 ++-- 8 files changed, 94 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 3bae323..4e9d61a 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ The following table contains all features that are available AND settable on eac | .boldText | :white_check_mark: | | :white_check_mark: |  :white_check_mark:**\*** | | .closedCaptioning | :white_check_mark: | | :white_check_mark: | | | .darkerSystemColors | :white_check_mark: | | | | -| .differentiateWithoutColor | :white_check_mark: | :white_check_mark: | :white_check_mark: | | +| .differentiateWithoutColor | :white_check_mark: | | :white_check_mark: | | | .fullKeyboardAccess | |  :white_check_mark:**\*** | | | | .grayscale | :white_check_mark: | | :white_check_mark: | | | .guidedAccess | :white_check_mark: | | | | @@ -364,7 +364,7 @@ The following table contains all features that are available AND settable on eac | .invertColors | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | .largerText | :white_check_mark: | | |  :white_check_mark:**\*** | | .monoAudio | :white_check_mark: | | :white_check_mark: | | -| .onOffSwitchLabels | :white_check_mark: | | :white_check_mark: | | +| .onOffSwitchLabels | :white_check_mark: | | | | | .reduceMotion | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | .reduceTransparency | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | .shakeToUndo | :white_check_mark: | | | | diff --git a/Source/Features/Models/CapableFeature.swift b/Source/Features/Models/CapableFeature.swift index a470534..52f87b7 100644 --- a/Source/Features/Models/CapableFeature.swift +++ b/Source/Features/Models/CapableFeature.swift @@ -22,6 +22,9 @@ public enum CapableFeature: String, CaseIterable { /// Pairing status of a hearing aid. case hearingDevice + /// Displays on/off labels for UISwitch controls. + case onOffSwitchLabels + /// Deletes the last command by shaking the phone. case shakeToUndo @@ -53,10 +56,7 @@ public enum CapableFeature: String, CaseIterable { /// Merges stereo audio channels to help users that are hard of hearing or deaf in one ear. case monoAudio - - /// Displays on/off labels for UISwitch controls. - case onOffSwitchLabels - + /// Allows users who are sensitive to motion to disable automatic video playback. case videoAutoplay @@ -69,11 +69,15 @@ public enum CapableFeature: String, CaseIterable { #endif - #if os(iOS) || os(tvOS) || os(OSX) + #if os(iOS) || os(OSX) /// Helps color blind users to differentiate settings differently, e.g. by using shapes rather than colors. case differentiateWithoutColor - + + #endif + + #if os(iOS) || os(tvOS) || os(OSX) + /// Helps people with low vision, color blindness, or sensitivity to brightness to read the display content. case invertColors diff --git a/Source/Features/Notifications/Notifications.swift b/Source/Features/Notifications/Notifications.swift index 6a5abd3..0071317 100644 --- a/Source/Features/Notifications/Notifications.swift +++ b/Source/Features/Notifications/Notifications.swift @@ -69,6 +69,11 @@ extension Notifications { if features.contains(.darkerSystemColors) { addObserver(forNotification: UIAccessibility.darkerSystemColorsStatusDidChangeNotification, selector: #selector(self.darkerSystemColorsStatusChanged)) } + if features.contains(.differentiateWithoutColor) { + if #available(iOS 13.0, *) { + addObserver(forNotification: NSNotification.Name(rawValue: UIAccessibility.differentiateWithoutColorDidChangeNotification), selector: #selector(self.differentiateWithoutColorStatusChanged)) + } + } if features.contains(.guidedAccess) { addObserver(forNotification: UIAccessibility.guidedAccessStatusDidChangeNotification, selector: #selector(self.guidedAccessStatusChanged)) } @@ -78,6 +83,11 @@ extension Notifications { if features.contains(.largerText) { addObserver(forNotification: UIContentSizeCategory.didChangeNotification, selector: #selector(self.largerTextStatusChanged)) } + if features.contains(.onOffSwitchLabels) { + if #available(iOS 13.0, *) { + addObserver(forNotification: UIAccessibility.onOffSwitchLabelsDidChangeNotification, selector: #selector(self.onOffSwitchLabelsStatusChanged)) + } + } if features.contains(.shakeToUndo) { addObserver(forNotification: UIAccessibility.shakeToUndoDidChangeNotification, selector: #selector(self.shakeToUndoStatusChanged)) } @@ -98,11 +108,6 @@ extension Notifications { if features.contains(.closedCaptioning) { addObserver(forNotification: UIAccessibility.closedCaptioningStatusDidChangeNotification, selector: #selector(self.closedCaptioningStatusChanged)) } - if features.contains(.differentiateWithoutColor) { - if #available(iOS 13.0, tvOS 13.0, *) { - addObserver(forNotification: NSNotification.Name(rawValue: UIAccessibility.differentiateWithoutColorDidChangeNotification), selector: #selector(self.differentiateWithoutColorStatusChanged)) - } - } if features.contains(.grayscale) { addObserver(forNotification: UIAccessibility.grayscaleStatusDidChangeNotification, selector: #selector(self.grayscaleStatusChanged)) } @@ -112,11 +117,6 @@ extension Notifications { if features.contains(.monoAudio) { addObserver(forNotification: UIAccessibility.monoAudioStatusDidChangeNotification, selector: #selector(self.monoAudioStatusChanged)) } - if features.contains(.onOffSwitchLabels) { - if #available(iOS 13.0, tvOS 13.0, *) { - addObserver(forNotification: UIAccessibility.onOffSwitchLabelsDidChangeNotification, selector: #selector(self.onOffSwitchLabelsStatusChanged)) - } - } if features.contains(.switchControl) { addObserver(forNotification: UIAccessibility.switchControlStatusDidChangeNotification, selector: #selector(self.switchControlStatusChanged)) } @@ -247,7 +247,7 @@ extension Notifications { @objc func closedCaptioningStatusChanged() { self.postNotification(withFeature: .closedCaptioning, statusString: self.featureStatusesProvider.isClosedCaptioningEnabled.statusString) } - + @objc func differentiateWithoutColorStatusChanged() { self.postNotification(withFeature: .differentiateWithoutColor, statusString: self.featureStatusesProvider.isDifferentiateWithoutColorEnabled.statusString) } @@ -267,11 +267,11 @@ extension Notifications { @objc func onOffSwitchLabelsStatusChanged() { self.postNotification(withFeature: .onOffSwitchLabels, statusString: self.featureStatusesProvider.isOnOffSwitchLabelsEnabled.statusString) } - + @objc func reduceTransparencyStatusChanged() { self.postNotification(withFeature: .reduceTransparency, statusString: self.featureStatusesProvider.isReduceTransparencyEnabled.statusString) } - + @objc func videoAutoplayStatusChanged() { self.postNotification(withFeature: .videoAutoplay, statusString: self.featureStatusesProvider.isVideoAutoplayEnabled.statusString) } diff --git a/Source/Features/Statuses/FeatureStatusesProvider.swift b/Source/Features/Statuses/FeatureStatusesProvider.swift index 1b007bf..cb3c78f 100644 --- a/Source/Features/Statuses/FeatureStatusesProvider.swift +++ b/Source/Features/Statuses/FeatureStatusesProvider.swift @@ -29,6 +29,15 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return UIAccessibility.isDarkerSystemColorsEnabled } + var isDifferentiateWithoutColorEnabled: Bool { + if #available(iOS 13.0, tvOS 13.0, *) { + return UIAccessibility.shouldDifferentiateWithoutColor + } else { + Logger.warning("Unable to determine status for isDifferentiateWithoutColorEnabled since it is only available on iOS 13 or later.") + return false + } + } + var isGuidedAccessEnabled: Bool { return UIAccessibility.isGuidedAccessEnabled } @@ -41,6 +50,15 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return UIScreen.main.traitCollection.preferredContentSizeCategory } + var isOnOffSwitchLabelsEnabled: Bool { + if #available(iOS 13.0, *) { + return UIAccessibility.isOnOffSwitchLabelsEnabled + } else { + Logger.warning("Unable to determine status for isOnOffSwitchLabelsEnabled since it is only available on iOS 13 or later.") + return false + } + } + var isShakeToUndoEnabled: Bool { return UIAccessibility.isShakeToUndoEnabled } @@ -56,7 +74,7 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { #endif #if os(iOS) || os(tvOS) - + var isBoldTextEnabled: Bool { return UIAccessibility.isBoldTextEnabled } @@ -65,15 +83,6 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return UIAccessibility.isClosedCaptioningEnabled } - var isDifferentiateWithoutColorEnabled: Bool { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIAccessibility.shouldDifferentiateWithoutColor - } else { - Logger.warning("Unable to determine status for isDifferentiateWithoutColorEnabled since it is only available on iOS 13 / tvOS 13 or later.") - return false - } - } - var isGrayscaleEnabled: Bool { return UIAccessibility.isGrayscaleEnabled } @@ -85,15 +94,6 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { var isMonoAudioEnabled: Bool { return UIAccessibility.isMonoAudioEnabled } - - var isOnOffSwitchLabelsEnabled: Bool { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIAccessibility.isOnOffSwitchLabelsEnabled - } else { - Logger.warning("Unable to determine status for isOnOffSwitchLabelsEnabled since it is only available on iOS 13 / tvOS 13 or later.") - return false - } - } var isReduceMotionEnabled: Bool { return UIAccessibility.isReduceMotionEnabled @@ -115,7 +115,7 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { return false } } - + var isVoiceOverEnabled: Bool { return UIAccessibility.isVoiceOverRunning } @@ -216,6 +216,9 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { if feature == .largerText { return !self.largerTextCatagory.isDefault } + if feature == .onOffSwitchLabels { + return self.isOnOffSwitchLabelsEnabled + } if feature == .shakeToUndo { return self.isShakeToUndoEnabled } @@ -258,20 +261,22 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { if feature == .monoAudio { return self.isMonoAudioEnabled } - if feature == .onOffSwitchLabels { - return self.isOnOffSwitchLabelsEnabled - } if feature == .videoAutoplay { return self.isVideoAutoplayEnabled } #endif - #if os(iOS) || os(tvOS) || os(macOS) + #if os(iOS) || os(OSX) if feature == .differentiateWithoutColor { return self.isDifferentiateWithoutColorEnabled } + + #endif + + #if os(iOS) || os(tvOS) || os(OSX) + if feature == .invertColors { return self.isInvertColorsEnabled } diff --git a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift index cc405e8..0e818de 100644 --- a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift +++ b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift @@ -30,12 +30,15 @@ protocol FeatureStatusesProviderProtocol { var isVideoAutoplayEnabled: Bool { get } #endif + #if os(iOS) || os(OSX) + var isDifferentiateWithoutColorEnabled: Bool { get } + #endif + #if os(iOS) || os(tvOS) || os(watchOS) var isBoldTextEnabled: Bool { get } #endif #if os(iOS) || os(tvOS) || os(OSX) - var isDifferentiateWithoutColorEnabled: Bool { get } var isInvertColorsEnabled: Bool { get } var isReduceTransparencyEnabled: Bool { get } var isSwitchControlEnabled: Bool { get } diff --git a/Tests/Features/FeatureNotificationsTests.swift b/Tests/Features/FeatureNotificationsTests.swift index bd09e0c..9d45eb3 100644 --- a/Tests/Features/FeatureNotificationsTests.swift +++ b/Tests/Features/FeatureNotificationsTests.swift @@ -126,6 +126,17 @@ class FeatureNotificationsTests: QuickSpec { } } + context("when DifferentiateWithoutColor was activated by the user") { + beforeEach { + featureStatusesProviderMock!.differentiateWithoutColor = true + sut!.differentiateWithoutColorStatusChanged() + } + + it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { + verifyFeatureDidChangeNotificationWasPosted(withFeature: .differentiateWithoutColor, statusString: "enabled") + } + } + context("when GuidedAccess was activated by the user") { beforeEach { featureStatusesProviderMock!.guidedAccessEnabled = true @@ -162,6 +173,17 @@ class FeatureNotificationsTests: QuickSpec { } } + context("when OnOffSwitchLabels was activated by the user") { + beforeEach { + featureStatusesProviderMock!.onOffSwitchLabelsEnabled = true + sut!.onOffSwitchLabelsStatusChanged() + } + + it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { + verifyFeatureDidChangeNotificationWasPosted(withFeature: .videoAutoplay, statusString: "enabled") + } + } + context("when ShakeToUndo was activated by the user") { beforeEach { featureStatusesProviderMock!.shakeToUndoEnabled = true @@ -280,17 +302,6 @@ class FeatureNotificationsTests: QuickSpec { } } - context("when DifferentiateWithoutColor was activated by the user") { - beforeEach { - featureStatusesProviderMock!.differentiateWithoutColor = true - sut!.differentiateWithoutColorStatusChanged() - } - - it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { - verifyFeatureDidChangeNotificationWasPosted(withFeature: .differentiateWithoutColor, statusString: "enabled") - } - } - context("when Grayscale was activated by the user") { beforeEach { featureStatusesProviderMock!.grayscaleEnabled = true @@ -324,17 +335,6 @@ class FeatureNotificationsTests: QuickSpec { } } - context("when OnOffSwitchLabels was activated by the user") { - beforeEach { - featureStatusesProviderMock!.onOffSwitchLabelsEnabled = true - sut!.onOffSwitchLabelsStatusChanged() - } - - it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { - verifyFeatureDidChangeNotificationWasPosted(withFeature: .videoAutoplay, statusString: "enabled") - } - } - context("when ReduceMotion was activated by the user") { beforeEach { featureStatusesProviderMock!.reduceMotionEnabled = true @@ -356,7 +356,7 @@ class FeatureNotificationsTests: QuickSpec { verifyFeatureDidChangeNotificationWasPosted(withFeature: .reduceTransparency, statusString: "enabled") } } - + context("when VideoAutoplay was activated by the user") { beforeEach { featureStatusesProviderMock!.videoAutoplayEnabled = true diff --git a/Tests/Features/FeatureStatusesProviderTests.swift b/Tests/Features/FeatureStatusesProviderTests.swift index 24da34b..2b5bed9 100644 --- a/Tests/Features/FeatureStatusesProviderTests.swift +++ b/Tests/Features/FeatureStatusesProviderTests.swift @@ -181,7 +181,7 @@ class FeatureStatusesProviderTests: QuickSpec { expect(sut!.isFeatureEnabled(feature: .monoAudio)).to(beTrue()) } } - + context("for OnOffSwitchLabels") { beforeEach { sut!.onOffSwitchLabelsEnabled = true @@ -191,7 +191,7 @@ class FeatureStatusesProviderTests: QuickSpec { expect(sut!.isFeatureEnabled(feature: .onOffSwitchLabels)).to(beTrue()) } } - + context("for VideoAutoplay") { beforeEach { sut!.videoAutoplayEnabled = true @@ -204,6 +204,8 @@ class FeatureStatusesProviderTests: QuickSpec { #endif + #if os(iOS) || os(OSX) + context("for DifferentiateWithoutColor") { beforeEach { sut!.differentiateWithoutColor = true @@ -213,7 +215,9 @@ class FeatureStatusesProviderTests: QuickSpec { expect(sut!.isFeatureEnabled(feature: .differentiateWithoutColor)).to(beTrue()) } } - + + #endif + context("for ReduceMotion") { beforeEach { sut!.reduceMotionEnabled = true diff --git a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift index 393f334..9dc0249 100644 --- a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift +++ b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift @@ -41,7 +41,10 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { var videoAutoplayEnabled = false #endif + #if os(iOS) || os(OSX) var differentiateWithoutColor = false + #endif + var invertColorsEnabled = false var reduceMotionEnabled = false var reduceTransparencyEnabled = false @@ -113,11 +116,11 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { override var isMonoAudioEnabled: Bool { return self.monoAudioEnabled } - + override var isOnOffSwitchLabelsEnabled: Bool { return self.onOffSwitchLabelsEnabled } - + override var isVideoAutoplayEnabled: Bool { return self.videoAutoplayEnabled } @@ -127,7 +130,7 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { override var isDifferentiateWithoutColorEnabled: Bool { return self.differentiateWithoutColor } - + override var isInvertColorsEnabled: Bool { return self.invertColorsEnabled } From 9746480ab4df1fb873c64199970eec7f8894039f Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 23:01:35 +0200 Subject: [PATCH 07/12] chore: update test dependencies --- Cartfile.resolved | 2 +- Package.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 810925c..9f666f4 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Quick/Nimble" "v8.0.1" +github "Quick/Nimble" "v8.0.2" github "Quick/Quick" "v2.1.0" diff --git a/Package.swift b/Package.swift index aa8d372..f87ff13 100644 --- a/Package.swift +++ b/Package.swift @@ -9,8 +9,8 @@ let package = Package( targets: ["Capable"]) ], dependencies: [ - .package(url: "https://github.com/Quick/Quick.git", from: "1.0.0"), - .package(url: "https://github.com/Quick/Nimble.git", from: "7.0.0") + .package(url: "https://github.com/Quick/Quick.git", from: "2.1.0"), + .package(url: "https://github.com/Quick/Nimble.git", from: "8.0.2") ], targets: [ .target( From 0f575083f5a74961fef9d5622ae16c4b158818f8 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Sun, 11 Aug 2019 23:04:35 +0200 Subject: [PATCH 08/12] chore: update dependencies of example app --- Example/Podfile | 2 +- Example/Podfile.lock | 94 +++++++++++-------- README.md | 2 +- .../Notifications/Notifications.swift | 8 +- .../Statuses/FeatureStatusesProvider.swift | 2 +- .../FeatureStatusesProviderProtocol.swift | 2 +- .../FeatureStatusesProviderTests.swift | 20 ++-- .../Mocks/FeatureStatusesProviderMock.swift | 25 +++-- 8 files changed, 92 insertions(+), 63 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index ad16584..4b4a79b 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -8,7 +8,7 @@ target 'Example-iOS' do sharedPods pod 'SheetyColors', '1.0.0' - pod 'AppCenter/Analytics', '1.14.0' + pod 'AppCenter/Analytics' pod 'Fabric' pod 'Answers' pod 'Firebase/Core' diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 6d66528..23e13e9 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Answers (1.4.0): - - Fabric (~> 1.8.0) - - AppCenter/Analytics (1.14.0): + - Answers (1.4.1): + - Fabric (~> 1.10.2) + - AppCenter/Analytics (2.2.0): - AppCenter/Core - - AppCenter/Core (1.14.0) + - AppCenter/Core (2.2.0) - Capable (1.0.1): - Capable/Colors (= 1.0.1) - Capable/Features (= 1.0.1) @@ -11,51 +11,63 @@ PODS: - Capable/Colors (1.0.1) - Capable/Features (1.0.1) - Capable/Fonts (1.0.1) - - Fabric (1.8.2) - - Firebase/Core (6.1.0): + - Fabric (1.10.2) + - Firebase/Core (6.6.0): - Firebase/CoreOnly - - FirebaseAnalytics (= 6.0.1) - - Firebase/CoreOnly (6.1.0): - - FirebaseCore (= 6.0.1) - - FirebaseAnalytics (6.0.1): - - FirebaseCore (~> 6.0) - - FirebaseInstanceID (~> 4.1) - - GoogleAppMeasurement (= 6.0.1) + - FirebaseAnalytics (= 6.1.0) + - Firebase/CoreOnly (6.6.0): + - FirebaseCore (= 6.2.0) + - FirebaseAnalytics (6.1.0): + - FirebaseCore (~> 6.2) + - FirebaseInstanceID (~> 4.2) + - GoogleAppMeasurement (= 6.1.0) - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - GoogleUtilities/MethodSwizzler (~> 6.0) - GoogleUtilities/Network (~> 6.0) - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - FirebaseCore (6.0.1): - - GoogleUtilities/Environment (~> 6.0) - - GoogleUtilities/Logger (~> 6.0) - - FirebaseInstanceID (4.1.0): + - FirebaseCore (6.2.0): + - FirebaseCoreDiagnostics (~> 1.0) + - FirebaseCoreDiagnosticsInterop (~> 1.0) + - GoogleUtilities/Environment (~> 6.2) + - GoogleUtilities/Logger (~> 6.2) + - FirebaseCoreDiagnostics (1.0.0): + - FirebaseCoreDiagnosticsInterop (~> 1.0) + - GoogleDataTransportCCTSupport (~> 1.0) + - GoogleUtilities/Environment (~> 6.2) + - GoogleUtilities/Logger (~> 6.2) + - FirebaseCoreDiagnosticsInterop (1.0.0) + - FirebaseInstanceID (4.2.3): - FirebaseCore (~> 6.0) - GoogleUtilities/Environment (~> 6.0) - GoogleUtilities/UserDefaults (~> 6.0) - - GoogleAppMeasurement (6.0.1): + - GoogleAppMeasurement (6.1.0): - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - GoogleUtilities/MethodSwizzler (~> 6.0) - GoogleUtilities/Network (~> 6.0) - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - GoogleUtilities/AppDelegateSwizzler (6.2.0): + - GoogleDataTransport (1.0.0) + - GoogleDataTransportCCTSupport (1.0.0): + - GoogleDataTransport (~> 1.0) + - nanopb + - GoogleUtilities/AppDelegateSwizzler (6.2.4): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.2.0) - - GoogleUtilities/Logger (6.2.0): + - GoogleUtilities/Environment (6.2.4) + - GoogleUtilities/Logger (6.2.4): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (6.2.0): + - GoogleUtilities/MethodSwizzler (6.2.4): - GoogleUtilities/Logger - - GoogleUtilities/Network (6.2.0): + - GoogleUtilities/Network (6.2.4): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.2.0)" - - GoogleUtilities/Reachability (6.2.0): + - "GoogleUtilities/NSData+zlib (6.2.4)" + - GoogleUtilities/Reachability (6.2.4): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.2.0): + - GoogleUtilities/UserDefaults (6.2.4): - GoogleUtilities/Logger - nanopb (0.3.901): - nanopb/decode (= 0.3.901) @@ -67,7 +79,7 @@ PODS: DEPENDENCIES: - Answers - - AppCenter/Analytics (= 1.14.0) + - AppCenter/Analytics - Capable (from `../`) - Fabric - Firebase/Core @@ -81,8 +93,12 @@ SPEC REPOS: - Firebase - FirebaseAnalytics - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseCoreDiagnosticsInterop - FirebaseInstanceID - GoogleAppMeasurement + - GoogleDataTransport + - GoogleDataTransportCCTSupport - GoogleUtilities - nanopb - SheetyColors @@ -92,19 +108,23 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Answers: e7317ccd30e7bf55c3bacfe28adbe2304b082e49 - AppCenter: 02c5efe08d3bbab5421ae41d5f7aa7238906b817 + Answers: 7d5ff1f77fea900eb75032b37b4288482b824055 + AppCenter: c809e69d93218b9861b4f8e54ded8dcf4d2131e7 Capable: 49d8637d06ee50dac258757071ea27cbce0e1bf6 - Fabric: d2b22f443ba195d8a7cc204da230977c72733b40 - Firebase: 8d77bb33624ae9b62d745d82ec023de5f70f7e4f - FirebaseAnalytics: 629301c2b9925f3537d4093a17a72751ae5b7084 - FirebaseCore: 66bdef3b310a026880e2a5bc8aa586ab62ce4543 - FirebaseInstanceID: 27bed93a59b6685f5c3e0c028a878a764fd75c33 - GoogleAppMeasurement: 51d8d9ea48f0ca44484d29cfbdef976fbd4fc336 - GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba + Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74 + Firebase: a2b5951f30ff38fd3b3bdae9c7d340f940fd3c51 + FirebaseAnalytics: 48414ae5cbf6976d8a2f7177e0466540e5ab33ce + FirebaseCore: 8c9e08bce0c72a3affd83927d8184cf244918bc8 + FirebaseCoreDiagnostics: 5807d8a32ea4455d6476da6de828675f89a8d8f3 + FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb + FirebaseInstanceID: 8b42755db950682e7de0d167bc6fb26a57b244af + GoogleAppMeasurement: 47285fa897e5a125df56b9ef8750a1d81e4598a8 + GoogleDataTransport: fe6af28a312ae5a56d5cec00ff14f6e3ded3beef + GoogleDataTransportCCTSupport: e6fa721757b147d7f1481d7367b8dab3e9010889 + GoogleUtilities: 64b5e3982b1b01bda26712affd5c523ef32563cf nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 SheetyColors: dbf4b6b427d10f0316a2237b8a00cd8d576466dd -PODFILE CHECKSUM: 5dbd3f14150c8d61f0a07bd9d65f8e2e2ba37daf +PODFILE CHECKSUM: 281f4c067013ef97112498d527050bb7d1b70f3b COCOAPODS: 1.7.5 diff --git a/README.md b/README.md index 4e9d61a..31d9c3f 100644 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ The following table contains all features that are available AND settable on eac | .boldText | :white_check_mark: | | :white_check_mark: |  :white_check_mark:**\*** | | .closedCaptioning | :white_check_mark: | | :white_check_mark: | | | .darkerSystemColors | :white_check_mark: | | | | -| .differentiateWithoutColor | :white_check_mark: | | :white_check_mark: | | +| .differentiateWithoutColor | :white_check_mark: | :white_check_mark: | | | | .fullKeyboardAccess | |  :white_check_mark:**\*** | | | | .grayscale | :white_check_mark: | | :white_check_mark: | | | .guidedAccess | :white_check_mark: | | | | diff --git a/Source/Features/Notifications/Notifications.swift b/Source/Features/Notifications/Notifications.swift index 0071317..0957810 100644 --- a/Source/Features/Notifications/Notifications.swift +++ b/Source/Features/Notifications/Notifications.swift @@ -224,6 +224,10 @@ extension Notifications { self.postNotification(withFeature: .largerText, statusString: self.featureStatusesProvider.largerTextCatagory.stringValue) } + @objc func onOffSwitchLabelsStatusChanged() { + self.postNotification(withFeature: .onOffSwitchLabels, statusString: self.featureStatusesProvider.isOnOffSwitchLabelsEnabled.statusString) + } + @objc func shakeToUndoStatusChanged() { self.postNotification(withFeature: .shakeToUndo, statusString: self.featureStatusesProvider.isShakeToUndoEnabled.statusString) } @@ -264,10 +268,6 @@ extension Notifications { self.postNotification(withFeature: .monoAudio, statusString: self.featureStatusesProvider.isMonoAudioEnabled.statusString) } - @objc func onOffSwitchLabelsStatusChanged() { - self.postNotification(withFeature: .onOffSwitchLabels, statusString: self.featureStatusesProvider.isOnOffSwitchLabelsEnabled.statusString) - } - @objc func reduceTransparencyStatusChanged() { self.postNotification(withFeature: .reduceTransparency, statusString: self.featureStatusesProvider.isReduceTransparencyEnabled.statusString) } diff --git a/Source/Features/Statuses/FeatureStatusesProvider.swift b/Source/Features/Statuses/FeatureStatusesProvider.swift index cb3c78f..13c25c8 100644 --- a/Source/Features/Statuses/FeatureStatusesProvider.swift +++ b/Source/Features/Statuses/FeatureStatusesProvider.swift @@ -30,7 +30,7 @@ class FeatureStatusesProvider: FeatureStatusesProviderProtocol { } var isDifferentiateWithoutColorEnabled: Bool { - if #available(iOS 13.0, tvOS 13.0, *) { + if #available(iOS 13.0, *) { return UIAccessibility.shouldDifferentiateWithoutColor } else { Logger.warning("Unable to determine status for isDifferentiateWithoutColorEnabled since it is only available on iOS 13 or later.") diff --git a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift index 0e818de..e5cc1c2 100644 --- a/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift +++ b/Source/Features/Statuses/FeatureStatusesProviderProtocol.swift @@ -17,6 +17,7 @@ protocol FeatureStatusesProviderProtocol { var isGuidedAccessEnabled: Bool { get } var hearingDevicePairedEar: UIAccessibility.HearingDeviceEar { get } var largerTextCatagory: UIContentSizeCategory { get } + var isOnOffSwitchLabelsEnabled: Bool { get } var isShakeToUndoEnabled: Bool { get } var isSpeakScreenEnabled: Bool { get } var isSpeakSelectionEnabled: Bool { get } @@ -26,7 +27,6 @@ protocol FeatureStatusesProviderProtocol { var isClosedCaptioningEnabled: Bool { get } var isGrayscaleEnabled: Bool { get } var isMonoAudioEnabled: Bool { get } - var isOnOffSwitchLabelsEnabled: Bool { get } var isVideoAutoplayEnabled: Bool { get } #endif diff --git a/Tests/Features/FeatureStatusesProviderTests.swift b/Tests/Features/FeatureStatusesProviderTests.swift index 2b5bed9..2d373e8 100644 --- a/Tests/Features/FeatureStatusesProviderTests.swift +++ b/Tests/Features/FeatureStatusesProviderTests.swift @@ -84,6 +84,16 @@ class FeatureStatusesProviderTests: QuickSpec { } } + context("for OnOffSwitchLabels") { + beforeEach { + sut!.onOffSwitchLabelsEnabled = true + } + + it("returns correct state") { + expect(sut!.isFeatureEnabled(feature: .onOffSwitchLabels)).to(beTrue()) + } + } + context("for ShakeToUndo") { beforeEach { sut!.shakeToUndoEnabled = true @@ -182,16 +192,6 @@ class FeatureStatusesProviderTests: QuickSpec { } } - context("for OnOffSwitchLabels") { - beforeEach { - sut!.onOffSwitchLabelsEnabled = true - } - - it("returns correct state") { - expect(sut!.isFeatureEnabled(feature: .onOffSwitchLabels)).to(beTrue()) - } - } - context("for VideoAutoplay") { beforeEach { sut!.videoAutoplayEnabled = true diff --git a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift index 9dc0249..b3cce17 100644 --- a/Tests/Features/Mocks/FeatureStatusesProviderMock.swift +++ b/Tests/Features/Mocks/FeatureStatusesProviderMock.swift @@ -21,6 +21,7 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { var darkerSystemColorsEnabled = false var guidedAccessEnabled = false var hearingDeviceEar: UIAccessibility.HearingDeviceEar = UIAccessibility.HearingDeviceEar(rawValue: 0) + var onOffSwitchLabelsEnabled = false var shakeToUndoEnabled = false var speakScreenEnabled = false var speakSelectionEnabled = false @@ -37,7 +38,6 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { var closedCaptioningEnabled = false var grayscaleEnabled = false var monoAudioEnabled = false - var onOffSwitchLabelsEnabled = false var videoAutoplayEnabled = false #endif @@ -61,6 +61,10 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { return self.darkerSystemColorsEnabled } + override var isGuidedAccessEnabled: Bool { + return self.guidedAccessEnabled + } + override var hearingDevicePairedEar: UIAccessibility.HearingDeviceEar { return self.hearingDeviceEar } @@ -69,8 +73,8 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { return self.textCatagory } - override var isGuidedAccessEnabled: Bool { - return self.guidedAccessEnabled + override var isOnOffSwitchLabelsEnabled: Bool { + return self.onOffSwitchLabelsEnabled } override var isShakeToUndoEnabled: Bool { @@ -117,20 +121,20 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { return self.monoAudioEnabled } - override var isOnOffSwitchLabelsEnabled: Bool { - return self.onOffSwitchLabelsEnabled - } - override var isVideoAutoplayEnabled: Bool { return self.videoAutoplayEnabled } #endif + #if os(iOS) || os(OSX) + override var isDifferentiateWithoutColorEnabled: Bool { return self.differentiateWithoutColor } + #endif + override var isInvertColorsEnabled: Bool { return self.invertColorsEnabled } @@ -160,6 +164,7 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { self.textCatagory = .accessibilityExtraExtraExtraLarge self.guidedAccessEnabled = true self.hearingDeviceEar = .both + self.onOffSwitchLabelsEnabled = true self.shakeToUndoEnabled = true self.speakScreenEnabled = true self.speakSelectionEnabled = true @@ -179,12 +184,16 @@ class FeatureStatusesProviderMock: FeatureStatusesProvider { self.closedCaptioningEnabled = true self.grayscaleEnabled = true self.monoAudioEnabled = true - self.onOffSwitchLabelsEnabled = true self.videoAutoplayEnabled = true #endif + #if os(iOS) || os(OSX) + self.differentiateWithoutColor = true + + #endif + self.invertColorsEnabled = true self.reduceMotionEnabled = true self.reduceTransparencyEnabled = true From e8206613497178e125b6d7c3b76044768e3569a3 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Tue, 8 Oct 2019 15:07:21 +0200 Subject: [PATCH 09/12] chore: remove ds_store files from source control --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e70681d..cc6bda2 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ xcuserdata/ *.moved-aside *.xccheckout *.xcscmblueprint +*.DS_Store ## Obj-C/Swift specific *.hmap @@ -65,4 +66,4 @@ Carthage/Build fastlane/report.xml fastlane/Preview.html fastlane/screenshots -fastlane/test_output \ No newline at end of file +fastlane/test_output From e42d61eae429c407f0ed32d60cd22ccd0bfbca69 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Tue, 8 Oct 2019 15:08:00 +0200 Subject: [PATCH 10/12] chore: update dependencies --- Cartfile.resolved | 4 +-- Example/Podfile.lock | 68 ++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 9f666f4..9eb6d52 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Quick/Nimble" "v8.0.2" -github "Quick/Quick" "v2.1.0" +github "Quick/Nimble" "v8.0.4" +github "Quick/Quick" "v2.2.0" diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 23e13e9..67758ed 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,9 +1,9 @@ PODS: - Answers (1.4.1): - Fabric (~> 1.10.2) - - AppCenter/Analytics (2.2.0): + - AppCenter/Analytics (2.4.0): - AppCenter/Core - - AppCenter/Core (2.2.0) + - AppCenter/Core (2.4.0) - Capable (1.0.1): - Capable/Colors (= 1.0.1) - Capable/Features (= 1.0.1) @@ -12,62 +12,62 @@ PODS: - Capable/Features (1.0.1) - Capable/Fonts (1.0.1) - Fabric (1.10.2) - - Firebase/Core (6.6.0): + - Firebase/Core (6.9.0): - Firebase/CoreOnly - - FirebaseAnalytics (= 6.1.0) - - Firebase/CoreOnly (6.6.0): - - FirebaseCore (= 6.2.0) - - FirebaseAnalytics (6.1.0): - - FirebaseCore (~> 6.2) + - FirebaseAnalytics (= 6.1.2) + - Firebase/CoreOnly (6.9.0): + - FirebaseCore (= 6.3.0) + - FirebaseAnalytics (6.1.2): + - FirebaseCore (~> 6.3) - FirebaseInstanceID (~> 4.2) - - GoogleAppMeasurement (= 6.1.0) + - GoogleAppMeasurement (= 6.1.2) - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - GoogleUtilities/MethodSwizzler (~> 6.0) - GoogleUtilities/Network (~> 6.0) - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - FirebaseCore (6.2.0): + - FirebaseCore (6.3.0): - FirebaseCoreDiagnostics (~> 1.0) - FirebaseCoreDiagnosticsInterop (~> 1.0) - GoogleUtilities/Environment (~> 6.2) - GoogleUtilities/Logger (~> 6.2) - - FirebaseCoreDiagnostics (1.0.0): + - FirebaseCoreDiagnostics (1.1.0): - FirebaseCoreDiagnosticsInterop (~> 1.0) - GoogleDataTransportCCTSupport (~> 1.0) - GoogleUtilities/Environment (~> 6.2) - GoogleUtilities/Logger (~> 6.2) - FirebaseCoreDiagnosticsInterop (1.0.0) - - FirebaseInstanceID (4.2.3): + - FirebaseInstanceID (4.2.5): - FirebaseCore (~> 6.0) - GoogleUtilities/Environment (~> 6.0) - GoogleUtilities/UserDefaults (~> 6.0) - - GoogleAppMeasurement (6.1.0): + - GoogleAppMeasurement (6.1.2): - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - GoogleUtilities/MethodSwizzler (~> 6.0) - GoogleUtilities/Network (~> 6.0) - "GoogleUtilities/NSData+zlib (~> 6.0)" - nanopb (~> 0.3) - - GoogleDataTransport (1.0.0) - - GoogleDataTransportCCTSupport (1.0.0): - - GoogleDataTransport (~> 1.0) + - GoogleDataTransport (2.0.0) + - GoogleDataTransportCCTSupport (1.1.0): + - GoogleDataTransport (~> 2.0) - nanopb - - GoogleUtilities/AppDelegateSwizzler (6.2.4): + - GoogleUtilities/AppDelegateSwizzler (6.3.1): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.2.4) - - GoogleUtilities/Logger (6.2.4): + - GoogleUtilities/Environment (6.3.1) + - GoogleUtilities/Logger (6.3.1): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (6.2.4): + - GoogleUtilities/MethodSwizzler (6.3.1): - GoogleUtilities/Logger - - GoogleUtilities/Network (6.2.4): + - GoogleUtilities/Network (6.3.1): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.2.4)" - - GoogleUtilities/Reachability (6.2.4): + - "GoogleUtilities/NSData+zlib (6.3.1)" + - GoogleUtilities/Reachability (6.3.1): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.2.4): + - GoogleUtilities/UserDefaults (6.3.1): - GoogleUtilities/Logger - nanopb (0.3.901): - nanopb/decode (= 0.3.901) @@ -109,19 +109,19 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Answers: 7d5ff1f77fea900eb75032b37b4288482b824055 - AppCenter: c809e69d93218b9861b4f8e54ded8dcf4d2131e7 + AppCenter: 49a9ffe114c00e2bf5374aeda816d47eabf1978a Capable: 49d8637d06ee50dac258757071ea27cbce0e1bf6 Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74 - Firebase: a2b5951f30ff38fd3b3bdae9c7d340f940fd3c51 - FirebaseAnalytics: 48414ae5cbf6976d8a2f7177e0466540e5ab33ce - FirebaseCore: 8c9e08bce0c72a3affd83927d8184cf244918bc8 - FirebaseCoreDiagnostics: 5807d8a32ea4455d6476da6de828675f89a8d8f3 + Firebase: 2d750c54cda57d5a6ae31212cfe5cc813c6be7e4 + FirebaseAnalytics: 5d9ccbf46ed25d3ec9304d263f85bddf1e93e2d2 + FirebaseCore: 8b2765c445d40db7137989b7146a3aa3f91b5529 + FirebaseCoreDiagnostics: be4f7a09d02ab305f18de59a470412caddb64c2a FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb - FirebaseInstanceID: 8b42755db950682e7de0d167bc6fb26a57b244af - GoogleAppMeasurement: 47285fa897e5a125df56b9ef8750a1d81e4598a8 - GoogleDataTransport: fe6af28a312ae5a56d5cec00ff14f6e3ded3beef - GoogleDataTransportCCTSupport: e6fa721757b147d7f1481d7367b8dab3e9010889 - GoogleUtilities: 64b5e3982b1b01bda26712affd5c523ef32563cf + FirebaseInstanceID: 550df9be1f99f751d8fcde3ac342a1e21a0e6c42 + GoogleAppMeasurement: 0ae90be1cc4dad40f4a27fc767ef59fa032ec87b + GoogleDataTransport: c8617c00e4f3eb9418e42ac0e8ac5241a9d555dd + GoogleDataTransportCCTSupport: 9f352523e8785a71f6754f51eeff09f49ec19268 + GoogleUtilities: f895fde57977df4e0233edda0dbeac490e3703b6 nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 SheetyColors: dbf4b6b427d10f0316a2237b8a00cd8d576466dd From 1d8e6448df29b5539ac2fa77ae4bc65880e92db8 Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Tue, 8 Oct 2019 15:08:18 +0200 Subject: [PATCH 11/12] fix: build errors --- Source/Features/Notifications/Notifications.swift | 8 ++++---- Tests/Features/FeatureNotificationsTests.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Features/Notifications/Notifications.swift b/Source/Features/Notifications/Notifications.swift index 0957810..3f1624b 100644 --- a/Source/Features/Notifications/Notifications.swift +++ b/Source/Features/Notifications/Notifications.swift @@ -212,6 +212,10 @@ extension Notifications { self.postNotification(withFeature: .darkerSystemColors, statusString: self.featureStatusesProvider.isDarkerSystemColorsEnabled.statusString) } + @objc func differentiateWithoutColorStatusChanged() { + self.postNotification(withFeature: .differentiateWithoutColor, statusString: self.featureStatusesProvider.isDifferentiateWithoutColorEnabled.statusString) + } + @objc func guidedAccessStatusChanged() { self.postNotification(withFeature: .guidedAccess, statusString: self.featureStatusesProvider.isGuidedAccessEnabled.statusString) } @@ -252,10 +256,6 @@ extension Notifications { self.postNotification(withFeature: .closedCaptioning, statusString: self.featureStatusesProvider.isClosedCaptioningEnabled.statusString) } - @objc func differentiateWithoutColorStatusChanged() { - self.postNotification(withFeature: .differentiateWithoutColor, statusString: self.featureStatusesProvider.isDifferentiateWithoutColorEnabled.statusString) - } - @objc func grayscaleStatusChanged() { self.postNotification(withFeature: .grayscale, statusString: self.featureStatusesProvider.isGrayscaleEnabled.statusString) } diff --git a/Tests/Features/FeatureNotificationsTests.swift b/Tests/Features/FeatureNotificationsTests.swift index 9d45eb3..9163426 100644 --- a/Tests/Features/FeatureNotificationsTests.swift +++ b/Tests/Features/FeatureNotificationsTests.swift @@ -180,7 +180,7 @@ class FeatureNotificationsTests: QuickSpec { } it("posts a CapableFeatureStatusDidChange notification with the correct FeatureStatus") { - verifyFeatureDidChangeNotificationWasPosted(withFeature: .videoAutoplay, statusString: "enabled") + verifyFeatureDidChangeNotificationWasPosted(withFeature: .onOffSwitchLabels, statusString: "enabled") } } From 869a5103341a73abd16bde7d000c67063e6d933d Mon Sep 17 00:00:00 2001 From: Christoph Wendt Date: Tue, 8 Oct 2019 20:07:12 +0200 Subject: [PATCH 12/12] chore: update dark mode appearence of demo app --- Example/Source/iOS/Base.lproj/Main.storyboard | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Example/Source/iOS/Base.lproj/Main.storyboard b/Example/Source/iOS/Base.lproj/Main.storyboard index 9c4c761..a9a5f92 100644 --- a/Example/Source/iOS/Base.lproj/Main.storyboard +++ b/Example/Source/iOS/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -34,8 +34,8 @@ - - + + @@ -96,8 +96,8 @@ - - + + @@ -158,8 +158,8 @@ - - + + @@ -175,8 +175,8 @@ - - + + @@ -227,7 +227,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -382,8 +382,8 @@ - - + + @@ -402,12 +402,11 @@ - - - + + - + @@ -507,7 +506,7 @@ - + @@ -516,6 +515,7 @@ + @@ -524,7 +524,7 @@ - +