Skip to content

Commit

Permalink
Merge branch 'release/simplye/3.8.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Fan committed Jul 5, 2022
2 parents cc82221 + 7ddb7a7 commit 4cb3584
Show file tree
Hide file tree
Showing 78 changed files with 971 additions and 438 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/archive-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- feature/**
jobs:
version-check:
runs-on: macOS-11
runs-on: macOS-12
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }}
steps:
Expand Down Expand Up @@ -40,13 +40,13 @@ jobs:
simplye_changed: ${{ steps.detectapp.outputs.simplye_changed }}
openebooks_changed: ${{ steps.detectapp.outputs.openebooks_changed }}
upload-arc:
runs-on: macOS-11
runs-on: macOS-12
needs: version-check
if: needs.version-check.outputs.simplye_changed == '1' || needs.version-check.outputs.openebooks_changed == '1'
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }}
steps:
- name: Force Xcode 13.1
- name: Force Xcode 13.3.1
run: sudo xcode-select -switch /Applications/Xcode_13.1.app
- name: Install Firebase Tools
run: npm install -g firebase-tools
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/non-drm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
pull_request:
jobs:
build:
runs-on: macOS-11
runs-on: macOS-12
steps:
- name: Check available Xcodes
run: ls -la /Applications
- name: Force Xcode 13.1
- name: Force Xcode 13.3.1
run: sudo xcode-select -switch /Applications/Xcode_13.1.app
- name: Checkout main repo
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
pull_request:
jobs:
build-and-test:
runs-on: macOS-11
runs-on: macOS-12
if: github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }}
steps:
- name: Force Xcode 13.1
- name: Force Xcode 13.3.1
run: sudo xcode-select -switch /Applications/Xcode_13.1.app
- name: Print System Info
run: uname -a
Expand Down
2 changes: 1 addition & 1 deletion Axis-iOS
2 changes: 1 addition & 1 deletion CardCreator-iOS
2 changes: 1 addition & 1 deletion NYPLAEToolkit
2 changes: 1 addition & 1 deletion RDServices.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
118A0E201992B3FD00792DDE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1310;
LastUpgradeCheck = 1330;
ORGANIZATIONNAME = Readium;
};
buildConfigurationList = 118A0E231992B3FD00792DDE /* Build configuration list for PBXProject "RDServices" */;
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 = "1310"
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
82 changes: 50 additions & 32 deletions Simplified.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/NYPL-Simplified/iOS-Utilities",
"state": {
"branch": "main",
"revision": "358380251b3f08b4414160e7e6863d14f4249294",
"revision": "92ba3eae4339d03a22e682faee6edc749a089933",
"version": null
}
},
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 = "1310"
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "1310"
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "1310"
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "1310"
LastUpgradeVersion = "1330"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Simplified/Accounts/Library/AccountsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let currentAccountIdentifierKey = "NYPLCurrentAccountIdentifier"
static let NYPLAccountUUIDs = [
"urn:uuid:065c0c11-0d0f-42a3-82e4-277b18786949", //NYPL proper
"urn:uuid:edef2358-9f6a-4ce6-b64f-9b351ec68ac4", //Brooklyn
"urn:uuid:56906f26-2c9a-4ae9-bd02-552557720b99" //Simplified Instant Classics
"urn:uuid:56906f26-2c9a-4ae9-bd02-552557720b99" //Books for All
]

let NYPLAccountUUID = AccountsManager.NYPLAccountUUIDs[0]
Expand Down
31 changes: 22 additions & 9 deletions Simplified/Accounts/User/NYPLUserAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,12 @@ private enum StorageKey: String {

_credentials.write(newValue)

// make sure to set the barcode related to the current account (aka library)
// not the one we just signed in to, because we could have signed in into
// library A, but still browsing the catalog of library B.
if case let .barcodeAndPin(barcode: userBarcode, pin: _) = newValue {
NYPLErrorLogger.setUserID(userBarcode)
}
setCrashReportingUserID(barcode)

notifyAccountDidChange()
}
}


