From 76fb9d7e1ff5b6343ec411a58ca46cd1de18bdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 12 Feb 2021 13:46:15 +0100 Subject: [PATCH 1/6] Bump version number --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index dabae3c..b1d43df 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -1,5 +1,5 @@ // Version information -MARKETING_VERSION = 3.0.3 +MARKETING_VERSION = 3.0.4 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 9.0 diff --git a/Package.swift b/Package.swift index 8ef1f5a..b1c92ee 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "3.0.3" + static let marketingVersion: String = "3.0.4" } let package = Package( From 8acf9da9d3b6837a23f80bee6b45ca511feb2e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 12 Feb 2021 15:24:02 +0100 Subject: [PATCH 2/6] Set focus on login button after filling text fields --- .../SRGIdentityLoginViewController~tvos.m | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m b/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m index c65362c..1c66f60 100644 --- a/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m +++ b/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m @@ -16,7 +16,7 @@ @import SRGAppearance; @import SRGNetwork; -@interface SRGIdentityLoginViewController () +@interface SRGIdentityLoginViewController () @property (nonatomic, copy) NSString *emailAddress; @property (nonatomic) NSURL *webserviceURL; @@ -76,6 +76,18 @@ - (void)viewDidDisappear:(BOOL)animated } } +#pragma mark Focus management + +- (NSArray> *)preferredFocusEnvironments +{ + if (self.emailAddressTextField.text.length != 0 && self.passwordTextField.text.length != 0) { + return @[self.loginButton]; + } + else { + return @[]; + } +} + #pragma mark Layout helpers - (void)loadCredentialsStackViewInView:(UIView *)view @@ -145,6 +157,7 @@ - (void)loadPasswordTextFieldInStackView:(UIStackView *)stackView { UITextField *passwordTextField = [[UITextField alloc] init]; passwordTextField.translatesAutoresizingMaskIntoConstraints = NO; + passwordTextField.delegate = self; passwordTextField.placeholder = SRGIdentityLocalizedString(@"Password", @"Password text field placeholder on Apple TV"); passwordTextField.font = [UIFont srg_regularFontWithSize:42.f]; passwordTextField.textContentType = UITextContentTypePassword; @@ -253,6 +266,14 @@ - (SRGRequest *)loginRequestWithEmailAddress:(NSString *)emailAddress password:( }]; } +#pragma mark UITextFieldDelegate protocol + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [self setNeedsFocusUpdate]; + [self updateFocusIfNeeded]; +} + #pragma mark Actions - (void)login:(id)sender From c01b61f0b220d97d9c39ea15077777439348bd2a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Wed, 20 Jan 2021 23:35:19 +0100 Subject: [PATCH 3/6] Use ContentTypeUsername for login field --- Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m b/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m index 1c66f60..8448b5b 100644 --- a/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m +++ b/Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m @@ -142,7 +142,8 @@ - (void)loadEmailAddressTextFieldInStackView:(UIStackView *)stackView emailAddressTextField.text = self.emailAddress; emailAddressTextField.placeholder = SRGIdentityLocalizedString(@"Email address", @"Email address text field placeholder on Apple TV"); emailAddressTextField.font = [UIFont srg_regularFontWithSize:42.f]; - emailAddressTextField.textContentType = UITextContentTypeEmailAddress; + emailAddressTextField.textContentType = UITextContentTypeUsername; + emailAddressTextField.keyboardType = UIKeyboardTypeEmailAddress; emailAddressTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; [stackView addArrangedSubview:emailAddressTextField]; self.emailAddressTextField = emailAddressTextField; From 5179342dec6f8615389591edf10eccd6bce3c240 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Wed, 24 Feb 2021 22:21:56 +0100 Subject: [PATCH 4/6] Fastlane: clean derived data before build and tests --- fastlane/Fastfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index da612eb..964eda6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -23,6 +23,7 @@ platform :ios do desc 'Run library tests' lane :tests do clean_result_files + clean_derived_data Device = Struct.new(:platform, :name) TestBuild = Struct.new(:scheme, :scheme_suffix, :in_workspace) @@ -62,6 +63,10 @@ def clean_result_files FileUtils.remove_entry('xcresult', true) end +def clean_derived_data + Dir.chdir('..') { FileUtils.remove_entry(srg_xcodebuild_derived_data_path, true) } +end + def srg_run_tests(devices, test_builds) devices.each do |device| test_builds.each do |test_build| @@ -82,7 +87,8 @@ def srg_xcodebuild(device, test_build) workspace: srg_xcodebuild_workspace(test_build), scheme: srg_xcodebuild_scheme(test_build), destination: srg_xcodebuild_destination(device), - result_bundle_path: srg_xcodebuild_result_bundle_path(device, test_build) + result_bundle_path: srg_xcodebuild_result_bundle_path(device, test_build), + derivedDataPath: srg_xcodebuild_derived_data_path ) end @@ -102,6 +108,10 @@ def srg_xcodebuild_result_bundle_path(device, test_build) result_bundle_folder_path + test_build.scheme + '-' + device.platform end +def srg_xcodebuild_derived_data_path + '.build/DerivedData' +end + # Convert xcresults to JUnit files def srg_trainer trainer( From 0218fd6d32d31e27e312b9656b4a25bb00d6e402 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Thu, 4 Mar 2021 02:37:54 +0100 Subject: [PATCH 5/6] Add "DidCancelLogin" notification for tvOS login view controller --- Sources/SRGIdentity/SRGIdentityService.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/SRGIdentity/SRGIdentityService.m b/Sources/SRGIdentity/SRGIdentityService.m index eff3de9..6c1136f 100644 --- a/Sources/SRGIdentity/SRGIdentityService.m +++ b/Sources/SRGIdentity/SRGIdentityService.m @@ -324,6 +324,12 @@ - (BOOL)loginWithEmailAddress:(NSString *)emailAddress [self handleSessionToken:sessionToken]; } dismissalBlock:^{ s_loggingIn = NO; + + if (! self.sessionToken) { + [[NSNotificationCenter defaultCenter] postNotificationName:SRGIdentityServiceUserDidCancelLoginNotification + object:self + userInfo:nil]; + } }]; [topViewController presentViewController:loginViewController animated:YES completion:nil]; #endif From 01ff89317497de79449219a39b673e8ddbbfde72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 26 Mar 2021 16:22:52 +0100 Subject: [PATCH 6/6] Update with Xcode 12.4 --- Demo/SRGIdentity-demo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/SRGIdentity-demo.xcscheme | 2 +- Tests/SRGIdentity-tests.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/SRGIdentity-tests.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Demo/SRGIdentity-demo.xcodeproj/project.pbxproj b/Demo/SRGIdentity-demo.xcodeproj/project.pbxproj index ad94b7e..71ed64f 100644 --- a/Demo/SRGIdentity-demo.xcodeproj/project.pbxproj +++ b/Demo/SRGIdentity-demo.xcodeproj/project.pbxproj @@ -186,7 +186,7 @@ 6F0EB52820FC7F58009C02CF /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1220; + LastUpgradeCheck = 1240; ORGANIZATIONNAME = "SRG SSR"; TargetAttributes = { 6F8A93D720FDCA0800AA6434 = { diff --git a/Demo/SRGIdentity-demo.xcodeproj/xcshareddata/xcschemes/SRGIdentity-demo.xcscheme b/Demo/SRGIdentity-demo.xcodeproj/xcshareddata/xcschemes/SRGIdentity-demo.xcscheme index 889d9b8..3a38ca2 100644 --- a/Demo/SRGIdentity-demo.xcodeproj/xcshareddata/xcschemes/SRGIdentity-demo.xcscheme +++ b/Demo/SRGIdentity-demo.xcodeproj/xcshareddata/xcschemes/SRGIdentity-demo.xcscheme @@ -1,6 +1,6 @@