Skip to content

Commit

Permalink
Merge branch 'release/3.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos committed Mar 26, 2021
2 parents 4b5db11 + 01ff893 commit a5ab9cc
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Demo/Demo.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Version information
MARKETING_VERSION = 3.0.3
MARKETING_VERSION = 3.0.4

// Deployment targets
IPHONEOS_DEPLOYMENT_TARGET = 9.0
Expand Down
2 changes: 1 addition & 1 deletion Demo/SRGIdentity-demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
6F0EB52820FC7F58009C02CF /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1220;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "SRG SSR";
TargetAttributes = {
6F8A93D720FDCA0800AA6434 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
26 changes: 24 additions & 2 deletions Sources/SRGIdentity/SRGIdentityLoginViewController~tvos.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@import SRGAppearance;
@import SRGNetwork;

@interface SRGIdentityLoginViewController ()
@interface SRGIdentityLoginViewController () <UITextFieldDelegate>

@property (nonatomic, copy) NSString *emailAddress;
@property (nonatomic) NSURL *webserviceURL;
Expand Down Expand Up @@ -76,6 +76,18 @@ - (void)viewDidDisappear:(BOOL)animated
}
}

#pragma mark Focus management

- (NSArray<id<UIFocusEnvironment>> *)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
Expand Down Expand Up @@ -130,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;
Expand All @@ -145,6 +158,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;
Expand Down Expand Up @@ -253,6 +267,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
Expand Down
6 changes: 6 additions & 0 deletions Sources/SRGIdentity/SRGIdentityService.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tests/SRGIdentity-tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
6F0EB52820FC7F58009C02CF /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1220;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "SRG SSR";
TargetAttributes = {
0826662D216E2B7200FD8E84 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 11 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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|
Expand All @@ -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

Expand All @@ -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(
Expand Down

0 comments on commit a5ab9cc

Please sign in to comment.