/// At all times, this returns the current user account.
///
/// - Important: Do not attempt to manually create an instance of
Expand All @@ -189,7 +183,16 @@ private enum StorageKey: String {
// document has been loaded.
return sharedAccount(libraryUUID: AccountsManager.shared.currentAccountId)
}


/// CHANGES the user account singleton to work as the user account for the
/// given library.
///
/// This function is deprecated.
///
/// - Important: This "getter" function has side effects. Avoid using it.
/// - Parameter libraryUUID: The UUID of the library.
/// - Returns: The shared NYPLUserAccount instance with its libraryUUID
/// changed to match the one provided in input.
class func sharedAccount(libraryUUID: String?) -> NYPLUserAccount {
shared.accountInfoLock.lock()
defer {
Expand Down Expand Up @@ -512,10 +515,20 @@ private enum StorageKey: String {
_deviceID.write(id)
notifyAccountDidChange()
}


private func setCrashReportingUserID(_ userID: String?) {
// make sure to set the barcode related to the current account (aka library)
// not the one we just signed in to, because we could have signed in into
// library A, but still browsing the catalog of library B.
if libraryUUID == AccountsManager.shared.currentAccountId {
NYPLErrorLogger.setUserID(userID)
}
}

// MARK: - Remove

func removeAll() {
setCrashReportingUserID(nil)
keychainTransaction.perform {
_adobeToken.write(nil)
_patron.write(nil)
Expand Down
6 changes: 4 additions & 2 deletions Simplified/AppInfrastructure/NYPLAppDelegate+OE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import Foundation
extension NYPLAppDelegate {
@objc func setUpRootVC() {
if NYPLSettings.shared.userHasAcceptedEULA {
if NYPLSettings.shared.userHasSeenWelcomeScreen {
if NYPLSettings.shared.userHasSeenWelcomeScreen,
NYPLUserAccount.sharedAccount().isSignedIn()
{
window.rootViewController = NYPLRootTabBarController.shared()
} else {
window.rootViewController = OETutorialViewController()
Expand All @@ -35,7 +37,7 @@ extension NYPLAppDelegate {
}

@objc func completeBecomingActive() {
if !NYPLUserAccount.sharedAccount().hasCredentials()
if !NYPLUserAccount.sharedAccount().isSignedIn()
&& NYPLSettings.shared.userHasSeenWelcomeScreen
&& !isSigningIn {

Expand Down
1 change: 0 additions & 1 deletion Simplified/AppInfrastructure/NYPLAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#import "SimplyE-Swift.h"

#import "NYPLConfiguration.h"
#import "NYPLBookRegistry.h"
#import "NYPLReachability.h"
#import "NYPLReaderSettings.h"
Expand Down
9 changes: 9 additions & 0 deletions Simplified/AppInfrastructure/NYPLConfiguration+Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,13 @@ private enum ColorAsset: String {

return .black
}

static var transparentBackgroundColor: UIColor {
if #available(iOS 12.0, *),
UIScreen.main.traitCollection.userInterfaceStyle == .dark {
return UIColor(white: 0.2, alpha: 0.7)
} else {
return UIColor(white: 0, alpha: 0.7)
}
}
}
4 changes: 2 additions & 2 deletions Simplified/AppInfrastructure/NYPLConfiguration+OE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ extension NYPLConfiguration {

static func welcomeScreenFont() -> UIFont? {
if UIDevice.current.userInterfaceIdiom == .phone {
return UIFont(name: NYPLConfiguration.systemFontFamilyName(),
return UIFont(name: NYPLConfiguration.systemFontFamilyName,
size: 16.0)
}
return UIFont(name: NYPLConfiguration.systemFontFamilyName(), size: 22.0)
return UIFont(name: NYPLConfiguration.systemFontFamilyName, size: 22.0)
}
}
39 changes: 0 additions & 39 deletions Simplified/AppInfrastructure/NYPLConfiguration.h

This file was deleted.

96 changes: 0 additions & 96 deletions Simplified/AppInfrastructure/NYPLConfiguration.m

This file was deleted.

Loading

0 comments on commit 4cb3584

Please sign in to comment.