From 4cce16d57247571c968d684c5eb4300093bd6604 Mon Sep 17 00:00:00 2001 From: Stepik Bot Date: Wed, 13 Apr 2022 03:01:22 +0000 Subject: [PATCH 01/43] "Set version to 1.218 & bump build" --- Stepic.xcodeproj/project.pbxproj | 24 +++++++++++----------- Stepic/Info-Develop.plist | 4 ++-- Stepic/Info-Production.plist | 4 ++-- Stepic/Info-Release.plist | 4 ++-- StepicTests/Info-Develop.plist | 4 ++-- StepicTests/Info-Production.plist | 4 ++-- StepicTests/Info-Release.plist | 4 ++-- StickerPackExtension/Info-Develop.plist | 4 ++-- StickerPackExtension/Info-Production.plist | 4 ++-- StickerPackExtension/Info-Release.plist | 4 ++-- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index e7e938ccdb..4e2dbb4e45 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -13189,7 +13189,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; @@ -13214,7 +13214,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -13356,7 +13356,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; INFOPLIST_FILE = "Stepic/Info-Production.plist"; @@ -13386,7 +13386,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -13477,7 +13477,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13529,7 +13529,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; @@ -13610,7 +13610,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13658,7 +13658,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -14178,7 +14178,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14232,7 +14232,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; @@ -14314,7 +14314,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = YES; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14362,7 +14362,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 429; + CURRENT_PROJECT_VERSION = 430; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; diff --git a/Stepic/Info-Develop.plist b/Stepic/Info-Develop.plist index 483d4df705..d741ac6725 100644 --- a/Stepic/Info-Develop.plist +++ b/Stepic/Info-Develop.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.217-develop + 1.218-develop CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 429 + 430 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Production.plist b/Stepic/Info-Production.plist index 1c6d10284a..aecca9ecc4 100644 --- a/Stepic/Info-Production.plist +++ b/Stepic/Info-Production.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.217 + 1.218 CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 429 + 430 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Release.plist b/Stepic/Info-Release.plist index ae3ecd296d..ed80b87ffe 100644 --- a/Stepic/Info-Release.plist +++ b/Stepic/Info-Release.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.217-release + 1.218-release CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 429 + 430 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/StepicTests/Info-Develop.plist b/StepicTests/Info-Develop.plist index 8309689ca3..bea5f88a51 100644 --- a/StepicTests/Info-Develop.plist +++ b/StepicTests/Info-Develop.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.217-develop + 1.218-develop CFBundleSignature ???? CFBundleVersion - 429 + 430 diff --git a/StepicTests/Info-Production.plist b/StepicTests/Info-Production.plist index 8ac6ff00e8..26ab624a36 100644 --- a/StepicTests/Info-Production.plist +++ b/StepicTests/Info-Production.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.217 + 1.218 CFBundleSignature ???? CFBundleVersion - 429 + 430 diff --git a/StepicTests/Info-Release.plist b/StepicTests/Info-Release.plist index 8a0b4b4759..d6ee262d48 100644 --- a/StepicTests/Info-Release.plist +++ b/StepicTests/Info-Release.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.217-release + 1.218-release CFBundleSignature ???? CFBundleVersion - 429 + 430 diff --git a/StickerPackExtension/Info-Develop.plist b/StickerPackExtension/Info-Develop.plist index 49e84ef8fe..a1fda89646 100644 --- a/StickerPackExtension/Info-Develop.plist +++ b/StickerPackExtension/Info-Develop.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.217-develop + 1.218-develop CFBundleVersion - 429 + 430 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Production.plist b/StickerPackExtension/Info-Production.plist index 2f2acf4d3e..60f6e7f588 100644 --- a/StickerPackExtension/Info-Production.plist +++ b/StickerPackExtension/Info-Production.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.217 + 1.218 CFBundleVersion - 429 + 430 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Release.plist b/StickerPackExtension/Info-Release.plist index 5f8b8d1e93..8e72c32154 100644 --- a/StickerPackExtension/Info-Release.plist +++ b/StickerPackExtension/Info-Release.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.217-release + 1.218-release CFBundleVersion - 429 + 430 UIRequiredDeviceCapabilities arm64 From 8c80c931bdec941d2e85fe1e7c9f1ce5995fd71e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 16:53:52 +0300 Subject: [PATCH 02/43] bundler: bump fastlane from 2.205.1 to 2.205.2 (#1146) Bumps [fastlane](https://github.com/fastlane/fastlane) from 2.205.1 to 2.205.2. - [Release notes](https://github.com/fastlane/fastlane/releases) - [Commits](https://github.com/fastlane/fastlane/compare/fastlane/2.205.1...fastlane/2.205.2) --- updated-dependencies: - dependency-name: fastlane dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index c317e63785..319adcad85 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" ruby "2.6.5" -gem "fastlane", "2.205.1" +gem "fastlane", "2.205.2" gem "cocoapods", "1.11.3" gem "generamba", "1.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index a56f675141..9af71ac985 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,20 +17,20 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.573.0) - aws-sdk-core (3.130.0) + aws-partitions (1.579.0) + aws-sdk-core (3.130.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.55.0) + aws-sdk-kms (1.56.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.113.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.4.0) + aws-sigv4 (1.5.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -116,7 +116,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.205.1) + fastlane (2.205.2) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -168,7 +168,7 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.18.0) + google-apis-androidpublisher_v3 (0.19.0) google-apis-core (>= 0.4, < 2.a) google-apis-core (0.4.2) addressable (~> 2.5, >= 2.5.1) @@ -183,7 +183,7 @@ GEM google-apis-core (>= 0.4, < 2.a) google-apis-playcustomapp_v1 (0.7.0) google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.12.0) + google-apis-storage_v1 (0.13.0) google-apis-core (>= 0.4, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) @@ -191,7 +191,7 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.2.0) - google-cloud-storage (1.36.1) + google-cloud-storage (1.36.2) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) @@ -199,7 +199,7 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.1.2) + googleauth (1.1.3) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -230,7 +230,7 @@ GEM optparse (0.1.1) os (1.1.4) plist (3.6.0) - public_suffix (4.0.6) + public_suffix (4.0.7) rake (13.0.6) representable (3.1.1) declarative (< 0.1.0) @@ -287,7 +287,7 @@ PLATFORMS DEPENDENCIES cocoapods (= 1.11.3) - fastlane (= 2.205.1) + fastlane (= 2.205.2) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) From 166ff7811176dd3b85fd89bddb925e4d7b744359 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Tue, 26 Apr 2022 20:54:56 +0700 Subject: [PATCH 03/43] Run bundle update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9af71ac985..c0680a3e3b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,7 +26,7 @@ GEM aws-sdk-kms (1.56.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.113.0) + aws-sdk-s3 (1.113.1) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) @@ -155,7 +155,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.3.3) + fastlane-plugin-firebase_app_distribution (0.3.4) ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) From 2ff270c8e5a28f0e205e0c71e30e6c75b381372c Mon Sep 17 00:00:00 2001 From: Anna Falileeva <63070737+annafalileeva@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:11:50 +0300 Subject: [PATCH 04/43] refactor ui tests (#1148) * refactor ui tests * Add AccessibilityIdentifiers * Improvements * Clean up Co-authored-by: Anna Falileeva Co-authored-by: Ivan Magda --- Stepic.xcodeproj/project.pbxproj | 143 ++++++++-- .../Onboarding/Onboarding.storyboard | 5 +- .../OnboardingPageView.swift | 2 + .../Onboarding/OnboardingViewController.swift | 3 + .../StepikPlaceholderView.swift | 3 +- .../AuthEmail/EmailAuthViewController.swift | 4 + .../AuthSocial/SocialAuthViewController.swift | 3 + .../RegistrationViewController.swift | 7 +- .../StyledTabBarViewController.swift | 32 ++- .../SettingsTable/SettingsTableView.swift | 1 + .../SettingsTableViewModel.swift | 3 + .../NewProfile/NewProfileViewController.swift | 2 + StepicUITests/Sources/Common.swift | 143 ---------- .../Sources/Common/CommonActions.swift | 56 ++++ StepicUITests/Sources/LoginUITests.swift | 176 ------------ .../Model/AccessibilityIdentifiers.swift | 73 +++++ StepicUITests/Sources/Model/AppName.swift | 11 + StepicUITests/Sources/Model/Constants.swift | 9 + StepicUITests/Sources/Pages/AuthScreen.swift | 34 +++ StepicUITests/Sources/Pages/BaseScreen.swift | 25 ++ .../Sources/Pages/CatalogScreen.swift | 22 ++ .../Sources/Pages/GoogleAuthScreen.swift | 26 ++ StepicUITests/Sources/Pages/LogInScreen.swift | 18 ++ .../Sources/Pages/MainNavigationTabs.swift | 17 ++ .../Sources/Pages/OnboardingScreen.swift | 17 ++ .../Sources/Pages/ProfileScreen.swift | 39 +++ .../Sources/Pages/RegisterScreen.swift | 21 ++ StepicUITests/Sources/Tests/BaseTest.swift | 24 ++ .../Sources/Tests/CatalogTests.swift | 38 +++ StepicUITests/Sources/Tests/LoginTests.swift | 53 ++++ .../Sources/Tests/OnboardingTests.swift | 45 ++++ .../Sources/Tests/RegisterTests.swift | 46 ++++ .../Sources/UnregisteredUITests.swift | 250 ------------------ autocorrect.sh | 2 +- lint.sh | 2 +- 35 files changed, 752 insertions(+), 603 deletions(-) delete mode 100644 StepicUITests/Sources/Common.swift create mode 100644 StepicUITests/Sources/Common/CommonActions.swift delete mode 100644 StepicUITests/Sources/LoginUITests.swift create mode 100644 StepicUITests/Sources/Model/AccessibilityIdentifiers.swift create mode 100644 StepicUITests/Sources/Model/AppName.swift create mode 100644 StepicUITests/Sources/Model/Constants.swift create mode 100644 StepicUITests/Sources/Pages/AuthScreen.swift create mode 100644 StepicUITests/Sources/Pages/BaseScreen.swift create mode 100644 StepicUITests/Sources/Pages/CatalogScreen.swift create mode 100644 StepicUITests/Sources/Pages/GoogleAuthScreen.swift create mode 100644 StepicUITests/Sources/Pages/LogInScreen.swift create mode 100644 StepicUITests/Sources/Pages/MainNavigationTabs.swift create mode 100644 StepicUITests/Sources/Pages/OnboardingScreen.swift create mode 100644 StepicUITests/Sources/Pages/ProfileScreen.swift create mode 100644 StepicUITests/Sources/Pages/RegisterScreen.swift create mode 100644 StepicUITests/Sources/Tests/BaseTest.swift create mode 100644 StepicUITests/Sources/Tests/CatalogTests.swift create mode 100644 StepicUITests/Sources/Tests/LoginTests.swift create mode 100644 StepicUITests/Sources/Tests/OnboardingTests.swift create mode 100644 StepicUITests/Sources/Tests/RegisterTests.swift delete mode 100644 StepicUITests/Sources/UnregisteredUITests.swift diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index e7e938ccdb..41aec6b8e1 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -1169,6 +1169,9 @@ 2CE664E420F5207A0082F3FE /* DownloaderTaskProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE664E020F520790082F3FE /* DownloaderTaskProtocol.swift */; }; 2CE664E520F5207A0082F3FE /* DownloaderTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE664E120F520790082F3FE /* DownloaderTask.swift */; }; 2CE664E620F5207A0082F3FE /* DownloaderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE664E220F5207A0082F3FE /* DownloaderProtocol.swift */; }; + 2CE6C1072840712800631636 /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE6C1062840712800631636 /* AccessibilityIdentifiers.swift */; }; + 2CE6C1082840713700631636 /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE6C1062840712800631636 /* AccessibilityIdentifiers.swift */; }; + 2CE6C10A284076E300631636 /* AppName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE6C109284076E300631636 /* AppName.swift */; }; 2CE770062625AAED00D5DD1F /* PurchaseCourseLocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE770052625AAED00D5DD1F /* PurchaseCourseLocalNotification.swift */; }; 2CE8390820C7F16700FE3672 /* ContentMenuBlockTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE8390620C7F16700FE3672 /* ContentMenuBlockTableViewCell.swift */; }; 2CE8390920C7F16700FE3672 /* ContentMenuBlockTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CE8390720C7F16700FE3672 /* ContentMenuBlockTableViewCell.xib */; }; @@ -1258,6 +1261,8 @@ 2CFC5ABC228ADFC400B5248A /* StepsPersistenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFC5ABB228ADFC400B5248A /* StepsPersistenceService.swift */; }; 2CFDB1241F559F9A00B8035C /* AvatarImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFDB1231F559F9A00B8035C /* AvatarImageView.swift */; }; 2CFE6A84255AA6DE00A43952 /* CatalogBlockContentItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFE6A83255AA6DE00A43952 /* CatalogBlockContentItemTests.swift */; }; + 2CFE9AE1284F95590009BF84 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFE9AE0284F95590009BF84 /* Constants.swift */; }; + 2CFE9AE5284F9F2F0009BF84 /* CommonActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFE9AE4284F9F2F0009BF84 /* CommonActions.swift */; }; 2CFED65F252C5AC900FCAD41 /* Result+Stepik.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFED65E252C5AC900FCAD41 /* Result+Stepik.swift */; }; 2CFED66E252C649400FCAD41 /* DiscussionsTableViewDataSourceDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFED66D252C649400FCAD41 /* DiscussionsTableViewDataSourceDelegate.swift */; }; 2CFF2B21260B3AAA0040821A /* WebCacheCleaner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CFF2B20260B3AAA0040821A /* WebCacheCleaner.swift */; }; @@ -1811,9 +1816,20 @@ 7EBAD8337C302E2147741450 /* CourseBenefitDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8744553C2B3C12884F84BFD9 /* CourseBenefitDetailViewController.swift */; }; 7ED87AD657E488FBD3C0D88E /* StepikAcademyCourseListDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A25E416101A848548101C7DA /* StepikAcademyCourseListDataFlow.swift */; }; 81AADBF0C345BFDB7176221D /* WishlistWidgetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78AA738A584651A3F55AD9DB /* WishlistWidgetViewController.swift */; }; - 8489EE7725FAF13B004A85C5 /* UnregisteredUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8489EE7625FAF13B004A85C5 /* UnregisteredUITests.swift */; }; - 8489EEE425FFBE8E004A85C5 /* Common.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8489EEE325FFBE8E004A85C5 /* Common.swift */; }; - 84FA5057262F204400603346 /* LoginUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84FA5056262F204400603346 /* LoginUITests.swift */; }; + 8430ABA328362AF00071DD46 /* MainNavigationTabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABA228362AF00071DD46 /* MainNavigationTabs.swift */; }; + 8430ABA52836324E0071DD46 /* ProfileScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABA42836324E0071DD46 /* ProfileScreen.swift */; }; + 8430ABA728364DAA0071DD46 /* LogInScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABA628364DAA0071DD46 /* LogInScreen.swift */; }; + 8430ABA9283B983C0071DD46 /* LoginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABA8283B983C0071DD46 /* LoginTests.swift */; }; + 8430ABAB283BA2380071DD46 /* RegisterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABAA283BA2380071DD46 /* RegisterTests.swift */; }; + 8430ABAD283BA9A10071DD46 /* RegisterScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABAC283BA9A10071DD46 /* RegisterScreen.swift */; }; + 8430ABAF283E31540071DD46 /* AuthScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABAE283E31540071DD46 /* AuthScreen.swift */; }; + 8430ABB1283E40920071DD46 /* GoogleAuthScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABB0283E40920071DD46 /* GoogleAuthScreen.swift */; }; + 8430ABB3283E57880071DD46 /* CatalogScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABB2283E57880071DD46 /* CatalogScreen.swift */; }; + 8430ABB5283E57A00071DD46 /* CatalogTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8430ABB4283E57A00071DD46 /* CatalogTests.swift */; }; + 8446E2D52810120D00981577 /* BaseScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446E2D42810120D00981577 /* BaseScreen.swift */; }; + 8446E2D92817DA4A00981577 /* OnboardingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446E2D82817DA4A00981577 /* OnboardingScreen.swift */; }; + 8446E2DC2818012100981577 /* BaseTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446E2DB2818012100981577 /* BaseTest.swift */; }; + 8446E2DE2818020F00981577 /* OnboardingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446E2DD2818020F00981577 /* OnboardingTests.swift */; }; 85CFA575736E6C0570D48065 /* UserCoursesReviewsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3ED7422D4B76AAD73F35E6E /* UserCoursesReviewsInteractor.swift */; }; 861B96371FE1DF7F00773EDA /* CAGradientLayer+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861B96361FE1DF7F00773EDA /* CAGradientLayer+Init.swift */; }; 8622056B2055561F00F14255 /* PinsMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8622056A2055561F00F14255 /* PinsMapView.swift */; }; @@ -3253,6 +3269,8 @@ 2CE664E020F520790082F3FE /* DownloaderTaskProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTaskProtocol.swift; sourceTree = ""; }; 2CE664E120F520790082F3FE /* DownloaderTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderTask.swift; sourceTree = ""; }; 2CE664E220F5207A0082F3FE /* DownloaderProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderProtocol.swift; sourceTree = ""; }; + 2CE6C1062840712800631636 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; + 2CE6C109284076E300631636 /* AppName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppName.swift; sourceTree = ""; }; 2CE770052625AAED00D5DD1F /* PurchaseCourseLocalNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaseCourseLocalNotification.swift; sourceTree = ""; }; 2CE8390620C7F16700FE3672 /* ContentMenuBlockTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentMenuBlockTableViewCell.swift; sourceTree = ""; }; 2CE8390720C7F16700FE3672 /* ContentMenuBlockTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ContentMenuBlockTableViewCell.xib; sourceTree = ""; }; @@ -3350,6 +3368,8 @@ 2CFDA8181FBB3CFD0098A441 /* Model_sections_with_course_id_v21.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_sections_with_course_id_v21.xcdatamodel; sourceTree = ""; }; 2CFDB1231F559F9A00B8035C /* AvatarImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AvatarImageView.swift; sourceTree = ""; }; 2CFE6A83255AA6DE00A43952 /* CatalogBlockContentItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatalogBlockContentItemTests.swift; sourceTree = ""; }; + 2CFE9AE0284F95590009BF84 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + 2CFE9AE4284F9F2F0009BF84 /* CommonActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonActions.swift; sourceTree = ""; }; 2CFED65E252C5AC900FCAD41 /* Result+Stepik.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Result+Stepik.swift"; sourceTree = ""; }; 2CFED66D252C649400FCAD41 /* DiscussionsTableViewDataSourceDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscussionsTableViewDataSourceDelegate.swift; sourceTree = ""; }; 2CFF2B20260B3AAA0040821A /* WebCacheCleaner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebCacheCleaner.swift; sourceTree = ""; }; @@ -3910,10 +3930,21 @@ 812902FE72DE5F64FCC48841 /* CourseBenefitDetailView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CourseBenefitDetailView.swift; sourceTree = ""; }; 81AA980E65D068EB9A20F675 /* LessonFinishedStepsPanModalDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LessonFinishedStepsPanModalDataFlow.swift; sourceTree = ""; }; 83BC8E57E212C4D980F78B79 /* CourseRevenueTabPurchasesDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CourseRevenueTabPurchasesDataFlow.swift; sourceTree = ""; }; + 8430ABA228362AF00071DD46 /* MainNavigationTabs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainNavigationTabs.swift; sourceTree = ""; }; + 8430ABA42836324E0071DD46 /* ProfileScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileScreen.swift; sourceTree = ""; }; + 8430ABA628364DAA0071DD46 /* LogInScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogInScreen.swift; sourceTree = ""; }; + 8430ABA8283B983C0071DD46 /* LoginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginTests.swift; sourceTree = ""; }; + 8430ABAA283BA2380071DD46 /* RegisterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterTests.swift; sourceTree = ""; }; + 8430ABAC283BA9A10071DD46 /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterScreen.swift; sourceTree = ""; }; + 8430ABAE283E31540071DD46 /* AuthScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthScreen.swift; sourceTree = ""; }; + 8430ABB0283E40920071DD46 /* GoogleAuthScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleAuthScreen.swift; sourceTree = ""; }; + 8430ABB2283E57880071DD46 /* CatalogScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatalogScreen.swift; sourceTree = ""; }; + 8430ABB4283E57A00071DD46 /* CatalogTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatalogTests.swift; sourceTree = ""; }; + 8446E2D42810120D00981577 /* BaseScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseScreen.swift; sourceTree = ""; }; + 8446E2D82817DA4A00981577 /* OnboardingScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingScreen.swift; sourceTree = ""; }; + 8446E2DB2818012100981577 /* BaseTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTest.swift; sourceTree = ""; }; + 8446E2DD2818020F00981577 /* OnboardingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingTests.swift; sourceTree = ""; }; 8489EE7425FAF13A004A85C5 /* StepicUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StepicUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 8489EE7625FAF13B004A85C5 /* UnregisteredUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnregisteredUITests.swift; sourceTree = ""; }; - 8489EEE325FFBE8E004A85C5 /* Common.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Common.swift; sourceTree = ""; }; - 84FA5056262F204400603346 /* LoginUITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginUITests.swift; sourceTree = ""; }; 85424A5DCFCD1768BD36AD45 /* CourseBenefitDetailInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CourseBenefitDetailInteractor.swift; sourceTree = ""; }; 858D7264845A798247AE1350 /* UserCoursesReviewsDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserCoursesReviewsDataFlow.swift; sourceTree = ""; }; 861B96361FE1DF7F00773EDA /* CAGradientLayer+Init.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CAGradientLayer+Init.swift"; sourceTree = ""; }; @@ -5048,16 +5079,6 @@ name = Resources; sourceTree = ""; }; - 2C67075325FF845B00B18163 /* Sources */ = { - isa = PBXGroup; - children = ( - 8489EEE325FFBE8E004A85C5 /* Common.swift */, - 84FA5056262F204400603346 /* LoginUITests.swift */, - 8489EE7625FAF13B004A85C5 /* UnregisteredUITests.swift */, - ); - path = Sources; - sourceTree = ""; - }; 2C67B5A027270A5700AC4E07 /* EditSplitTests */ = { isa = PBXGroup; children = ( @@ -7395,6 +7416,24 @@ path = Views; sourceTree = ""; }; + 2CFE9AE2284F9E630009BF84 /* Model */ = { + isa = PBXGroup; + children = ( + 2CE6C1062840712800631636 /* AccessibilityIdentifiers.swift */, + 2CE6C109284076E300631636 /* AppName.swift */, + 2CFE9AE0284F95590009BF84 /* Constants.swift */, + ); + path = Model; + sourceTree = ""; + }; + 2CFE9AE3284F9E760009BF84 /* Common */ = { + isa = PBXGroup; + children = ( + 2CFE9AE4284F9F2F0009BF84 /* CommonActions.swift */, + ); + path = Common; + sourceTree = ""; + }; 2CFED669252C647900FCAD41 /* TableViewDataSource */ = { isa = PBXGroup; children = ( @@ -10045,6 +10084,45 @@ path = CourseRevenueTabPurchases; sourceTree = ""; }; + 8430ABB9283E7CAA0071DD46 /* Sources */ = { + isa = PBXGroup; + children = ( + 2CFE9AE3284F9E760009BF84 /* Common */, + 2CFE9AE2284F9E630009BF84 /* Model */, + 8446E2D32810119800981577 /* Pages */, + 8446E2DA2817FD0500981577 /* Tests */, + ); + path = Sources; + sourceTree = ""; + }; + 8446E2D32810119800981577 /* Pages */ = { + isa = PBXGroup; + children = ( + 8430ABAE283E31540071DD46 /* AuthScreen.swift */, + 8446E2D42810120D00981577 /* BaseScreen.swift */, + 8430ABB2283E57880071DD46 /* CatalogScreen.swift */, + 8430ABB0283E40920071DD46 /* GoogleAuthScreen.swift */, + 8430ABA628364DAA0071DD46 /* LogInScreen.swift */, + 8430ABA228362AF00071DD46 /* MainNavigationTabs.swift */, + 8446E2D82817DA4A00981577 /* OnboardingScreen.swift */, + 8430ABA42836324E0071DD46 /* ProfileScreen.swift */, + 8430ABAC283BA9A10071DD46 /* RegisterScreen.swift */, + ); + path = Pages; + sourceTree = ""; + }; + 8446E2DA2817FD0500981577 /* Tests */ = { + isa = PBXGroup; + children = ( + 8446E2DB2818012100981577 /* BaseTest.swift */, + 8430ABB4283E57A00071DD46 /* CatalogTests.swift */, + 8430ABA8283B983C0071DD46 /* LoginTests.swift */, + 8446E2DD2818020F00981577 /* OnboardingTests.swift */, + 8430ABAA283BA2380071DD46 /* RegisterTests.swift */, + ); + path = Tests; + sourceTree = ""; + }; 847D7A7EAF0F60522A77C408 /* CertificatesList */ = { isa = PBXGroup; children = ( @@ -10064,7 +10142,7 @@ isa = PBXGroup; children = ( 2C67075125FF844400B18163 /* Resources */, - 2C67075325FF845B00B18163 /* Sources */, + 8430ABB9283E7CAA0071DD46 /* Sources */, ); path = StepicUITests; sourceTree = ""; @@ -11471,6 +11549,7 @@ 2C4391AA271994CC000770AE /* CourseInfoPurchaseModalHeaderView.swift in Sources */, 2C096583236C555D005B771A /* NSAttributedString+TrimmingCharacters.swift in Sources */, 2C50363E24C59374001FAE04 /* NewProfileCertificatesHorizontalFlowLayout.swift in Sources */, + 2CE6C1082840713700631636 /* AccessibilityIdentifiers.swift in Sources */, 2C22042C20E277F70060117A /* Skeletonable+UIView.swift in Sources */, 082B54D820AA342D00144817 /* PersonalDeadlineModeCollectionViewCell.swift in Sources */, 2C5D340225C988FA00372C61 /* PromoCodesNetworkService.swift in Sources */, @@ -12966,9 +13045,24 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8489EEE425FFBE8E004A85C5 /* Common.swift in Sources */, - 8489EE7725FAF13B004A85C5 /* UnregisteredUITests.swift in Sources */, - 84FA5057262F204400603346 /* LoginUITests.swift in Sources */, + 8446E2D92817DA4A00981577 /* OnboardingScreen.swift in Sources */, + 8430ABAB283BA2380071DD46 /* RegisterTests.swift in Sources */, + 8446E2DE2818020F00981577 /* OnboardingTests.swift in Sources */, + 8430ABA52836324E0071DD46 /* ProfileScreen.swift in Sources */, + 8430ABA9283B983C0071DD46 /* LoginTests.swift in Sources */, + 8430ABAF283E31540071DD46 /* AuthScreen.swift in Sources */, + 2CE6C1072840712800631636 /* AccessibilityIdentifiers.swift in Sources */, + 8430ABA328362AF00071DD46 /* MainNavigationTabs.swift in Sources */, + 8430ABAD283BA9A10071DD46 /* RegisterScreen.swift in Sources */, + 8430ABB1283E40920071DD46 /* GoogleAuthScreen.swift in Sources */, + 2CE6C10A284076E300631636 /* AppName.swift in Sources */, + 8430ABB5283E57A00071DD46 /* CatalogTests.swift in Sources */, + 8430ABB3283E57880071DD46 /* CatalogScreen.swift in Sources */, + 8446E2D52810120D00981577 /* BaseScreen.swift in Sources */, + 8446E2DC2818012100981577 /* BaseTest.swift in Sources */, + 2CFE9AE5284F9F2F0009BF84 /* CommonActions.swift in Sources */, + 8430ABA728364DAA0071DD46 /* LogInScreen.swift in Sources */, + 2CFE9AE1284F95590009BF84 /* Constants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -14435,7 +14529,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG PRODUCTION"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Stepic; @@ -14496,7 +14590,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG RELEASE"; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -14559,7 +14653,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG DEVELOP"; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -14621,6 +14715,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = PRODUCTION; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Stepic; @@ -14681,6 +14776,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = RELEASE; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Stepic; @@ -14741,6 +14837,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEVELOP; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Stepic; diff --git a/Stepic/Legacy/Controllers/Onboarding/Onboarding.storyboard b/Stepic/Legacy/Controllers/Onboarding/Onboarding.storyboard index a808f6ba8e..28e7313f37 100644 --- a/Stepic/Legacy/Controllers/Onboarding/Onboarding.storyboard +++ b/Stepic/Legacy/Controllers/Onboarding/Onboarding.storyboard @@ -1,9 +1,9 @@ - + - + @@ -92,6 +92,7 @@ + diff --git a/Stepic/Legacy/Controllers/Onboarding/OnboardingPageView/OnboardingPageView.swift b/Stepic/Legacy/Controllers/Onboarding/OnboardingPageView/OnboardingPageView.swift index 6ab9c53d32..76762e64a5 100644 --- a/Stepic/Legacy/Controllers/Onboarding/OnboardingPageView/OnboardingPageView.swift +++ b/Stepic/Legacy/Controllers/Onboarding/OnboardingPageView/OnboardingPageView.swift @@ -97,6 +97,8 @@ final class OnboardingPageView: NibInitializableView { pageTitleLabel.font = UIFont.systemFont(ofSize: 18, weight: UIFont.Weight.medium) pageDescriptionLabel.font = UIFont.systemFont(ofSize: 15) } + + nextButton.accessibilityIdentifier = AccessibilityIdentifiers.Onboarding.nextButton } func updateHeight(_ delta: CGFloat) { diff --git a/Stepic/Legacy/Controllers/Onboarding/OnboardingViewController.swift b/Stepic/Legacy/Controllers/Onboarding/OnboardingViewController.swift index 18fae78400..e072eb8a71 100644 --- a/Stepic/Legacy/Controllers/Onboarding/OnboardingViewController.swift +++ b/Stepic/Legacy/Controllers/Onboarding/OnboardingViewController.swift @@ -9,6 +9,7 @@ import UIKit final class OnboardingViewController: UIViewController { + @IBOutlet var closeButton: UIBarButtonItem! @IBOutlet weak var animatedView: OnboardingAnimatedView! @IBOutlet weak var mainStackView: UIStackView! @IBOutlet weak var secondStackView: UIStackView! @@ -69,6 +70,8 @@ final class OnboardingViewController: UIViewController { backgroundGradient.frame = view.bounds view.layer.insertSublayer(self.backgroundGradient, at: 0) + + closeButton.accessibilityIdentifier = AccessibilityIdentifiers.Onboarding.closeButton } override func viewDidAppear(_ animated: Bool) { diff --git a/Stepic/Legacy/Controllers/Placeholders/StepikPlaceholderView/StepikPlaceholderView.swift b/Stepic/Legacy/Controllers/Placeholders/StepikPlaceholderView/StepikPlaceholderView.swift index c56cb9d4f4..32cfed88df 100644 --- a/Stepic/Legacy/Controllers/Placeholders/StepikPlaceholderView/StepikPlaceholderView.swift +++ b/Stepic/Legacy/Controllers/Placeholders/StepikPlaceholderView/StepikPlaceholderView.swift @@ -75,7 +75,8 @@ final class StepikPlaceholderView: NibInitializableView { self.actionButton.clipsToBounds = true self.actionButton.layer.cornerRadius = 8 self.actionButton.layer.borderWidth = 0.5 - + self.actionButton.accessibilityIdentifier = AccessibilityIdentifiers.Placeholders.loginButton + self.actionButton.contentEdgeInsets = UIEdgeInsets(top: 12.0, left: 23.0, bottom: 12.0, right: 23.0) self.colorize() diff --git a/Stepic/Legacy/Controllers/RegistrationSignIn/AuthEmail/EmailAuthViewController.swift b/Stepic/Legacy/Controllers/RegistrationSignIn/AuthEmail/EmailAuthViewController.swift index a66bd1c896..55cca06a8c 100644 --- a/Stepic/Legacy/Controllers/RegistrationSignIn/AuthEmail/EmailAuthViewController.swift +++ b/Stepic/Legacy/Controllers/RegistrationSignIn/AuthEmail/EmailAuthViewController.swift @@ -175,6 +175,10 @@ final class EmailAuthViewController: UIViewController { self.emailTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) self.passwordTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) + + self.emailTextField.accessibilityIdentifier = AccessibilityIdentifiers.AuthEmail.emailTextField + self.passwordTextField.accessibilityIdentifier = AccessibilityIdentifiers.AuthEmail.passwordTextField + self.logInButton.accessibilityIdentifier = AccessibilityIdentifiers.AuthEmail.logInButton self.setup() } diff --git a/Stepic/Legacy/Controllers/RegistrationSignIn/AuthSocial/SocialAuthViewController.swift b/Stepic/Legacy/Controllers/RegistrationSignIn/AuthSocial/SocialAuthViewController.swift index 9975939b6e..ec05917b2a 100644 --- a/Stepic/Legacy/Controllers/RegistrationSignIn/AuthSocial/SocialAuthViewController.swift +++ b/Stepic/Legacy/Controllers/RegistrationSignIn/AuthSocial/SocialAuthViewController.swift @@ -160,6 +160,9 @@ final class SocialAuthViewController: UIViewController { } self.navigationItem.leftBarButtonItem = self.closeBarButtonItem + + self.signUpButton.accessibilityIdentifier = AccessibilityIdentifiers.AuthSocial.signUpButton + self.signInButton.accessibilityIdentifier = AccessibilityIdentifiers.AuthSocial.signInButton } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { diff --git a/Stepic/Legacy/Controllers/RegistrationSignIn/Registration/RegistrationViewController.swift b/Stepic/Legacy/Controllers/RegistrationSignIn/Registration/RegistrationViewController.swift index 121f669435..90e419c7d6 100644 --- a/Stepic/Legacy/Controllers/RegistrationSignIn/Registration/RegistrationViewController.swift +++ b/Stepic/Legacy/Controllers/RegistrationSignIn/Registration/RegistrationViewController.swift @@ -142,7 +142,12 @@ final class RegistrationViewController: UIViewController { self.nameTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) self.emailTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) self.passwordTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - + + self.nameTextField.accessibilityIdentifier = AccessibilityIdentifiers.Registration.nameTextField + self.emailTextField.accessibilityIdentifier = AccessibilityIdentifiers.Registration.emailTextField + self.passwordTextField.accessibilityIdentifier = AccessibilityIdentifiers.Registration.passwordTextField + self.registerButton.accessibilityIdentifier = AccessibilityIdentifiers.Registration.registerButton + self.setup() } diff --git a/Stepic/Sources/Controllers/StyledTabBarViewController.swift b/Stepic/Sources/Controllers/StyledTabBarViewController.swift index 687a38e71a..df228f30fc 100644 --- a/Stepic/Sources/Controllers/StyledTabBarViewController.swift +++ b/Stepic/Sources/Controllers/StyledTabBarViewController.swift @@ -166,10 +166,12 @@ private struct TabBarItemInfo { var image: UIImage? var selectedImage: UIImage? var tag: Int + var accessibilityIdentifier: String func makeTabBarItem() -> UITabBarItem { let item = UITabBarItem(title: self.title, image: self.image, selectedImage: self.selectedImage) item.tag = self.tag + item.accessibilityIdentifier = self.accessibilityIdentifier return item } } @@ -228,7 +230,8 @@ private enum TabController: String { controller: navigationViewController, image: personImage, selectedImage: personFillImage, - tag: self.tag + tag: self.tag, + accessibilityIdentifier: self.accessibilityIdentifier ) case .home: let viewController = HomeAssembly().makeModule() @@ -257,7 +260,8 @@ private enum TabController: String { controller: navigationViewController, image: homeImage, selectedImage: homeFillImage, - tag: self.tag + tag: self.tag, + accessibilityIdentifier: self.accessibilityIdentifier ) case .notifications: let viewController = ControllerHelper.instantiateViewController( @@ -286,7 +290,8 @@ private enum TabController: String { controller: viewController, image: notificationsImage, selectedImage: notificationsFillImage, - tag: self.tag + tag: self.tag, + accessibilityIdentifier: self.accessibilityIdentifier ) case .explore: let viewController = ExploreAssembly().makeModule() @@ -307,7 +312,8 @@ private enum TabController: String { controller: navigationViewController, image: exploreImage, selectedImage: exploreImage, - tag: self.tag + tag: self.tag, + accessibilityIdentifier: self.accessibilityIdentifier ) case .debug: let viewController = DebugMenuAssembly().makeModule() @@ -334,8 +340,24 @@ private enum TabController: String { controller: navigationViewController, image: infoImage, selectedImage: infoFillImage, - tag: self.tag + tag: self.tag, + accessibilityIdentifier: self.accessibilityIdentifier ) } } + + private var accessibilityIdentifier: String { + switch self { + case .profile: + return AccessibilityIdentifiers.TabBar.profile + case .home: + return AccessibilityIdentifiers.TabBar.home + case .notifications: + return AccessibilityIdentifiers.TabBar.notifications + case .explore: + return AccessibilityIdentifiers.TabBar.catalog + case .debug: + return AccessibilityIdentifiers.TabBar.debug + } + } } diff --git a/Stepic/Sources/Frameworks/SettingsTable/SettingsTableView.swift b/Stepic/Sources/Frameworks/SettingsTable/SettingsTableView.swift index 1f1dc79fe3..4b5d45a8c7 100644 --- a/Stepic/Sources/Frameworks/SettingsTable/SettingsTableView.swift +++ b/Stepic/Sources/Frameworks/SettingsTable/SettingsTableView.swift @@ -178,6 +178,7 @@ final class SettingsTableView: UIView { options: RightDetailCellOptions ) { cell.uniqueIdentifier = viewModel.uniqueIdentifier + cell.accessibilityIdentifier = viewModel.accessibilityIdentifier cell.accessoryType = options.accessoryType cell.elementView.title = options.title.text diff --git a/Stepic/Sources/Frameworks/SettingsTable/SettingsTableViewModel.swift b/Stepic/Sources/Frameworks/SettingsTable/SettingsTableViewModel.swift index 0b46a64022..dc4bb9d2c7 100644 --- a/Stepic/Sources/Frameworks/SettingsTable/SettingsTableViewModel.swift +++ b/Stepic/Sources/Frameworks/SettingsTable/SettingsTableViewModel.swift @@ -16,15 +16,18 @@ struct SettingsTableSectionViewModel { } let uniqueIdentifier: UniqueIdentifierType + let accessibilityIdentifier: String? let type: SettingsTableSectionCellType let appearance: Appearance init( uniqueIdentifier: UniqueIdentifierType, + accessibilityIdentifier: String? = nil, type: SettingsTableSectionCellType, appearance: Appearance = .init() ) { self.uniqueIdentifier = uniqueIdentifier + self.accessibilityIdentifier = accessibilityIdentifier ?? uniqueIdentifier self.type = type self.appearance = appearance } diff --git a/Stepic/Sources/Modules/NewProfile/NewProfileViewController.swift b/Stepic/Sources/Modules/NewProfile/NewProfileViewController.swift index b8deaa4f97..26e69ec213 100644 --- a/Stepic/Sources/Modules/NewProfile/NewProfileViewController.swift +++ b/Stepic/Sources/Modules/NewProfile/NewProfileViewController.swift @@ -135,6 +135,8 @@ final class NewProfileViewController: UIViewController, ControllerWithStepikPlac self.styledNavigationController?.removeBackButtonTitleForTopController() self.updateContentInsets() self.registerPlaceholders() + + self.settingsButton.accessibilityIdentifier = AccessibilityIdentifiers.Profile.settingsButton } private func registerPlaceholders() { diff --git a/StepicUITests/Sources/Common.swift b/StepicUITests/Sources/Common.swift deleted file mode 100644 index 9bec9c2352..0000000000 --- a/StepicUITests/Sources/Common.swift +++ /dev/null @@ -1,143 +0,0 @@ -import UIKit -import XCTest - -var currentUserName = "test" -var currentUserEmail = "test" -let kCurrentUserPassword = "512" - -enum Common { - @discardableResult - static func registerNewUserIfNeeded() -> Bool { - if currentUserEmail.contains("ios_autotest") { - return false - } - // Register new user - let timestamp = Int64(Date().timeIntervalSince1970) - - let app = XCUIApplication() - app.launch() - - app.tabBars["Tab Bar"].buttons["Profile"].tap() - - if !app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 5) { - XCTFail("No Sign In button in profile tab") - } else { - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.buttons["Sign Up"].tap() - - app.textFields["Name"].tap() - app.textFields["Name"].typeText("ios_autotest_\(timestamp)") - - app.textFields["Email"].tap() - sleep(2) - self.pasteTextFieldText( - app: app, - element: app.textFields["Email"], - value: "ios_autotest_\(timestamp)@stepik.org" - ) - - app.secureTextFields["Password"].tap() - sleep(2) - self.pasteTextFieldText( - app: app, - element: app.secureTextFields["Password"], - value: kCurrentUserPassword - ) - - app.buttons["Register"].tap() - - if self.isUserLoggedIn(app: app) { - currentUserName = "ios_autotest_\(timestamp)" - currentUserEmail = "ios_autotest_\(timestamp)@stepik.org" - } else { - XCTFail("User setup failed") - } - } - - self.logOut(app: app) - app.terminate() - - return true - } - - static func isUserLoggedIn(app: XCUIApplication) -> Bool { - app.tabBars["Tab Bar"].buttons["Profile"].tap() - if app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 10) { - return false - } - return true - } - - static func logOut(app: XCUIApplication) { - if app.tabBars["Tab Bar"].buttons["Profile"].waitForExistence(timeout: 10) { - app.tabBars["Tab Bar"].buttons["Profile"].tap() - } - - app.navigationBars["Profile"].buttons["settings"].tap() - app.swipeUp() - app.tables.staticTexts["Log Out"].tap() - app.alerts["Log Out"].scrollViews.otherElements.buttons["Log Out"].tap() - - if !app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 10) { - XCTFail("Logout failed") - } - } - - static func logIn(app: XCUIApplication) { - app.tabBars["Tab Bar"].buttons["Profile"].tap() - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.buttons["Sign In with e-mail"].tap() - - app.textFields["Email"].tap() - app.textFields["Email"].typeText(currentUserEmail) - - sleep(5) - - app.secureTextFields["Password"].tap() - self.pasteTextFieldText( - app: app, - element: app.secureTextFields["Password"], - value: kCurrentUserPassword - ) - - app.buttons["Log in"].tap() - } - - static func deleteApplication() { - let appName = "Stepik" - - // Put the app in the background - // XCUIDevice.shared.press(XCUIDevice.Button.home) - - let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") - if springboard.icons[appName].waitForExistence(timeout: 5) { - springboard.icons[appName].press(forDuration: 1.5) - } - - if springboard.collectionViews.buttons["Remove App"].waitForExistence(timeout: 5) { - springboard.collectionViews.buttons["Remove App"].tap() - } - - if springboard.alerts["Remove “\(appName)”?"] - .scrollViews.otherElements.buttons["Delete App"].waitForExistence(timeout: 5) { - springboard.alerts["Remove “\(appName)”?"].scrollViews.otherElements.buttons["Delete App"].tap() - } - - if springboard.alerts["Delete “\(appName)”?"] - .scrollViews.otherElements.buttons["Delete"].waitForExistence(timeout: 5) { - springboard.alerts["Delete “\(appName)”?"].scrollViews.otherElements.buttons["Delete"].tap() - } - } - - static func pasteTextFieldText(app: XCUIApplication, element: XCUIElement, value: String, clearText: Bool = false) { - // Get the password into the pasteboard buffer - UIPasteboard.general.string = value - // Bring up the popup menu on the password field - if clearText { - element.buttons["Clear text"].tap() - } - element.doubleTap() - // Tap the Paste button to input the password - app.menuItems["Paste"].tap() - } -} diff --git a/StepicUITests/Sources/Common/CommonActions.swift b/StepicUITests/Sources/Common/CommonActions.swift new file mode 100644 index 0000000000..2e1540d841 --- /dev/null +++ b/StepicUITests/Sources/Common/CommonActions.swift @@ -0,0 +1,56 @@ +import Foundation +import XCTest + +enum CommonActions { + enum App { + static func delete() { + let appName = AppName.name + + let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") + if springboard.icons[appName].waitForExistence(timeout: Constants.Timeout.small) { + springboard.icons[appName].press(forDuration: 1.5) + } else { + return + } + + springboard.collectionViews.buttons["Удалить приложение"].tap() + springboard.alerts.scrollViews.otherElements.buttons["Удалить приложение"].tap() + springboard.alerts.scrollViews.otherElements.buttons["Удалить"].tap() + } + } + + enum User { + static func registerNewUser(name: String, email: String, password: String) { + let navigationTabs = MainNavigationTabs() + let profileScreen = ProfileScreen() + let authScreen = AuthScreen() + let registerScreen = RegisterScreen() + + navigationTabs.openProfile() + profileScreen.clickSingIn() + authScreen.clickRegister() + registerScreen.fillUserInfo(name: name, email: email, password: password) + registerScreen.clickRegister() + + self.logOut() + } + + static func logOut() { + let navigationTabs = MainNavigationTabs() + let profileScreen = ProfileScreen() + + navigationTabs.openProfile() + profileScreen.openSettings() + profileScreen.logOut() + } + + static func isAuthorized() -> Bool { + let navigationTabs = MainNavigationTabs() + let profileScreen = ProfileScreen() + + navigationTabs.openProfile() + + return profileScreen.isAuthorized() + } + } +} diff --git a/StepicUITests/Sources/LoginUITests.swift b/StepicUITests/Sources/LoginUITests.swift deleted file mode 100644 index e29b268270..0000000000 --- a/StepicUITests/Sources/LoginUITests.swift +++ /dev/null @@ -1,176 +0,0 @@ -import XCTest - -class LoginUITests: XCTestCase { - override func setUp() { - super.setUp() - - self.continueAfterFailure = false - - XCUIApplication().launchArguments += ["-AppleLanguages", "(en)"] - XCUIApplication().launchArguments += ["-AppleLocale", "en_EN"] - } - - override func tearDown() { - XCUIApplication().terminate() - super.tearDown() - } - - func testUserCanLogInWithEmail() throws { - let app = XCUIApplication() - app.launch() - - if Common.isUserLoggedIn(app: app) { - Common.logOut(app: app) - } - - Common.registerNewUserIfNeeded() - - app.launch() - app.tabBars["Tab Bar"].buttons["Profile"].tap() - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.buttons["Sign In with e-mail"].tap() - - app.textFields["Email"].tap() - sleep(2) - Common.pasteTextFieldText( - app: app, - element: app.textFields["Email"], - value: currentUserEmail - ) - - app.secureTextFields["Password"].tap() - sleep(2) - Common.pasteTextFieldText( - app: app, - element: app.secureTextFields["Password"], - value: kCurrentUserPassword - ) - - app.buttons["Log in"].tap() - // Check user profile loaded - if app.tabBars["Tab Bar"].buttons["Profile"].waitForExistence(timeout: 5) { - app.tabBars["Tab Bar"].buttons["Profile"].tap() - } - - let elementsQuery = app.scrollViews.otherElements - - if elementsQuery.staticTexts[currentUserName].waitForExistence(timeout: 5) { - XCTAssertTrue(elementsQuery.staticTexts["Activity"].exists, "No Activity section") - XCTAssertTrue(elementsQuery.staticTexts["Achievements"].exists, "No Achievements section") - } else { - XCTFail("User could not login") - } - - app.terminate() - } - - func testUserCanLogInWithGoogle() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Wants to Use “google.com” to Sign In") { alert in - let alertButton = alert.buttons["Continue"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - let app = XCUIApplication() - app.launch() - if Common.isUserLoggedIn(app: app) { - Common.logOut(app: app) - } - app.launch() - app.tabBars["Tab Bar"].buttons["Profile"].tap() - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.collectionViews.children(matching: .cell).element(boundBy: 2).tap() - if app.webViews.webViews.webViews.staticTexts["Сменить аккаунт"].waitForExistence(timeout: 1) { - app.webViews.webViews.webViews.staticTexts["Сменить аккаунт"].tap() - } - app.tap() - app.webViews.webViews.webViews.textFields.element(boundBy: 0).waitForExistence(timeout: 5) - app.webViews.webViews.webViews.textFields.element(boundBy: 0).tap() - app.webViews.webViews.webViews.textFields.element(boundBy: 0).typeText("stepik.qa4@gmail.com") - app.tap() - app.webViews.webViews.webViews.buttons.element(boundBy: 2).tap() - sleep(3) - app.webViews.webViews.webViews.secureTextFields.element(boundBy: 0).tap() - app.webViews.webViews.webViews.secureTextFields.element(boundBy: 0).typeText("Qq0987654321Qq") - app.tap() - app.webViews.webViews.webViews.buttons.element(boundBy: 0).tap() - sleep(5) - if !Common.isUserLoggedIn(app: app) { - XCTFail("Login with google account failed") - } - } - - func testUserCanLogInWithFacebook() throws { - let app = XCUIApplication() - - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Wants to Use “facebook.com” to Sign In") { alert in - let alertButton = alert.buttons["Continue"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - app.launch() - if Common.isUserLoggedIn(app: app) { - Common.logOut(app: app) - } - app.launch() - app.tabBars["Tab Bar"].buttons["Profile"].tap() - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.buttons["More"].tap() - app.collectionViews.children(matching: .cell).element(boundBy: 3).tap() - sleep(5) - if app.collectionViews.children(matching: .cell).element(boundBy: 3).exists { - app.tap() - } - /* - app.webViews.webViews.webViews.staticTexts["..."].waitForExistence(timeout: 5) - if app.webViews.webViews.webViews.staticTexts["..."].exists { - app.webViews.webViews.webViews.staticTexts["..."].tap() - app.webViews.webViews.webViews.otherElements["main"].children(matching: .other).element(boundBy: 3).staticTexts["English (US)"].tap() - app.webViews.webViews.webViews.staticTexts["Accept All"].tap() - } - app.webViews.webViews.webViews.staticTexts["Русский"].tap() - */ - let textField = app.webViews.webViews.webViews.textFields.element(boundBy: 0) - textField.tap() - textField.typeText("ios_cmvthcs_autotest@tfbnw.net") - app.webViews.webViews.webViews.secureTextFields.element(boundBy: 0).tap() - app.webViews.webViews.webViews.secureTextFields.element(boundBy: 0).typeText("Test999Test") - - app.webViews.webViews.webViews.buttons.element(boundBy: 0).tap() - sleep(3) - - app.webViews.webViews.webViews.buttons.element(boundBy: 0).tap() - - if !Common.isUserLoggedIn(app: app) { - XCTFail("Login with facebook account failed") - } else { - Common.logOut(app: app) - } - } - - func testUserCanLogout() throws { - let app = XCUIApplication() - app.launch() - - if !Common.isUserLoggedIn(app: app) { - Common.registerNewUserIfNeeded() - app.launch() - Common.logIn(app: app) - } - - Common.logOut(app: app) - - if Common.isUserLoggedIn(app: app) { - XCTFail("User was not logged out") - } - - app.terminate() - } -} diff --git a/StepicUITests/Sources/Model/AccessibilityIdentifiers.swift b/StepicUITests/Sources/Model/AccessibilityIdentifiers.swift new file mode 100644 index 0000000000..f00b78f877 --- /dev/null +++ b/StepicUITests/Sources/Model/AccessibilityIdentifiers.swift @@ -0,0 +1,73 @@ +import Foundation + +enum AccessibilityIdentifiers { + // MARK: - Onboarding - + + enum Onboarding { + static let closeButton = "closeOnbordingButton" + + static let nextButton = "nextButton" + } + + // MARK: - Placeholders - + + enum Placeholders { + static let loginButton = "loginButton" + } + + // MARK: - AuthEmail - + + enum AuthEmail { + static let emailTextField = "emailTextField" + + static let passwordTextField = "passwordTextField" + + static let logInButton = "logInButton" + } + + // MARK: - AuthSocial - + + enum AuthSocial { + static let signUpButton = "signUpButton" + + static let signInButton = "signInButton" + } + + // MARK: - Registration - + + enum Registration { + static let nameTextField = "nameTextField" + + static let emailTextField = "emailTextField" + + static let passwordTextField = "passwordTextField" + + static let registerButton = "registerButton" + } + + // MARK: - TabBar - + + enum TabBar { + static let profile = "Profile" + + static let home = "Home" + + static let notifications = "Notifications" + + static let catalog = "Catalog" + + static let debug = "Debug" + } + + // MARK: - Settings - + + enum Settings { + static let logOut = "logOut" + } + + // MARK: - Profile - + + enum Profile { + static let settingsButton = "settingsButton" + } +} diff --git a/StepicUITests/Sources/Model/AppName.swift b/StepicUITests/Sources/Model/AppName.swift new file mode 100644 index 0000000000..b94ac3ced4 --- /dev/null +++ b/StepicUITests/Sources/Model/AppName.swift @@ -0,0 +1,11 @@ +import Foundation + +enum AppName { + #if PRODUCTION + static let name = "Stepik" + #elseif DEVELOP + static let name = "Stepik Develop" + #elseif RELEASE + static let name = "Stepik Release" + #endif +} diff --git a/StepicUITests/Sources/Model/Constants.swift b/StepicUITests/Sources/Model/Constants.swift new file mode 100644 index 0000000000..e357c647eb --- /dev/null +++ b/StepicUITests/Sources/Model/Constants.swift @@ -0,0 +1,9 @@ +import Foundation + +enum Constants { + enum Timeout { + static let `default`: TimeInterval = 10 + + static let small: TimeInterval = 5 + } +} diff --git a/StepicUITests/Sources/Pages/AuthScreen.swift b/StepicUITests/Sources/Pages/AuthScreen.swift new file mode 100644 index 0000000000..119511d3e7 --- /dev/null +++ b/StepicUITests/Sources/Pages/AuthScreen.swift @@ -0,0 +1,34 @@ +import Foundation +import XCTest + +final class AuthScreen: BaseScreen { + private lazy var loginWithEmailButton = self.app.buttons[AccessibilityIdentifiers.AuthSocial.signInButton] + private lazy var registerButton = self.app.buttons[AccessibilityIdentifiers.AuthSocial.signUpButton] + private lazy var googleButton = self.app.collectionViews.children(matching: .cell).element(boundBy: 2) + + func shouldBeAuthScreen() { + XCTAssertTrue( + self.loginWithEmailButton.waitForExistence(timeout: Self.defaultTimeout), + "No 'Log in with email' button" + ) + XCTAssertTrue(self.registerButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Register' button") + } + + func clickRegister() { + XCTAssertTrue(self.registerButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Register' button") + self.registerButton.tap() + } + + func clickLoginWithEmail() { + XCTAssertTrue( + self.loginWithEmailButton.waitForExistence(timeout: Self.defaultTimeout), + "No 'Log in with email' button" + ) + self.loginWithEmailButton.tap() + } + + func clickLogInWithGoogle() { + XCTAssertTrue(self.googleButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Google' button") + self.googleButton.tap() + } +} diff --git a/StepicUITests/Sources/Pages/BaseScreen.swift b/StepicUITests/Sources/Pages/BaseScreen.swift new file mode 100644 index 0000000000..b72aedc59a --- /dev/null +++ b/StepicUITests/Sources/Pages/BaseScreen.swift @@ -0,0 +1,25 @@ +import Foundation +import XCTest + +class BaseScreen { + static let defaultTimeout: TimeInterval = Constants.Timeout.default + static let smallTimeout: TimeInterval = Constants.Timeout.small + + private(set) var app = XCUIApplication() + + func typeText(element: XCUIElement, value: String) { + XCTAssertTrue(element.waitForExistence(timeout: Self.defaultTimeout), "No field \(element)") + element.tap() + element.typeText(value) + } + + func shouldBeText(text: String) { + XCTAssertTrue(self.app.staticTexts[text].waitForExistence(timeout: Self.defaultTimeout), "No text \(text)") + } + + func confirmAlert(text: String, button: String) { + let alert = self.app.alerts[text].firstMatch + XCTAssertTrue(alert.waitForExistence(timeout: Self.defaultTimeout), "No alert \(text)") + alert.buttons[button].tap() + } +} diff --git a/StepicUITests/Sources/Pages/CatalogScreen.swift b/StepicUITests/Sources/Pages/CatalogScreen.swift new file mode 100644 index 0000000000..055c579505 --- /dev/null +++ b/StepicUITests/Sources/Pages/CatalogScreen.swift @@ -0,0 +1,22 @@ +import Foundation +import XCTest + +final class CatalogScreen: BaseScreen { + private lazy var ruButton = self.app.buttons["Ru"] + private lazy var enButton = self.app.buttons["En"] + + func selectRuLanguage() { + XCTAssertTrue(self.ruButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Ru' button") + self.ruButton.tap() + } + + func selectEnLanguage() { + XCTAssertTrue(self.enButton.waitForExistence(timeout: Self.defaultTimeout), "No 'En' button") + self.enButton.tap() + } + + func shouldNotBeLanguageButtons() { + XCTAssertFalse(self.ruButton.waitForExistence(timeout: Self.smallTimeout), "'En' button exists") + XCTAssertFalse(self.enButton.waitForExistence(timeout: Self.smallTimeout), "'Ru' button exists") + } +} diff --git a/StepicUITests/Sources/Pages/GoogleAuthScreen.swift b/StepicUITests/Sources/Pages/GoogleAuthScreen.swift new file mode 100644 index 0000000000..8d873d2b19 --- /dev/null +++ b/StepicUITests/Sources/Pages/GoogleAuthScreen.swift @@ -0,0 +1,26 @@ +import Foundation +import XCTest + +final class GoogleAuthScreen: BaseScreen { + private lazy var changeAccountText = self.app.webViews.webViews.webViews.staticTexts["Сменить аккаунт"] + private lazy var emailTextField = self.app.webViews.webViews.webViews.textFields.element(boundBy: 0) + private lazy var passwordTextField = self.app.webViews.webViews.webViews.secureTextFields.element(boundBy: 0) + private lazy var nextButton = self.app.webViews.webViews.webViews.buttons["Далее"] + + func singIn(email: String, password: String) { + if self.changeAccountText.waitForExistence(timeout: 1) { + self.changeAccountText.tap() + } + + self.app.tap() + self.typeText(element: self.emailTextField, value: email) + + self.app.tap() + self.nextButton.tap() + self.typeText(element: self.passwordTextField, value: password) + + self.app.tap() + self.nextButton.tap() + // next step is to verify account, need to reseach how work with it + } +} diff --git a/StepicUITests/Sources/Pages/LogInScreen.swift b/StepicUITests/Sources/Pages/LogInScreen.swift new file mode 100644 index 0000000000..f4019cb84f --- /dev/null +++ b/StepicUITests/Sources/Pages/LogInScreen.swift @@ -0,0 +1,18 @@ +import Foundation +import XCTest + +final class LogInScreen: BaseScreen { + private lazy var emailTextField = self.app.textFields[AccessibilityIdentifiers.AuthEmail.emailTextField] + private lazy var passwordTextField = self.app.secureTextFields[AccessibilityIdentifiers.AuthEmail.passwordTextField] + private lazy var logInButton = self.app.buttons[AccessibilityIdentifiers.AuthEmail.logInButton] + + func fillUserInfo(email: String, password: String) { + self.typeText(element: self.emailTextField, value: email) + self.typeText(element: self.passwordTextField, value: password) + } + + func clickLogIn() { + XCTAssertTrue(self.logInButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Log in' button") + self.logInButton.tap() + } +} diff --git a/StepicUITests/Sources/Pages/MainNavigationTabs.swift b/StepicUITests/Sources/Pages/MainNavigationTabs.swift new file mode 100644 index 0000000000..4bd0dae5d6 --- /dev/null +++ b/StepicUITests/Sources/Pages/MainNavigationTabs.swift @@ -0,0 +1,17 @@ +import Foundation +import XCTest + +final class MainNavigationTabs: BaseScreen { + private lazy var profileTab = self.app.tabBars.buttons[AccessibilityIdentifiers.TabBar.profile] + private lazy var catalogTab = self.app.tabBars.buttons[AccessibilityIdentifiers.TabBar.catalog] + + func openProfile() { + XCTAssertTrue(self.profileTab.waitForExistence(timeout: Self.defaultTimeout), "No 'Profile' tab") + self.profileTab.tap() + } + + func openCatalog() { + XCTAssertTrue(self.catalogTab.waitForExistence(timeout: Self.defaultTimeout), "No 'Catalog' tab") + self.catalogTab.tap() + } +} diff --git a/StepicUITests/Sources/Pages/OnboardingScreen.swift b/StepicUITests/Sources/Pages/OnboardingScreen.swift new file mode 100644 index 0000000000..8c83213c10 --- /dev/null +++ b/StepicUITests/Sources/Pages/OnboardingScreen.swift @@ -0,0 +1,17 @@ +import Foundation +import XCTest + +final class OnboardingScreen: BaseScreen { + private lazy var closeButton = self.app.navigationBars.buttons[AccessibilityIdentifiers.Onboarding.closeButton] + private lazy var nextButton = self.app.buttons[AccessibilityIdentifiers.Onboarding.nextButton] + + func closeOnbording() { + XCTAssertTrue(self.closeButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Close' button") + self.closeButton.tap() + } + + func next() { + XCTAssertTrue(self.nextButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Next' button") + self.nextButton.tap() + } +} diff --git a/StepicUITests/Sources/Pages/ProfileScreen.swift b/StepicUITests/Sources/Pages/ProfileScreen.swift new file mode 100644 index 0000000000..10589ce8af --- /dev/null +++ b/StepicUITests/Sources/Pages/ProfileScreen.swift @@ -0,0 +1,39 @@ +import Foundation +import XCTest + +final class ProfileScreen: BaseScreen { + private lazy var singInButton = self.app.buttons[AccessibilityIdentifiers.Placeholders.loginButton] + private lazy var settingsButton = self.app.buttons[AccessibilityIdentifiers.Profile.settingsButton] + private lazy var logOutButton = self.app.tables.cells[AccessibilityIdentifiers.Settings.logOut] + + func clickSingIn() { + XCTAssertTrue(self.singInButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Login' button") + self.singInButton.tap() + } + + func openSettings() { + XCTAssertTrue(self.settingsButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Settings' button") + self.settingsButton.tap() + } + + func logOut() { + self.app.swipeUp() + self.logOutButton.tap() + self.confirmAlert(text: "Выйти", button: "Выйти") + } + + func shouldBeUserProfile(name: String) { + self.shouldBeText(text: name) + } + + func shouldBeSingInButton() { + XCTAssertTrue(self.singInButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Login' button") + } + + func isAuthorized() -> Bool { + if self.singInButton.waitForExistence(timeout: Self.smallTimeout) { + return false + } + return true + } +} diff --git a/StepicUITests/Sources/Pages/RegisterScreen.swift b/StepicUITests/Sources/Pages/RegisterScreen.swift new file mode 100644 index 0000000000..be4b3ea480 --- /dev/null +++ b/StepicUITests/Sources/Pages/RegisterScreen.swift @@ -0,0 +1,21 @@ +import Foundation +import XCTest + +final class RegisterScreen: BaseScreen { + private lazy var nameTextField = self.app.textFields[AccessibilityIdentifiers.Registration.nameTextField] + private lazy var emailTextField = self.app.textFields[AccessibilityIdentifiers.Registration.emailTextField] + private lazy var registerButton = self.app.buttons[AccessibilityIdentifiers.Registration.registerButton] + private lazy var passwordTextField + = self.app.secureTextFields[AccessibilityIdentifiers.Registration.passwordTextField] + + func fillUserInfo(name: String, email: String, password: String) { + self.typeText(element: self.nameTextField, value: name) + self.typeText(element: self.emailTextField, value: email) + self.typeText(element: self.passwordTextField, value: password) + } + + func clickRegister() { + XCTAssertTrue(self.registerButton.waitForExistence(timeout: Self.defaultTimeout), "No 'Register' button") + self.registerButton.tap() + } +} diff --git a/StepicUITests/Sources/Tests/BaseTest.swift b/StepicUITests/Sources/Tests/BaseTest.swift new file mode 100644 index 0000000000..482253e9b9 --- /dev/null +++ b/StepicUITests/Sources/Tests/BaseTest.swift @@ -0,0 +1,24 @@ +import Foundation +import XCTest + +class BaseTest: XCTestCase { + private lazy var baseScreen = BaseScreen() + + private(set) lazy var app = self.baseScreen.app + + override func setUp() { + super.setUp() + + self.continueAfterFailure = false + + self.app.launchArguments += ["-AppleLanguages", "(ru)"] + self.app.launchArguments += ["-AppleLocale", "ru_RU"] + + self.app.launch() + } + + override func tearDown() { + super.tearDown() + self.app.terminate() + } +} diff --git a/StepicUITests/Sources/Tests/CatalogTests.swift b/StepicUITests/Sources/Tests/CatalogTests.swift new file mode 100644 index 0000000000..4af3842ba4 --- /dev/null +++ b/StepicUITests/Sources/Tests/CatalogTests.swift @@ -0,0 +1,38 @@ +import Foundation +import XCTest + +final class CatalogTests: BaseTest { + let onbordingScreen = OnboardingScreen() + let navigationTabs = MainNavigationTabs() + let catalogScreen = CatalogScreen() + + override func setUp() { + CommonActions.App.delete() + super.setUp() + + self.addUIInterruptionMonitor( + withDescription: "“\(AppName.name)” Would Like to Send You Notifications" + ) { alert -> Bool in + let alertButton = alert.buttons["Allow"] + if alert.elementType == .alert && alertButton.exists { + alertButton.tap() + return true + } + return false + } + } + + func testUserCanChangeLanguageOnce() throws { + self.onbordingScreen.closeOnbording() + self.app.tap() + + self.navigationTabs.openCatalog() + self.catalogScreen.selectRuLanguage() + + self.app.terminate() + self.app.launch() + + self.navigationTabs.openCatalog() + self.catalogScreen.shouldNotBeLanguageButtons() + } +} diff --git a/StepicUITests/Sources/Tests/LoginTests.swift b/StepicUITests/Sources/Tests/LoginTests.swift new file mode 100644 index 0000000000..0468bc1ebc --- /dev/null +++ b/StepicUITests/Sources/Tests/LoginTests.swift @@ -0,0 +1,53 @@ +import Foundation +import XCTest + +final class LoginTests: BaseTest { + let navigationTabs = MainNavigationTabs() + let profileScreen = ProfileScreen() + let authScreen = AuthScreen() + let registerScreen = RegisterScreen() + let logInScreen = LogInScreen() + let googleAuthScreen = GoogleAuthScreen() + + override func setUp() { + super.setUp() + + if CommonActions.User.isAuthorized() { + CommonActions.User.logOut() + } + } + + func testUserCanLogInWithEmail() throws { + let cts = String(Int64(Date().timeIntervalSince1970)) + let name = "Bot_\(cts)" + let email = "ios_autotest_\(cts)@stepik.org" + + CommonActions.User.registerNewUser(name: name, email: email, password: cts) + self.navigationTabs.openProfile() + self.profileScreen.clickSingIn() + + self.authScreen.clickLoginWithEmail() + + self.logInScreen.fillUserInfo(email: email, password: cts) + self.logInScreen.clickLogIn() + + self.profileScreen.shouldBeUserProfile(name: name) + } + + // func testUserCanLogInWithGoogle() throws { + // // decide where to store google account "stepik.qa4@gmail.com", "Qq0987654321Qq" + // self.addUIInterruptionMonitor(withDescription: "“Stepik” Wants to Use “google.com” to Sign In") { alert in + // let alertButton = alert.buttons["Continue"] + // if alertButton.exists { + // alertButton.tap() + // return true + // } + // return false + // } + // navigation.openProfile() + // profileScreen.clickSingIn() + // authScreen.clickLogInWithGoogle() + // googleAuthScreen.singIn(email: "", password: "") + // profileScreen.shouldBeUserProfile(name: "") + // } +} diff --git a/StepicUITests/Sources/Tests/OnboardingTests.swift b/StepicUITests/Sources/Tests/OnboardingTests.swift new file mode 100644 index 0000000000..e462276854 --- /dev/null +++ b/StepicUITests/Sources/Tests/OnboardingTests.swift @@ -0,0 +1,45 @@ +import Foundation +import XCTest + +final class OnboardingTests: BaseTest { + let onbordingScreen = OnboardingScreen() + let navigationTabs = MainNavigationTabs() + let authScreen = AuthScreen() + let profileScreen = ProfileScreen() + + override func setUp() { + CommonActions.App.delete() + super.setUp() + + self.addUIInterruptionMonitor( + withDescription: "“\(AppName.name)” Would Like to Send You Notifications" + ) { alert -> Bool in + let alertButton = alert.buttons["Allow"] + if alert.elementType == .alert && alertButton.exists { + alertButton.tap() + return true + } + return false + } + } + + func testUserCanFollowOnboarding() throws { + self.onbordingScreen.next() + self.onbordingScreen.next() + self.onbordingScreen.next() + self.onbordingScreen.next() + + self.app.tap() + + self.authScreen.shouldBeAuthScreen() + } + + func testUserCanCloseOnboarding() throws { + self.onbordingScreen.closeOnbording() + + self.app.tap() + + self.navigationTabs.openProfile() + self.profileScreen.shouldBeSingInButton() + } +} diff --git a/StepicUITests/Sources/Tests/RegisterTests.swift b/StepicUITests/Sources/Tests/RegisterTests.swift new file mode 100644 index 0000000000..818196dfe4 --- /dev/null +++ b/StepicUITests/Sources/Tests/RegisterTests.swift @@ -0,0 +1,46 @@ +import Foundation +import XCTest + +final class RegisterTests: BaseTest { + let onbordingScreen = OnboardingScreen() + let navigationTabs = MainNavigationTabs() + let profileScreen = ProfileScreen() + let authScreen = AuthScreen() + let registerScreen = RegisterScreen() + + override func setUp() { + CommonActions.App.delete() + super.setUp() + + self.addUIInterruptionMonitor( + withDescription: "“\(AppName.name)” Would Like to Send You Notifications" + ) { alert -> Bool in + let alertButton = alert.buttons["Allow"] + if alert.elementType == .alert && alertButton.exists { + alertButton.tap() + return true + } + return false + } + } + + func testUserCanRegister() throws { + let cts = String(Int64(Date().timeIntervalSince1970)) + let name = "Bot_\(cts)" + let email = "ios_autotest_\(cts)@stepik.org" + + self.onbordingScreen.closeOnbording() + + self.app.tap() + + self.navigationTabs.openProfile() + self.profileScreen.clickSingIn() + + self.authScreen.clickRegister() + + self.registerScreen.fillUserInfo(name: name, email: email, password: cts) + self.registerScreen.clickRegister() + + self.profileScreen.shouldBeUserProfile(name: name) + } +} diff --git a/StepicUITests/Sources/UnregisteredUITests.swift b/StepicUITests/Sources/UnregisteredUITests.swift deleted file mode 100644 index 836b49298d..0000000000 --- a/StepicUITests/Sources/UnregisteredUITests.swift +++ /dev/null @@ -1,250 +0,0 @@ -import XCTest - -class UnregisteredUITests: XCTestCase { - override func setUp() { - super.setUp() - - self.continueAfterFailure = false - - XCUIApplication().launchArguments += ["-AppleLanguages", "(en)"] - XCUIApplication().launchArguments += ["-AppleLocale", "en_EN"] - } - - override func tearDown() { - XCUIApplication().terminate() - super.tearDown() - } - - func testApplicationCanStart() throws { - let app = XCUIApplication() - app.launch() - app.terminate() - } - - func testUserCanAllowNotificationsAfterCloseSplash() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Would Like to Send You Notifications") { alert in - let alertButton = alert.buttons["Allow"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - // We need clean installation for this test - Common.deleteApplication() - - let app = XCUIApplication() - app.launch() - - // Closing splash with cross - app.navigationBars["Stepic.OnboardingView"].children(matching: .button).element.tap() - - // Allowing notifications alert - app.tap() - - // Waiting for Editors choice text - if app.scrollViews.otherElements.staticTexts["Editors' choice"].waitForExistence(timeout: 5) { - XCTAssertTrue(app.scrollViews.otherElements.staticTexts["Editors' choice"].exists) - } - - app.terminate() - } - - func testUserCanDisallowNotificationsAfterFinishingSplash() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Would Like to Send You Notifications") { alert in - let alertButton = alert.buttons["Don’t Allow"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - // We need clean installation for this test - Common.deleteApplication() - - let app = XCUIApplication() - app.launch() - - // Finishing splash - let elementsQuery = app.scrollViews.otherElements - let button = elementsQuery.buttons["Next"] - button.tap() - button.tap() - button.tap() - elementsQuery.buttons["Start"].tap() - - // Allowing notifications alert - app.tap() - - // Waiting for Editors choice text - if app.scrollViews.otherElements.staticTexts["Editors' choice"].waitForExistence(timeout: 5) { - XCTAssertTrue(app.scrollViews.otherElements.staticTexts["Editors' choice"].exists) - } - } - - func testUserCanChangeLanguageOnce() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Would Like to Send You Notifications") { alert in - let alertButton = alert.buttons["Allow"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - // We need clean installation for this test - Common.deleteApplication() - - let app = XCUIApplication() - app.launch() - - // Closing splash with cross - app.navigationBars["Stepic.OnboardingView"].children(matching: .button).element.tap() - - // Waiting for language change button - if app.scrollViews.otherElements.staticTexts["En"].waitForExistence(timeout: 5) { - let elementsQuery = app.scrollViews.otherElements - let enStaticText = elementsQuery.staticTexts["En"] - // Set language to EN - enStaticText.tap() - // Set language to RU - elementsQuery.buttons["Ru"].staticTexts["Ru"].tap() - // Check Russian language enabled - if elementsQuery.staticTexts["Stepik рекомендует 👍"].waitForExistence(timeout: 5) { - // Set language to EN - enStaticText.tap() - // Check english language enabled - if !elementsQuery.staticTexts["Editors' choice"].waitForExistence(timeout: 5) { - XCTFail() - } - } - // Restart app - app.terminate() - app.launch() - - // Check for language change button existence - if app.scrollViews.otherElements.staticTexts["En"].waitForExistence(timeout: 5) { - XCTFail("Language switcher still exists after restart") - } - } else { - XCTFail("Language switcher not found") - } - } - - func testUnregisteredUserAllUI() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Would Like to Send You Notifications") { alert in - let alertButton = alert.buttons["Allow"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - // We need clean installation for this test - Common.deleteApplication() - let app = XCUIApplication() - app.launch() - // Closing splash with cross - app.navigationBars["Stepic.OnboardingView"].children(matching: .button).element.tap() - - // Check all Catalog sections - let scrollViewsQuery = app.scrollViews - let elementsQuery = scrollViewsQuery.otherElements - - app.tabBars["Tab Bar"].buttons["Catalog"].tap() - XCTAssertTrue( - elementsQuery.staticTexts["Editors' choice"].waitForExistence(timeout: 5), - "No Editors choice section" - ) - XCTAssertTrue(elementsQuery.staticTexts["Stepik trends"].exists, "No Stepik trends section") - - app.swipeUp() - XCTAssertTrue(elementsQuery.staticTexts["Top categories"].exists, "No Top categories section") - XCTAssertTrue(elementsQuery.staticTexts["Best authors"].exists, "No Best authors section") - - app.swipeUp() - XCTAssertTrue(elementsQuery.staticTexts["Popular courses"].exists, "No Popular courses section") - - // Check all Home bar sections - app.tabBars["Tab Bar"].buttons["Home"].tap() - if app.scrollViews.otherElements.staticTexts["Enrolled"].waitForExistence(timeout: 5) { - XCTAssertTrue(app.scrollViews.otherElements.staticTexts["Enrolled"].exists, "No My courses section") - XCTAssertTrue(app.scrollViews.otherElements.staticTexts["Popular"].exists, "No Popular section") - } else { - XCTFail("No Home bar elements") - } - - // Check unsigned profile tab elements - app.tabBars["Tab Bar"].buttons["Profile"].tap() - if !app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 10) { - XCTFail("No Sign In button in profile tab") - } - - // Check unsigned notification tab elements - app.tabBars["Tab Bar"].buttons["Notifications"].tap() - if !app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 10) { - XCTFail("No Sign In button in notifications tab") - } - - app.terminate() - } - - func testUserCanRegister() throws { - // Adding Notification alert interruption - self.addUIInterruptionMonitor(withDescription: "“Stepik” Would Like to Send You Notifications") { alert in - let alertButton = alert.buttons["Allow"] - if alertButton.exists { - alertButton.tap() - return true - } - return false - } - // We need clean installation for this test - Common.deleteApplication() - let timestamp = Int64(Date().timeIntervalSince1970) - let app = XCUIApplication() - app.launch() - // Closing splash with cross - app.navigationBars["Stepic.OnboardingView"].children(matching: .button).element.tap() - // Register new user - app.tabBars["Tab Bar"].buttons["Profile"].tap() - if !app.buttons["Sign In"].staticTexts["Sign In"].waitForExistence(timeout: 10) { - XCTFail("No Sign In button in profile tab") - } else { - app.buttons["Sign In"].staticTexts["Sign In"].tap() - app.buttons["Sign Up"].tap() - - app.textFields["Name"].tap() - app.textFields["Name"].typeText("ios_autotest_\(timestamp)") - - app.textFields["Email"].tap() - sleep(2) - Common.pasteTextFieldText( - app: app, - element: app.textFields["Email"], - value: "ios_autotest_\(timestamp)@stepik.org" - ) - - app.secureTextFields["Password"].tap() - sleep(2) - Common.pasteTextFieldText( - app: app, - element: app.secureTextFields["Password"], - value: kCurrentUserPassword - ) - - app.buttons["Register"].tap() - } - // Check user profile loaded - app.tabBars["Tab Bar"].buttons["Profile"].tap() - let elementsQuery = app.scrollViews.otherElements - if elementsQuery.staticTexts["ios_autotest_\(timestamp)"].waitForExistence(timeout: 5) { - XCTAssertTrue(elementsQuery.staticTexts["Activity"].exists, "No Activity section") - XCTAssertTrue(elementsQuery.staticTexts["Achievements"].exists, "No Achievements section") - } - app.terminate() - } -} diff --git a/autocorrect.sh b/autocorrect.sh index be7542fc15..dd34b84bff 100755 --- a/autocorrect.sh +++ b/autocorrect.sh @@ -3,7 +3,7 @@ target_name=$1 if [[ $target_name == "Stepic" ]]; then path="Stepic/Sources" elif [[ $target_name == "StepicUITests" ]]; then - path="StepicUITests/Sources" + path="StepicUITests/" else echo "warning: unknown target name ${target_name}" fi diff --git a/lint.sh b/lint.sh index 3ea31e6194..41e49fced1 100755 --- a/lint.sh +++ b/lint.sh @@ -3,7 +3,7 @@ target_name=$1 if [[ $target_name == "Stepic" ]]; then path="Stepic/Sources" elif [[ $target_name == "StepicUITests" ]]; then - path="StepicUITests/Sources" + path="StepicUITests/" else echo "warning: unknown target name ${target_name}" fi From f39b145fdf92c9d76ef85ad7fd9431b96dd7e914 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:15:46 +0300 Subject: [PATCH 05/43] bundler: bump fastlane from 2.205.2 to 2.206.2 (#1149) Bumps [fastlane](https://github.com/fastlane/fastlane) from 2.205.2 to 2.206.2. - [Release notes](https://github.com/fastlane/fastlane/releases) - [Commits](https://github.com/fastlane/fastlane/compare/fastlane/2.205.2...fastlane/2.206.2) --- updated-dependencies: - dependency-name: fastlane dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 319adcad85..3695bf01b8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" ruby "2.6.5" -gem "fastlane", "2.205.2" +gem "fastlane", "2.206.2" gem "cocoapods", "1.11.3" gem "generamba", "1.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index c0680a3e3b..d9851c1118 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,16 +17,16 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.579.0) - aws-sdk-core (3.130.2) + aws-partitions (1.594.0) + aws-sdk-core (3.131.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.56.0) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.57.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.113.1) + aws-sdk-s3 (1.114.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) @@ -86,7 +86,7 @@ GEM escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) - excon (0.92.2) + excon (0.92.3) faraday (1.10.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -116,7 +116,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.205.2) + fastlane (2.206.2) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -168,9 +168,9 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.19.0) + google-apis-androidpublisher_v3 (0.21.0) google-apis-core (>= 0.4, < 2.a) - google-apis-core (0.4.2) + google-apis-core (0.5.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -183,7 +183,7 @@ GEM google-apis-core (>= 0.4, < 2.a) google-apis-playcustomapp_v1 (0.7.0) google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.13.0) + google-apis-storage_v1 (0.14.0) google-apis-core (>= 0.4, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) @@ -207,13 +207,13 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.4) + http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) i18n (1.10.0) concurrent-ruby (~> 1.0) jmespath (1.6.1) - json (2.6.1) + json (2.6.2) jwt (2.3.0) liquid (4.0.0) memoist (0.16.2) @@ -232,7 +232,7 @@ GEM plist (3.6.0) public_suffix (4.0.7) rake (13.0.6) - representable (3.1.1) + representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) @@ -266,7 +266,7 @@ GEM uber (0.1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8.1) + unf_ext (0.0.8.2) webrick (1.7.0) word_wrap (1.0.0) xcodeproj (1.21.0) @@ -287,7 +287,7 @@ PLATFORMS DEPENDENCIES cocoapods (= 1.11.3) - fastlane (= 2.205.2) + fastlane (= 2.206.2) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) From b612f489ead1a7e6056f90a9d54f36feeb368446 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 13:45:21 +0700 Subject: [PATCH 06/43] Refactor CodeSuggestionsTableViewController --- Stepic.xcodeproj/project.pbxproj | 12 +- .../CodeAnalysis/CodePlaygroundManager.swift | 5 +- .../CodeSuggestionCellView.swift | 64 +++++++++++ .../CodeSuggestionTableViewCell.swift | 56 ++++++--- .../CodeSuggestionTableViewCell.xib | 39 ------- .../CodeSuggestionsTableViewController.swift | 108 +++++++++++------- .../CodeSuggestionsTableViewController.xib | 34 ------ 7 files changed, 172 insertions(+), 146 deletions(-) create mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionCellView.swift delete mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.xib delete mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.xib diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 41aec6b8e1..aa8d3099fb 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -157,7 +157,6 @@ 0860D9121F10C5480087D61B /* CodeSnippetSymbols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0860D9111F10C5480087D61B /* CodeSnippetSymbols.swift */; }; 0860D9151F10EA690087D61B /* InputAccessoryBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0860D9141F10EA690087D61B /* InputAccessoryBuilder.swift */; }; 0860D9191F115D830087D61B /* CodeSuggestionsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0860D9171F115D830087D61B /* CodeSuggestionsTableViewController.swift */; }; - 0860D91B1F115D830087D61B /* CodeSuggestionsTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0860D9181F115D830087D61B /* CodeSuggestionsTableViewController.xib */; }; 0861E6721CD80A9600B45652 /* Executable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0861E6711CD80A9600B45652 /* Executable.swift */; }; 0861E6751CD8106E00B45652 /* ExecutionQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0861E6741CD8106E00B45652 /* ExecutionQueue.swift */; }; 0861E67B1CD9483500B45652 /* ExecutionQueues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0861E67A1CD9483500B45652 /* ExecutionQueues.swift */; }; @@ -329,7 +328,6 @@ 08FCC79420F3BAEB008B84B9 /* stepikcontent.css in Resources */ = {isa = PBXBuildFile; fileRef = 08FCC79320F3BAEA008B84B9 /* stepikcontent.css */; }; 08FCEB641B9ED2AC00FC4F8B /* AuthAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08FCEB631B9ED2AC00FC4F8B /* AuthAPI.swift */; }; 08FEFC1C1F117257005CA0FB /* CodeSuggestionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08FEFC1A1F117257005CA0FB /* CodeSuggestionTableViewCell.swift */; }; - 08FEFC1E1F117257005CA0FB /* CodeSuggestionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 08FEFC1B1F117257005CA0FB /* CodeSuggestionTableViewCell.xib */; }; 08FEFC211F127470005CA0FB /* AutocompleteWords.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08FEFC201F127470005CA0FB /* AutocompleteWords.swift */; }; 0901F2E70A0CA50D44C96729 /* CourseRevenueTabPurchasesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1FCF7BCE261D5A901F33E09 /* CourseRevenueTabPurchasesViewController.swift */; }; 097807181FEAD22C2DE65676 /* NewProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02E0D8A3998163442A02FB0 /* NewProfileView.swift */; }; @@ -658,6 +656,7 @@ 2C57B2A1240945B2008284F0 /* SubmissionsRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C57B2A0240945B2008284F0 /* SubmissionsRepository.swift */; }; 2C580B812754FE7800BAEE60 /* WishlistEntriesPersistenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C580B802754FE7800BAEE60 /* WishlistEntriesPersistenceService.swift */; }; 2C5967EB23E7828800072800 /* SubmissionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5967EA23E7828800072800 /* SubmissionTests.swift */; }; + 2C5B2A182865879B0097B270 /* CodeSuggestionCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5B2A172865879B0097B270 /* CodeSuggestionCellView.swift */; }; 2C5B3813257280C6007BF21E /* AuthorsCourseListWidgetCoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5B3812257280C6007BF21E /* AuthorsCourseListWidgetCoverView.swift */; }; 2C5BE9DC233C0A110098EB2F /* katex in Resources */ = {isa = PBXBuildFile; fileRef = 2C5BE9DB233C0A100098EB2F /* katex */; }; 2C5D33DE25C9695300372C61 /* PromoCodesAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5D33DD25C9695200372C61 /* PromoCodesAPI.swift */; }; @@ -2180,7 +2179,6 @@ 0860D9111F10C5480087D61B /* CodeSnippetSymbols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeSnippetSymbols.swift; sourceTree = ""; }; 0860D9141F10EA690087D61B /* InputAccessoryBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InputAccessoryBuilder.swift; sourceTree = ""; }; 0860D9171F115D830087D61B /* CodeSuggestionsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeSuggestionsTableViewController.swift; sourceTree = ""; }; - 0860D9181F115D830087D61B /* CodeSuggestionsTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeSuggestionsTableViewController.xib; sourceTree = ""; }; 0861E6711CD80A9600B45652 /* Executable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Executable.swift; sourceTree = ""; }; 0861E6741CD8106E00B45652 /* ExecutionQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExecutionQueue.swift; sourceTree = ""; }; 0861E67A1CD9483500B45652 /* ExecutionQueues.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExecutionQueues.swift; sourceTree = ""; }; @@ -2375,7 +2373,6 @@ 08FCC79320F3BAEA008B84B9 /* stepikcontent.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = stepikcontent.css; sourceTree = ""; }; 08FCEB631B9ED2AC00FC4F8B /* AuthAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AuthAPI.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 08FEFC1A1F117257005CA0FB /* CodeSuggestionTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeSuggestionTableViewCell.swift; sourceTree = ""; }; - 08FEFC1B1F117257005CA0FB /* CodeSuggestionTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeSuggestionTableViewCell.xib; sourceTree = ""; }; 08FEFC201F127470005CA0FB /* AutocompleteWords.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutocompleteWords.swift; sourceTree = ""; }; 09AF7B8FAACF8A4D31AF7583 /* UserCoursesInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserCoursesInteractor.swift; sourceTree = ""; }; 0A41A14CB4B66408B3A9EAF4 /* DebugMenuViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DebugMenuViewController.swift; sourceTree = ""; }; @@ -2730,6 +2727,7 @@ 2C5967EA23E7828800072800 /* SubmissionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubmissionTests.swift; sourceTree = ""; }; 2C5A92FE27D75A4C0086559D /* Model_course_update_purchase_button_behavior_v95.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_course_update_purchase_button_behavior_v95.xcdatamodel; sourceTree = ""; }; 2C5AB2B122F9BC78005E7AA0 /* Model_step_options_limits.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_step_options_limits.xcdatamodel; sourceTree = ""; }; + 2C5B2A172865879B0097B270 /* CodeSuggestionCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeSuggestionCellView.swift; sourceTree = ""; }; 2C5B3812257280C6007BF21E /* AuthorsCourseListWidgetCoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorsCourseListWidgetCoverView.swift; sourceTree = ""; }; 2C5BE9DB233C0A100098EB2F /* katex */ = {isa = PBXFileReference; lastKnownFileType = folder; path = katex; sourceTree = ""; }; 2C5D33DD25C9695200372C61 /* PromoCodesAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromoCodesAPI.swift; sourceTree = ""; }; @@ -6356,7 +6354,6 @@ isa = PBXGroup; children = ( 0860D9171F115D830087D61B /* CodeSuggestionsTableViewController.swift */, - 0860D9181F115D830087D61B /* CodeSuggestionsTableViewController.xib */, ); path = CodeSuggestionsTableViewController; sourceTree = ""; @@ -6364,8 +6361,8 @@ 2CA4CF8A242A1710008BC4E8 /* CodeSuggestionTableViewCell */ = { isa = PBXGroup; children = ( + 2C5B2A172865879B0097B270 /* CodeSuggestionCellView.swift */, 08FEFC1A1F117257005CA0FB /* CodeSuggestionTableViewCell.swift */, - 08FEFC1B1F117257005CA0FB /* CodeSuggestionTableViewCell.xib */, ); path = CodeSuggestionTableViewCell; sourceTree = ""; @@ -10801,7 +10798,6 @@ 083F2B261E9EC10A00714173 /* LoadingPaginationView.xib in Resources */, 2C7FEE6F1FDAF8F600B2B4F1 /* Onboarding.storyboard in Resources */, 08CBA3541F5A2D9400302154 /* Profile.storyboard in Resources */, - 0860D91B1F115D830087D61B /* CodeSuggestionsTableViewController.xib in Resources */, 2C604E1F207E45A1001588FB /* CodeEditorPreviewView.xib in Resources */, 089056131E98021000B8FE6A /* RateAppViewController.xib in Resources */, 2CE8391120C8101500FE3672 /* AchievementBadgeView.xib in Resources */, @@ -10811,7 +10807,6 @@ 2CB9E8D11F839C8E0004E17F /* NotificationsTableViewCell.xib in Resources */, 2CA9D98C20123343007AA743 /* adjectives_f.plist in Resources */, 08484F04211AF4320006266F /* TextStoryView.xib in Resources */, - 08FEFC1E1F117257005CA0FB /* CodeSuggestionTableViewCell.xib in Resources */, 0888D0F91F1E3CEF00A16863 /* CodeInputAccessoryView.xib in Resources */, 2CB62BEE2019FDB100B5E336 /* arrow_right.svg in Resources */, 2CA9D98A2011FBD5007AA743 /* LeaderboardTableViewCell.xib in Resources */, @@ -12233,6 +12228,7 @@ 62E9823012ADAFCE54EA40F4 /* CourseInfoTabSyllabusInteractor.swift in Sources */, 62E98ACECB6FC9CAE9A80729 /* CourseInfoTabSyllabusPresenter.swift in Sources */, 62E987EF8699C0A291B01127 /* CourseInfoTabSyllabusViewController.swift in Sources */, + 2C5B2A182865879B0097B270 /* CodeSuggestionCellView.swift in Sources */, 62E98433E25F2090FCA2065D /* CourseInfoTabSyllabusViewModel.swift in Sources */, 2C19D99F26174C7400181DB0 /* StepikAcademyCourseListCollectionViewCell.swift in Sources */, 62E984F8DF99824B4D42BAA2 /* CourseInfoTabSyllabusInputProtocol.swift in Sources */, diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift index b605f51a61..7109965fa5 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift @@ -372,10 +372,7 @@ final class CodePlaygroundManager { ) { // TODO: If suggestions are presented, only change the data there, otherwise instantiate and add suggestions view if self.suggestionsController == nil { - self.suggestionsController = CodeSuggestionsTableViewController( - nibName: "CodeSuggestionsTableViewController", - bundle: nil - ) + self.suggestionsController = CodeSuggestionsTableViewController() vc.addChild(self.suggestionsController!) textView.addSubview(self.suggestionsController!.view) self.suggestionsController?.delegate = suggestionsDelegate diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionCellView.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionCellView.swift new file mode 100644 index 0000000000..13aa99a0b1 --- /dev/null +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionCellView.swift @@ -0,0 +1,64 @@ +import SnapKit +import UIKit + +extension CodeSuggestionCellView { + struct Appearance { + let textColor = UIColor.stepikPrimaryText + let textInsets = LayoutInsets(top: 4, left: 10, bottom: 4, right: 0) + } +} + +final class CodeSuggestionCellView: UIView { + let appearance: Appearance + + private lazy var textLabel: UILabel = { + let label = UILabel() + label.textColor = self.appearance.textColor + label.numberOfLines = 1 + return label + }() + + var attributedText: NSAttributedString? { + didSet { + self.textLabel.attributedText = self.attributedText + self.invalidateIntrinsicContentSize() + } + } + + override var intrinsicContentSize: CGSize { + let height = self.appearance.textInsets.top + + self.textLabel.intrinsicContentSize.height + + self.appearance.textInsets.bottom + return CGSize(width: UIView.noIntrinsicMetric, height: height) + } + + init( + frame: CGRect = .zero, + appearance: Appearance = Appearance() + ) { + self.appearance = appearance + super.init(frame: frame) + + self.setupView() + self.addSubviews() + self.makeConstraints() + } + + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +extension CodeSuggestionCellView: ProgrammaticallyInitializableViewProtocol { + func addSubviews() { + self.addSubview(self.textLabel) + } + + func makeConstraints() { + self.textLabel.translatesAutoresizingMaskIntoConstraints = false + self.textLabel.snp.makeConstraints { make in + make.edges.equalToSuperview().inset(self.appearance.textInsets.edgeInsets) + } + } +} diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.swift index 2a0619a193..cea14c40bd 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.swift @@ -1,25 +1,45 @@ -// -// CodeSuggestionTableViewCell.swift -// Stepic -// -// Created by Ostrenkiy on 08.07.17. -// Copyright © 2017 Alex Karpov. All rights reserved. -// - +import SnapKit import UIKit -final class CodeSuggestionTableViewCell: UITableViewCell { - @IBOutlet weak var suggestionLabel: StepikLabel! +extension CodeSuggestionTableViewCell { + enum Appearance { + static let defaultFontSize: CGFloat = 11 + } +} + +final class CodeSuggestionTableViewCell: UITableViewCell, Reusable { + private lazy var cellView = CodeSuggestionCellView() + + override func updateConstraintsIfNeeded() { + super.updateConstraintsIfNeeded() + + if self.cellView.superview == nil { + self.setupSubview() + } + } + + override func prepareForReuse() { + super.prepareForReuse() + self.cellView.attributedText = nil + } func setSuggestion(_ suggestion: String, prefixLength: Int, size: CodeSuggestionsSize?) { - var fontSize: CGFloat = 11 - if let sz = size?.realSizes.fontSize { - fontSize = sz + let fontSize = size?.realSizes.fontSize ?? Appearance.defaultFontSize + + let boldFont = UIFont(name: "Courier-Bold", size: fontSize) ?? UIFont.boldSystemFont(ofSize: fontSize) + let regularFont = UIFont(name: "Courier", size: fontSize) ?? UIFont.systemFont(ofSize: fontSize) + + let attributedSuggestion = NSMutableAttributedString(string: suggestion, attributes: [.font: regularFont]) + attributedSuggestion.addAttributes([.font: boldFont], range: NSRange(location: 0, length: prefixLength)) + + self.cellView.attributedText = attributedSuggestion + } + + private func setupSubview() { + self.contentView.addSubview(self.cellView) + self.cellView.translatesAutoresizingMaskIntoConstraints = false + self.cellView.snp.makeConstraints { make in + make.edges.equalToSuperview() } - let boldCourier = UIFont(name: "Courier-Bold", size: fontSize)! - let regularCourier = UIFont(name: "Courier", size: fontSize)! - let attributedSuggestion = NSMutableAttributedString(string: suggestion, attributes: [NSAttributedString.Key.font: regularCourier]) - attributedSuggestion.addAttributes([NSAttributedString.Key.font: boldCourier], range: NSRange(location: 0, length: prefixLength)) - suggestionLabel.attributedText = attributedSuggestion } } diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.xib b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.xib deleted file mode 100644 index f6e395f6d6..0000000000 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionTableViewCell/CodeSuggestionTableViewCell.xib +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift index 561594d9ad..3d2b7d051f 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift @@ -1,82 +1,104 @@ -// -// CodeSuggestionsTableViewController.swift -// Stepic -// -// Created by Ostrenkiy on 08.07.17. -// Copyright © 2017 Alex Karpov. All rights reserved. -// - import UIKit protocol CodeSuggestionDelegate: AnyObject { - func didSelectSuggestion(suggestion: String, prefix: String) var suggestionsSize: CodeSuggestionsSize { get } + + func didSelectSuggestion(suggestion: String, prefix: String) } final class CodeSuggestionsTableViewController: UITableViewController { + private static let defaultSuggestionHeigh: CGFloat = 22 + private static let maxSuggestionCount = 4 + + weak var delegate: CodeSuggestionDelegate? + + private var suggestionRowHeight: CGFloat { + if let size = self.delegate?.suggestionsSize { + return size.realSizes.suggestionHeight + } else { + return Self.defaultSuggestionHeigh + } + } + var suggestions: [String] = [] { didSet { - tableView.reloadData() + self.tableView.reloadData() } } var prefix: String = "" { didSet { - tableView.reloadData() + self.tableView.reloadData() } } - private var suggestionHeight: CGFloat { - if let size = delegate?.suggestionsSize { - return size.realSizes.suggestionHeight - } else { - return 22 - } + var suggestionsHeight: CGFloat { + self.suggestionRowHeight * CGFloat(min(Self.maxSuggestionCount, self.suggestions.count)) } - private let maxSuggestionCount = 4 - weak var delegate: CodeSuggestionDelegate? + init(suggestions: [String] = [], prefix: String = "") { + self.suggestions = suggestions + self.prefix = prefix + super.init(style: .plain) + } - var suggestionsHeight: CGFloat { suggestionHeight * CGFloat(min(maxSuggestionCount, suggestions.count)) } + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } override func viewDidLoad() { super.viewDidLoad() - tableView.register(UINib(nibName: "CodeSuggestionTableViewCell", bundle: nil), forCellReuseIdentifier: "CodeSuggestionTableViewCell") + self.tableView.register(cellClass: CodeSuggestionTableViewCell.self) - tableView.allowsSelection = false + self.tableView.separatorStyle = .singleLine + self.tableView.separatorInset = .zero + + self.tableView.allowsSelection = false self.clearsSelectionOnViewWillAppear = false - tableView.rowHeight = suggestionHeight + self.tableView.rowHeight = self.suggestionRowHeight //Adding tap gesture recognizer to catch selection to avoid resignFirstResponder call and keyboard disappearance - let tapG = UITapGestureRecognizer(target: self, action: #selector(CodeSuggestionsTableViewController.didTap(recognizer:))) - tableView.addGestureRecognizer(tapG) + let tapGestureRecognizer = UITapGestureRecognizer( + target: self, + action: #selector(self.didTap(recognizer:)) + ) + self.tableView.addGestureRecognizer(tapGestureRecognizer) } - @objc func didTap(recognizer: UITapGestureRecognizer) { - let location = recognizer.location(in: self.tableView) - let path = tableView.indexPathForRow(at: location) - if let row = path?.row { - delegate?.didSelectSuggestion(suggestion: suggestions[row], prefix: prefix) - } + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + self.suggestions.count } - // MARK: - Table view data source - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { suggestions.count } - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell( - withIdentifier: "CodeSuggestionTableViewCell", - for: indexPath - ) as? CodeSuggestionTableViewCell else { - return UITableViewCell() - } + let cell: CodeSuggestionTableViewCell = tableView.dequeueReusableCell(for: indexPath) + cell.updateConstraintsIfNeeded() - cell.setSuggestion(suggestions[indexPath.row], prefixLength: prefix.count, size: delegate?.suggestionsSize) + cell.setSuggestion( + self.suggestions[indexPath.row], + prefixLength: self.prefix.count, + size: self.delegate?.suggestionsSize + ) return cell } - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { suggestionHeight } + override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + self.suggestionRowHeight + } + + // MARK: Private API + + @objc + private func didTap(recognizer: UITapGestureRecognizer) { + let location = recognizer.location(in: self.tableView) + let indexPath = tableView.indexPathForRow(at: location) + + guard let row = indexPath?.row else { + return + } + + self.delegate?.didSelectSuggestion(suggestion: self.suggestions[row], prefix: self.prefix) + } } diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.xib b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.xib deleted file mode 100644 index 654858faf5..0000000000 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.xib +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1b218b20ba28e35cc03d52a6e9de38cc80240a56 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 14:02:41 +0700 Subject: [PATCH 07/43] Fix typo --- .../CodeSuggestionsTableViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift index 3d2b7d051f..a33cbdca8c 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/CodeSuggestionsTableViewController/CodeSuggestionsTableViewController.swift @@ -7,7 +7,7 @@ protocol CodeSuggestionDelegate: AnyObject { } final class CodeSuggestionsTableViewController: UITableViewController { - private static let defaultSuggestionHeigh: CGFloat = 22 + private static let defaultSuggestionHeight: CGFloat = 22 private static let maxSuggestionCount = 4 weak var delegate: CodeSuggestionDelegate? @@ -16,7 +16,7 @@ final class CodeSuggestionsTableViewController: UITableViewController { if let size = self.delegate?.suggestionsSize { return size.realSizes.suggestionHeight } else { - return Self.defaultSuggestionHeigh + return Self.defaultSuggestionHeight } } From 64ed9136c06799f531dbf5d4f6bfb8ae7f41d1a4 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 14:51:54 +0700 Subject: [PATCH 08/43] Update shouldMakeTabLineAfter --- .../CodeAnalysis/CodePlaygroundManager.swift | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift index 7109965fa5..21dc26ea1a 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift @@ -87,11 +87,30 @@ final class CodePlaygroundManager { language: CodeLanguage ) -> (shouldMakeNewLine: Bool, paired: Bool) { switch language { - case .python: + case .python, .python31: return symbol == ":" ? (shouldMakeNewLine: true, paired: false) : (shouldMakeNewLine: false, paired: false) - case .c, .cpp11, .cpp, .java, .java8, .java9, .java11, .cs, .kotlin, .swift, .rust, .javascript, .scala, .go, .perl, .php: + case .c, + .cValgrind, + .cpp11, + .cpp, + .java, + .java8, + .java9, + .java11, + .java17, + .cs, + .csMono, + .kotlin, + .swift, + .rust, + .javascript, + .scala, + .scala3, + .go, + .perl, + .php: return symbol == "{" ? (shouldMakeNewLine: true, paired: true) : (shouldMakeNewLine: false, paired: false) From b84d7daeb6f172bdbec35129afbc6b881f49a059 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 14:52:58 +0700 Subject: [PATCH 09/43] Update AutocompleteWords --- .../CodeQuiz/CodeSuggestions/AutocompleteWords.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/AutocompleteWords.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/AutocompleteWords.swift index aa80bd1540..6921d71084 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/AutocompleteWords.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/AutocompleteWords.swift @@ -15,16 +15,16 @@ struct AutocompleteWords { var suggestions: [String] = [] switch language { - case .python: + case .python, .python31: suggestions = python break - case .cpp, .cpp11: + case .cpp, .cpp11, .c, .cValgrind: suggestions = cpp break - case .cs: + case .cs, .csMono: suggestions = cs break - case .java, .java8, .java9, .java11: + case .java, .java8, .java9, .java11, .java17: suggestions = java break case .javascript: @@ -35,7 +35,7 @@ struct AutocompleteWords { break case .sql: suggestions = sql - case .haskell, .haskell7, .haskell8: + case .haskell, .haskell7, .haskell8, .haskell88: suggestions = haskell case .r: suggestions = r From 4805e3d3b2e2e1dfb2813202ce0623b7ccfac55d Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 15:52:57 +0700 Subject: [PATCH 10/43] Update CodePlaygroundManager.allowedCharactersSet --- .../CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift index 21dc26ea1a..ee6b095bdb 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeAnalysis/CodePlaygroundManager.swift @@ -15,7 +15,7 @@ final class CodePlaygroundManager { let closers: [String: String] = ["{": "}", "[": "]", "(": ")", "\"": "\"", "'": "'"] - let allowedCharacters: String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_" + let allowedCharactersSet = Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_") var suggestionsController: CodeSuggestionsTableViewController? var isSuggestionsViewPresented: Bool { self.suggestionsController != nil } @@ -130,13 +130,13 @@ final class CodePlaygroundManager { var offsetBefore = 0 while let character = text[safe: (cursorPosition - offsetBefore - 1)], - self.allowedCharacters.contains(character) { + self.allowedCharactersSet.contains(character) { offsetBefore += 1 } var offsetAfter = 0 while let character = text[safe: (cursorPosition + offsetAfter)], - self.allowedCharacters.contains(character) { + self.allowedCharactersSet.contains(character) { offsetAfter += 1 } From 16395e37a3e479c76c3358ad40b2a9ba492c5624 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 17:53:35 +0700 Subject: [PATCH 11/43] Update CodeSnippetSymbols --- .../Quizzes/CodeQuiz/InputAccessory/CodeSnippetSymbols.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/CodeSnippetSymbols.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/CodeSnippetSymbols.swift index b2abc3bbba..fc72400a1d 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/CodeSnippetSymbols.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/CodeSnippetSymbols.swift @@ -16,9 +16,9 @@ struct CodeSnippetSymbols { static func snippets(language: CodeLanguage) -> [String] { switch language { - case .python: + case .python, .python31: return python - case .java, .java8, .java9, .java11: + case .java, .java8, .java9, .java11, .java17: return java case .sql: return sql From 01c212ad08c5d4808dc0079e7c852ee3d3a396d5 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 18:36:34 +0700 Subject: [PATCH 12/43] Refactor CodeInputAccessoryCollectionViewCell --- Stepic.xcodeproj/project.pbxproj | 4 - ...CodeInputAccessoryCollectionViewCell.swift | 103 ++++++++++++------ .../CodeInputAccessoryCollectionViewCell.xib | 41 ------- 3 files changed, 70 insertions(+), 78 deletions(-) delete mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.xib diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index aa8d3099fb..1726f87474 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -193,7 +193,6 @@ 0888D0F91F1E3CEF00A16863 /* CodeInputAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0888D0F81F1E3CEF00A16863 /* CodeInputAccessoryView.xib */; }; 0888D0FD1F1E3CFC00A16863 /* CodeInputAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D0FC1F1E3CFC00A16863 /* CodeInputAccessoryView.swift */; }; 0888D1021F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */; }; - 0888D1051F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0888D1011F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.xib */; }; 0888D1091F1E42A000A16863 /* CodeElementsSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D1081F1E42A000A16863 /* CodeElementsSize.swift */; }; 088CB1EC1D4BD5ED00C6ED1B /* FreeAnswerDataset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 088CB1EB1D4BD5ED00C6ED1B /* FreeAnswerDataset.swift */; }; 088E58C11DE34E2F0009B9CE /* SocialSDKProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 088E58C01DE34E2F0009B9CE /* SocialSDKProvider.swift */; }; @@ -2218,7 +2217,6 @@ 0888D0F81F1E3CEF00A16863 /* CodeInputAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeInputAccessoryView.xib; sourceTree = ""; }; 0888D0FC1F1E3CFC00A16863 /* CodeInputAccessoryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryView.swift; sourceTree = ""; }; 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryCollectionViewCell.swift; sourceTree = ""; }; - 0888D1011F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeInputAccessoryCollectionViewCell.xib; sourceTree = ""; }; 0888D1081F1E42A000A16863 /* CodeElementsSize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeElementsSize.swift; sourceTree = ""; }; 088CB1EB1D4BD5ED00C6ED1B /* FreeAnswerDataset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FreeAnswerDataset.swift; sourceTree = ""; }; 088E58C01DE34E2F0009B9CE /* SocialSDKProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocialSDKProvider.swift; sourceTree = ""; }; @@ -6390,7 +6388,6 @@ isa = PBXGroup; children = ( 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */, - 0888D1011F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.xib */, ); path = CodeInputAccessoryCollectionViewCell; sourceTree = ""; @@ -10829,7 +10826,6 @@ 2C6E9CD41FED657E001821A2 /* Adaptive.storyboard in Resources */, 08AC213C1CDD35DF00FBB9CD /* Users.plist in Resources */, 2CADE6182487B4BD00F523FA /* GoogleService-Info.plist in Resources */, - 0888D1051F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.xib in Resources */, 2C22043420E28AD50060117A /* AchievementListSkeletonPlaceholderView.xib in Resources */, 08FCC79420F3BAEB008B84B9 /* stepikcontent.css in Resources */, 2C6B2F9D20D7F24800F7C976 /* AchievementPopupViewController.xib in Resources */, diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift index 2abcf61311..062c0219df 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift @@ -1,50 +1,87 @@ -// -// CodeInputAccessoryCollectionViewCell.swift -// Stepic -// -// Created by Ostrenkiy on 18.07.17. -// Copyright © 2017 Alex Karpov. All rights reserved. -// - +import SnapKit import UIKit -final class CodeInputAccessoryCollectionViewCell: UICollectionViewCell { - @IBOutlet weak var textLabel: UILabel! +extension CodeInputAccessoryCollectionViewCell { + enum Appearance { + static let textColor = UIColor.stepikSystemPrimaryText - var text: String? - var size: CodeInputAccessorySize? + static let cornerRadius: CGFloat = 4 + static let borderWidth: CGFloat = 1 + static let borderColor = UIColor.clear.cgColor - static func width(for text: String, size: CodeInputAccessorySize) -> CGFloat { - let label = UILabel(frame: CGRect(x: 0, y: 0, width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)) - label.numberOfLines = 1 + static let backgroundColor = UIColor.stepikTertiaryBackground + + static let calculateWidthBoundsWidthPadding: CGFloat = 10 + } +} + +final class CodeInputAccessoryCollectionViewCell: UICollectionViewCell, Reusable { + private lazy var textLabel = Self.makeTextLabel() + + override init(frame: CGRect) { + super.init(frame: frame) + + self.setupView() + self.addSubviews() + self.makeConstraints() + } + + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configure(text: String, size: CodeInputAccessorySize) { + self.textLabel.text = text + self.textLabel.font = Self.makeFont(for: size) + } + + static func calculateWidth(for text: String, size: CodeInputAccessorySize) -> CGFloat { + let label = self.makeTextLabel( + frame: CGRect(x: 0, y: 0, width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude), + size: size + ) label.text = text - label.font = UIFont(name: "Courier", size: size.realSizes.textSize)! - label.textAlignment = .center label.sizeToFit() + return max(size.realSizes.minAccessoryWidth, label.bounds.width + Appearance.calculateWidthBoundsWidthPadding) + } + + private static func makeTextLabel(frame: CGRect = .zero, size: CodeInputAccessorySize? = nil) -> UILabel { + let label = UILabel(frame: frame) + label.textColor = Appearance.textColor + label.numberOfLines = 1 + label.textAlignment = .center - return max(size.realSizes.minAccessoryWidth, label.bounds.width + 10) + if let size = size { + label.font = self.makeFont(for: size) + } + + return label + } + + private static func makeFont(for size: CodeInputAccessorySize) -> UIFont { + UIFont(name: "Courier", size: size.realSizes.textSize) ?? .systemFont(ofSize: size.realSizes.textSize) } +} - override func layoutSubviews() { - super.layoutSubviews() +extension CodeInputAccessoryCollectionViewCell: ProgrammaticallyInitializableViewProtocol { + func setupView() { + self.layer.cornerRadius = Appearance.cornerRadius + self.layer.borderWidth = Appearance.borderWidth + self.layer.borderColor = Appearance.borderColor + self.layer.masksToBounds = true self.backgroundColor = .stepikTertiaryBackground - self.textLabel.textColor = .stepikSystemPrimaryText } - func initialize(text: String, size: CodeInputAccessorySize) { - self.text = text - self.size = size - textLabel.text = text - let regularCourier = UIFont(name: "Courier", size: size.realSizes.textSize)! - textLabel.font = regularCourier - setRoundedStyle() + func addSubviews() { + self.contentView.addSubview(self.textLabel) } - private func setRoundedStyle() { - self.layer.cornerRadius = 4.0 - self.layer.borderWidth = 1.0 - self.layer.borderColor = UIColor.clear.cgColor - self.layer.masksToBounds = true + func makeConstraints() { + self.textLabel.translatesAutoresizingMaskIntoConstraints = false + self.textLabel.snp.makeConstraints { make in + make.edges.equalToSuperview() + } } } diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.xib b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.xib deleted file mode 100644 index d10217f9d8..0000000000 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 9bcbaf069619892352b55df62b6986cd3efbe420 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 19:18:48 +0700 Subject: [PATCH 13/43] Refactor CodeInputAccessoryView --- Stepic.xcodeproj/project.pbxproj | 26 +-- .../CodeInputAccessoryButtonData.swift | 6 + ...CodeInputAccessoryCollectionViewCell.swift | 0 .../Toolbar/CodeInputAccessoryView.swift | 153 ++++++++++++++++++ .../CodeInputAccessoryView.swift | 88 ---------- .../CodeInputAccessoryView.xib | 58 ------- 6 files changed, 164 insertions(+), 167 deletions(-) create mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryButtonData.swift rename Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/{CodeInputAccessoryCollectionViewCell => }/CodeInputAccessoryCollectionViewCell.swift (100%) create mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView.swift delete mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.swift delete mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.xib diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 1726f87474..c77079e873 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -190,7 +190,6 @@ 0885F8561BA9F18900F2A188 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0885F8551BA9F18900F2A188 /* Parser.swift */; }; 0885F8581BAAD43300F2A188 /* AuthInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0885F8571BAAD43300F2A188 /* AuthInfo.swift */; }; 08883AC2214C52EC00898BBE /* ModalOrPushStackRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08883AC1214C52EC00898BBE /* ModalOrPushStackRouter.swift */; }; - 0888D0F91F1E3CEF00A16863 /* CodeInputAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0888D0F81F1E3CEF00A16863 /* CodeInputAccessoryView.xib */; }; 0888D0FD1F1E3CFC00A16863 /* CodeInputAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D0FC1F1E3CFC00A16863 /* CodeInputAccessoryView.swift */; }; 0888D1021F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */; }; 0888D1091F1E42A000A16863 /* CodeElementsSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0888D1081F1E42A000A16863 /* CodeElementsSize.swift */; }; @@ -550,6 +549,7 @@ 2C313E5326AFE3CB004ECBD2 /* StepQuizReviewStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C313E5226AFE3CB004ECBD2 /* StepQuizReviewStatusView.swift */; }; 2C313E5526AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C313E5426AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift */; }; 2C32E71320FF6C1D008BB909 /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2CC351841F6827BE004255B6 /* Auth.storyboard */; }; + 2C336D1F2865DDB900C91342 /* CodeInputAccessoryButtonData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C336D1E2865DDB900C91342 /* CodeInputAccessoryButtonData.swift */; }; 2C381BEF25505EC90084AD90 /* CourseListFilterBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C381BEE25505EC90084AD90 /* CourseListFilterBarButtonItem.swift */; }; 2C38D49E27BBCAC6002865B7 /* PromoBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49D27BBCAC6002865B7 /* PromoBanner.swift */; }; 2C38D4A027BBD074002865B7 /* PromoBannersService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49F27BBD074002865B7 /* PromoBannersService.swift */; }; @@ -2214,7 +2214,6 @@ 0885F8551BA9F18900F2A188 /* Parser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = ""; }; 0885F8571BAAD43300F2A188 /* AuthInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AuthInfo.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 08883AC1214C52EC00898BBE /* ModalOrPushStackRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalOrPushStackRouter.swift; sourceTree = ""; }; - 0888D0F81F1E3CEF00A16863 /* CodeInputAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeInputAccessoryView.xib; sourceTree = ""; }; 0888D0FC1F1E3CFC00A16863 /* CodeInputAccessoryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryView.swift; sourceTree = ""; }; 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryCollectionViewCell.swift; sourceTree = ""; }; 0888D1081F1E42A000A16863 /* CodeElementsSize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeElementsSize.swift; sourceTree = ""; }; @@ -2600,6 +2599,7 @@ 2C313E5226AFE3CB004ECBD2 /* StepQuizReviewStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepQuizReviewStatusView.swift; sourceTree = ""; }; 2C313E5426AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepQuizReviewStatusCircleView.swift; sourceTree = ""; }; 2C32664224B00BEF0013C473 /* Model_course_purchases_v54.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_course_purchases_v54.xcdatamodel; sourceTree = ""; }; + 2C336D1E2865DDB900C91342 /* CodeInputAccessoryButtonData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryButtonData.swift; sourceTree = ""; }; 2C35C4C61F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/adjectives_f.plist; sourceTree = ""; }; 2C35C4C81F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/adjectives_m.plist; sourceTree = ""; }; 2C35C4CA1F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/nouns_f.plist; sourceTree = ""; }; @@ -6378,27 +6378,11 @@ 2CA4CF8C242A173F008BC4E8 /* Toolbar */ = { isa = PBXGroup; children = ( - 2CA4CF8D242A1759008BC4E8 /* CodeInputAccessoryCollectionViewCell */, - 2CA4CF8E242A1760008BC4E8 /* CodeInputAccessoryView */, - ); - path = Toolbar; - sourceTree = ""; - }; - 2CA4CF8D242A1759008BC4E8 /* CodeInputAccessoryCollectionViewCell */ = { - isa = PBXGroup; - children = ( + 2C336D1E2865DDB900C91342 /* CodeInputAccessoryButtonData.swift */, 0888D1001F1E41FF00A16863 /* CodeInputAccessoryCollectionViewCell.swift */, - ); - path = CodeInputAccessoryCollectionViewCell; - sourceTree = ""; - }; - 2CA4CF8E242A1760008BC4E8 /* CodeInputAccessoryView */ = { - isa = PBXGroup; - children = ( 0888D0FC1F1E3CFC00A16863 /* CodeInputAccessoryView.swift */, - 0888D0F81F1E3CEF00A16863 /* CodeInputAccessoryView.xib */, ); - path = CodeInputAccessoryView; + path = Toolbar; sourceTree = ""; }; 2CA4CF8F242A177B008BC4E8 /* NumberQuiz */ = { @@ -10804,7 +10788,6 @@ 2CB9E8D11F839C8E0004E17F /* NotificationsTableViewCell.xib in Resources */, 2CA9D98C20123343007AA743 /* adjectives_f.plist in Resources */, 08484F04211AF4320006266F /* TextStoryView.xib in Resources */, - 0888D0F91F1E3CEF00A16863 /* CodeInputAccessoryView.xib in Resources */, 2CB62BEE2019FDB100B5E336 /* arrow_right.svg in Resources */, 2CA9D98A2011FBD5007AA743 /* LeaderboardTableViewCell.xib in Resources */, 2CB62BE52019FD8500B5E336 /* step1.html in Resources */, @@ -11397,6 +11380,7 @@ 0834C46C1E2CE66B002F8516 /* MatchingReply.swift in Sources */, 088E58C11DE34E2F0009B9CE /* SocialSDKProvider.swift in Sources */, 2C83E215254975B200D0C1F3 /* SettingsRightDetailCheckboxCellView.swift in Sources */, + 2C336D1F2865DDB900C91342 /* CodeInputAccessoryButtonData.swift in Sources */, 08019A821DEED7E900691F0B /* NotificationSuggestionManager.swift in Sources */, 2C53B4A02588D9CD00E53779 /* SimpleCourseListCollectionViewDelegate.swift in Sources */, 08CE16E01BFA5A80008511B7 /* DeviceInfo.swift in Sources */, diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryButtonData.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryButtonData.swift new file mode 100644 index 0000000000..1d99488bdf --- /dev/null +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryButtonData.swift @@ -0,0 +1,6 @@ +import Foundation + +struct CodeInputAccessoryButtonData { + let title: String + let action: () -> Void +} diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift similarity index 100% rename from Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell/CodeInputAccessoryCollectionViewCell.swift rename to Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView.swift new file mode 100644 index 0000000000..10b69300ed --- /dev/null +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView.swift @@ -0,0 +1,153 @@ +import SnapKit +import UIKit + +extension CodeInputAccessoryView { + struct Appearance { + let hideKeyboardImageViewInsets = LayoutInsets(top: 4, left: 4, bottom: 4, right: 8) + + let collectionViewInsets = LayoutInsets(top: 4, left: 8, bottom: 4, right: 0) + let collectionViewLayoutSectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 4) + let collectionViewLayoutMinimumInteritemSpacing: CGFloat = 4 + + let backgroundColor = UIColor.stepikGroupedBackground + } +} + +final class CodeInputAccessoryView: UIView { + let appearance: Appearance + + private let buttons: [CodeInputAccessoryButtonData] + + private let size: CodeInputAccessorySize + + private let hideKeyboardAction: (() -> Void)? + + private lazy var hideKeyboardImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "Hide keyboard filled Gray")) + imageView.contentMode = .scaleAspectFit + imageView.isUserInteractionEnabled = true + let tapGestureRecognizer = UITapGestureRecognizer( + target: self, + action: #selector(self.didTapHideKeyboardImageView(recognizer:)) + ) + imageView.addGestureRecognizer(tapGestureRecognizer) + return imageView + }() + + private lazy var collectionView: UICollectionView = { + let collectionViewLayout = UICollectionViewFlowLayout() + collectionViewLayout.scrollDirection = .horizontal + collectionViewLayout.sectionInset = self.appearance.collectionViewLayoutSectionInset + collectionViewLayout.minimumInteritemSpacing = self.appearance.collectionViewLayoutMinimumInteritemSpacing + + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout) + collectionView.isPagingEnabled = false + collectionView.showsHorizontalScrollIndicator = false + collectionView.showsVerticalScrollIndicator = false + collectionView.contentInset = .zero + collectionView.backgroundColor = .clear + collectionView.decelerationRate = .fast + + collectionView.delegate = self + collectionView.dataSource = self + collectionView.register(cellClass: CodeInputAccessoryCollectionViewCell.self) + + return collectionView + }() + + init( + frame: CGRect = .zero, + appearance: Appearance = Appearance(), + buttons: [CodeInputAccessoryButtonData] = [], + size: CodeInputAccessorySize = .small, + hideKeyboardAction: @escaping () -> Void + ) { + self.appearance = appearance + self.buttons = buttons + self.size = size + self.hideKeyboardAction = hideKeyboardAction + super.init(frame: frame) + + self.setupView() + self.addSubviews() + self.makeConstraints() + } + + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + @objc + private func didTapHideKeyboardImageView(recognizer: UIGestureRecognizer) { + self.hideKeyboardAction?() + } +} + +// MARK: - CodeInputAccessoryView: ProgrammaticallyInitializableViewProtocol - + +extension CodeInputAccessoryView: ProgrammaticallyInitializableViewProtocol { + func setupView() { + self.backgroundColor = self.appearance.backgroundColor + } + + func addSubviews() { + self.addSubview(self.hideKeyboardImageView) + self.addSubview(self.collectionView) + } + + func makeConstraints() { + self.snp.makeConstraints { $0.height.equalTo(self.size.realSizes.viewHeight) } + + self.hideKeyboardImageView.translatesAutoresizingMaskIntoConstraints = false + self.hideKeyboardImageView.snp.makeConstraints { make in + make.top.leading.bottom.equalToSuperview().inset(self.appearance.hideKeyboardImageViewInsets.edgeInsets) + make.width.equalTo(self.hideKeyboardImageView.snp.height) + } + + self.collectionView.translatesAutoresizingMaskIntoConstraints = false + self.collectionView.snp.makeConstraints { make in + make.top.bottom.trailing.equalToSuperview().inset(self.appearance.collectionViewInsets.edgeInsets) + make.leading + .equalTo(self.hideKeyboardImageView.snp.trailing) + .offset(self.appearance.collectionViewInsets.left) + } + } +} + +// MARK: - CodeInputAccessoryView: UICollectionViewDelegateFlowLayout - + +extension CodeInputAccessoryView: UICollectionViewDelegateFlowLayout { + func collectionView( + _ collectionView: UICollectionView, + layout collectionViewLayout: UICollectionViewLayout, + sizeForItemAt indexPath: IndexPath + ) -> CGSize { + let width = CodeInputAccessoryCollectionViewCell.calculateWidth(for: buttons[indexPath.item].title, size: size) + return CGSize(width: width, height: collectionView.bounds.height) + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + buttons[indexPath.item].action() + } +} + +// MARK: - CodeInputAccessoryView: UICollectionViewDataSource - + +extension CodeInputAccessoryView: UICollectionViewDataSource { + func collectionView( + _ collectionView: UICollectionView, + numberOfItemsInSection section: Int + ) -> Int { + buttons.count + } + + func collectionView( + _ collectionView: UICollectionView, + cellForItemAt indexPath: IndexPath + ) -> UICollectionViewCell { + let cell: CodeInputAccessoryCollectionViewCell = collectionView.dequeueReusableCell(for: indexPath) + cell.configure(text: buttons[indexPath.item].title, size: size) + return cell + } +} diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.swift deleted file mode 100644 index 4a116e0a86..0000000000 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// CodeInputAccessoryView.swift -// Stepic -// -// Created by Ostrenkiy on 18.07.17. -// Copyright © 2017 Alex Karpov. All rights reserved. -// - -import Foundation -import SnapKit - -final class CodeInputAccessoryView: NibInitializableView { - @IBOutlet weak var hideKeyboardImageView: UIImageView! - @IBOutlet weak var collectionView: UICollectionView! - - var hideKeyboardAction: (() -> Void)? - - var buttons: [CodeInputAccessoryButtonData] = [] { - didSet { - collectionView.reloadData() - } - } - - var size: CodeInputAccessorySize = .small - - override var nibName: String { "CodeInputAccessoryView" } - - override func setupSubviews() { - collectionView.register(UINib(nibName: "CodeInputAccessoryCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "CodeInputAccessoryCollectionViewCell") - collectionView.delegate = self - collectionView.dataSource = self - - let tapG = UITapGestureRecognizer(target: self, action: #selector(CodeInputAccessoryView.didTapHideKeyboardImageView(recognizer:))) - hideKeyboardImageView.addGestureRecognizer(tapG) - collectionView.translatesAutoresizingMaskIntoConstraints = false - hideKeyboardImageView.translatesAutoresizingMaskIntoConstraints = false - } - - @objc func didTapHideKeyboardImageView(recognizer: UIGestureRecognizer) { - hideKeyboardAction?() - } - - convenience init(frame: CGRect, buttons: [CodeInputAccessoryButtonData], size: CodeInputAccessorySize, hideKeyboardAction: @escaping () -> Void) { - self.init(frame: frame) - self.size = size - self.hideKeyboardAction = hideKeyboardAction - self.buttons = buttons - self.snp.makeConstraints { $0.height.equalTo(size.realSizes.viewHeight) } - } -} - -extension CodeInputAccessoryView: UICollectionViewDelegateFlowLayout { - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - let width = CodeInputAccessoryCollectionViewCell.width(for: buttons[indexPath.item].title, size: size) - return CGSize(width: width, height: collectionView.bounds.height) - } - - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - buttons[indexPath.item].action() - } -} - -extension CodeInputAccessoryView: UICollectionViewDataSource { - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { buttons.count } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell( - withReuseIdentifier: "CodeInputAccessoryCollectionViewCell", - for: indexPath - ) as? CodeInputAccessoryCollectionViewCell else { - return UICollectionViewCell() - } - - cell.initialize(text: buttons[indexPath.item].title, size: size) - - return cell - } -} - -struct CodeInputAccessoryButtonData { - var title: String - var action: () -> Void - - init(title: String, action: @escaping () -> Void) { - self.title = title - self.action = action - } -} diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.xib b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.xib deleted file mode 100644 index 57b95dd126..0000000000 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryView/CodeInputAccessoryView.xib +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 6fbe5204dce163749daeffcf807f86aae0dc637e Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 19:24:55 +0700 Subject: [PATCH 14/43] Fix CodeInputAccessoryCollectionViewCell backgroundColor --- .../Toolbar/CodeInputAccessoryCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift index 062c0219df..a5b38a8141 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/Toolbar/CodeInputAccessoryCollectionViewCell.swift @@ -71,7 +71,7 @@ extension CodeInputAccessoryCollectionViewCell: ProgrammaticallyInitializableVie self.layer.borderColor = Appearance.borderColor self.layer.masksToBounds = true - self.backgroundColor = .stepikTertiaryBackground + self.backgroundColor = Appearance.backgroundColor } func addSubviews() { From 11b902ad882a33156420469aff4177e757f7f0a6 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Fri, 24 Jun 2022 19:35:46 +0700 Subject: [PATCH 15/43] Update InputAccessoryBuilder --- .../InputAccessory/InputAccessoryBuilder.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/InputAccessoryBuilder.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/InputAccessoryBuilder.swift index 2596ed1259..5ba78dedd4 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/InputAccessoryBuilder.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/InputAccessory/InputAccessoryBuilder.swift @@ -1,14 +1,6 @@ -// -// InputAccessoryBuilder.swift -// Stepic -// -// Created by Ostrenkiy on 08.07.17. -// Copyright © 2017 Alex Karpov. All rights reserved. -// - import Foundation -final class InputAccessoryBuilder { +enum InputAccessoryBuilder { static func buildAccessoryView( size: CodeInputAccessorySize, language: CodeLanguage, From 8898aacf80eecdab70d68969dba221e5f289db45 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Wed, 29 Jun 2022 14:49:19 +0400 Subject: [PATCH 16/43] Add CodeLanguageSamples --- Stepic.xcodeproj/project.pbxproj | 28 ++++- .../CodeLanguageSamples.swift | 116 ++++++++++++++++++ .../code-language-samples.plist | 92 ++++++++++++++ .../Quizzes/CodeQuiz/CodeLanguages.swift | 49 +------- .../AutocompleteWords.swift | 0 .../autocomplete_suggestions.plist | 0 6 files changed, 235 insertions(+), 50 deletions(-) create mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/CodeLanguageSamples.swift create mode 100644 Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/code-language-samples.plist rename Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/{ => AutocompleteWords}/AutocompleteWords.swift (100%) rename Stepic/{ => Legacy/Controllers/Quizzes/CodeQuiz/CodeSuggestions/AutocompleteWords}/autocomplete_suggestions.plist (100%) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index c77079e873..e320fbe29f 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -490,6 +490,8 @@ 2C203B2D253F0FC0000683E6 /* TableReply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C203B2C253F0FC0000683E6 /* TableReply.swift */; }; 2C20778022BB897200D44DC0 /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20777F22BB897200D44DC0 /* DispatchQueue+Promise.swift */; }; 2C20778422BBA54800D44DC0 /* QuizStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20778322BBA54800D44DC0 /* QuizStatus.swift */; }; + 2C20B292286C63F5000F458A /* CodeLanguageSamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20B291286C63F5000F458A /* CodeLanguageSamples.swift */; }; + 2C20B294286C640B000F458A /* code-language-samples.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2C20B293286C640B000F458A /* code-language-samples.plist */; }; 2C20C85922F8D08F0052E9BF /* StepOptionsPersistenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20C85822F8D08F0052E9BF /* StepOptionsPersistenceService.swift */; }; 2C20C85E22F8E19F0052E9BF /* StepOptionsPlainObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20C85D22F8E19F0052E9BF /* StepOptionsPlainObject.swift */; }; 2C20C86022F8E1C90052E9BF /* CodeLimitPlainObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C20C85F22F8E1C90052E9BF /* CodeLimitPlainObject.swift */; }; @@ -2537,6 +2539,8 @@ 2C203B2C253F0FC0000683E6 /* TableReply.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableReply.swift; sourceTree = ""; }; 2C20777F22BB897200D44DC0 /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Promise.swift"; sourceTree = ""; }; 2C20778322BBA54800D44DC0 /* QuizStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizStatus.swift; sourceTree = ""; }; + 2C20B291286C63F5000F458A /* CodeLanguageSamples.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeLanguageSamples.swift; sourceTree = ""; }; + 2C20B293286C640B000F458A /* code-language-samples.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "code-language-samples.plist"; sourceTree = ""; }; 2C20C85822F8D08F0052E9BF /* StepOptionsPersistenceService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepOptionsPersistenceService.swift; sourceTree = ""; }; 2C20C85D22F8E19F0052E9BF /* StepOptionsPlainObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepOptionsPlainObject.swift; sourceTree = ""; }; 2C20C85F22F8E1C90052E9BF /* CodeLimitPlainObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeLimitPlainObject.swift; sourceTree = ""; }; @@ -4649,6 +4653,24 @@ path = CoursePurchase; sourceTree = ""; }; + 2C20B290286C63EE000F458A /* CodeLanguageSamples */ = { + isa = PBXGroup; + children = ( + 2C20B293286C640B000F458A /* code-language-samples.plist */, + 2C20B291286C63F5000F458A /* CodeLanguageSamples.swift */, + ); + path = CodeLanguageSamples; + sourceTree = ""; + }; + 2C20B295286C6465000F458A /* AutocompleteWords */ = { + isa = PBXGroup; + children = ( + 2C104B672069064D0026FEB9 /* autocomplete_suggestions.plist */, + 08FEFC201F127470005CA0FB /* AutocompleteWords.swift */, + ); + path = AutocompleteWords; + sourceTree = ""; + }; 2C249864275FDD3B00C688EB /* Error */ = { isa = PBXGroup; children = ( @@ -5011,7 +5033,6 @@ 2CDE82E1221D5CCB00C41887 /* highlight.js */, 2C4F3B082432693D002ADB53 /* jquery-3.4.1.min.js */, 2C4F3B072432693D002ADB53 /* kotlin-playground-1.21.1.min.js */, - 2C104B672069064D0026FEB9 /* autocomplete_suggestions.plist */, 2CADE6172487B4BC00F523FA /* GoogleService-Info.plist */, 2C1A4D92244F8A1500D0F2DF /* ARKit-Badge-Glyph-Only.png */, 0869F6D71CE3684000F8A6DB /* default_sound.wav */, @@ -6324,6 +6345,7 @@ 0888D1081F1E42A000A16863 /* CodeElementsSize.swift */, 080E80F41F0070C900DC0EA5 /* CodeLanguages.swift */, 2CA4CF87242A16E4008BC4E8 /* CodeAnalysis */, + 2C20B290286C63EE000F458A /* CodeLanguageSamples */, 2CA4CF88242A16EF008BC4E8 /* CodeSuggestions */, 2CA4CF8B242A1732008BC4E8 /* InputAccessory */, ); @@ -6341,7 +6363,7 @@ 2CA4CF88242A16EF008BC4E8 /* CodeSuggestions */ = { isa = PBXGroup; children = ( - 08FEFC201F127470005CA0FB /* AutocompleteWords.swift */, + 2C20B295286C6465000F458A /* AutocompleteWords */, 2CA4CF89242A1708008BC4E8 /* CodeSuggestionsTableViewController */, 2CA4CF8A242A1710008BC4E8 /* CodeSuggestionTableViewCell */, ); @@ -10768,6 +10790,7 @@ 0819856D20BF273800897BBA /* PersonalDeadlineTableViewCell.xib in Resources */, 2C104B682069064D0026FEB9 /* autocomplete_suggestions.plist in Resources */, 2C7FEE7A1FDAFB4600B2B4F1 /* OnboardingPageView.xib in Resources */, + 2C20B294286C640B000F458A /* code-language-samples.plist in Resources */, 2C5DF1461FED2B36003B1177 /* StepCardView.xib in Resources */, 2C5D963B24C9B251004E9FD1 /* Auth-Release.plist in Resources */, 2CA9D9832010A13C007AA743 /* ProgressTableViewCell.xib in Resources */, @@ -12748,6 +12771,7 @@ DA1ACE98741C42B9DCBBFB02 /* NewProfileCertificatesProvider.swift in Sources */, 19BCC6AE85FA7F15895BFDD0 /* NewProfileCertificatesView.swift in Sources */, 2CAC7D5624EF56A600942D14 /* FillBlanksQuizInputContainerView.swift in Sources */, + 2C20B292286C63F5000F458A /* CodeLanguageSamples.swift in Sources */, 247608C654D7C9A7C5994A12 /* NewProfileCertificatesViewController.swift in Sources */, 224F80151254989529458041 /* NewProfileCreatedCoursesAssembly.swift in Sources */, B2FE12ABF98ED99EAF727405 /* NewProfileCreatedCoursesDataFlow.swift in Sources */, diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/CodeLanguageSamples.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/CodeLanguageSamples.swift new file mode 100644 index 0000000000..480702a1d2 --- /dev/null +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/CodeLanguageSamples.swift @@ -0,0 +1,116 @@ +import Foundation + +enum CodeLanguageSamples { + private static let samplesDictionary: [String: String] = { + guard let path = Bundle.main.path(forResource: "code-language-samples", ofType: "plist"), + let result = NSDictionary(contentsOfFile: path) as? [String: String] + else { + return [:] + } + return result + }() + + private static let python = samplesDictionary[Key.python.rawValue] + private static let cpp = samplesDictionary[Key.cpp.rawValue] + private static let haskell = samplesDictionary[Key.haskell.rawValue] + private static let java = samplesDictionary[Key.java.rawValue] + private static let octave = samplesDictionary[Key.octave.rawValue] + private static let assembler = samplesDictionary[Key.assembler.rawValue] + private static let shell = samplesDictionary[Key.shell.rawValue] + private static let rust = samplesDictionary[Key.rust.rawValue] + private static let r = samplesDictionary[Key.r.rawValue] + private static let ruby = samplesDictionary[Key.ruby.rawValue] + private static let clojure = samplesDictionary[Key.clojure.rawValue] + private static let cs = samplesDictionary[Key.cs.rawValue] + private static let javascript = samplesDictionary[Key.javascript.rawValue] + private static let scala = samplesDictionary[Key.scala.rawValue] + private static let kotlin = samplesDictionary[Key.kotlin.rawValue] + private static let go = samplesDictionary[Key.go.rawValue] + private static let pascal = samplesDictionary[Key.pascal.rawValue] + private static let perl = samplesDictionary[Key.perl.rawValue] + private static let sql = samplesDictionary[Key.sql.rawValue] + private static let swift = samplesDictionary[Key.swift.rawValue] + private static let php = samplesDictionary[Key.php.rawValue] + private static let julia = samplesDictionary[Key.julia.rawValue] + private static let dart = samplesDictionary[Key.dart.rawValue] + + static func sample(for language: CodeLanguage) -> String { + let sample: String = { () -> String? in + switch language { + case .python, .python31: + return python + case .cpp, .cpp11, .c, .cValgrind: + return cpp + case .haskell, .haskell7, .haskell8, .haskell88: + return haskell + case .java, .java8, .java9, .java11, .java17: + return java + case .octave: + return octave + case .asm32, .asm64: + return assembler + case .shell: + return shell + case .rust: + return rust + case .r: + return r + case .ruby: + return ruby + case .clojure: + return clojure + case .cs, .csMono: + return cs + case .javascript: + return javascript + case .scala, .scala3: + return scala + case .kotlin: + return kotlin + case .go: + return go + case .pascal: + return pascal + case .perl: + return perl + case .sql: + return sql + case .swift: + return swift + case .php: + return php + case .julia: + return julia + case .dart: + return dart + } + }() ?? "" + return sample + } + + private enum Key: String { + case python + case cpp + case haskell + case java + case octave + case assembler + case shell + case rust + case r + case ruby + case clojure + case cs + case javascript + case scala + case kotlin + case go + case pascal + case perl + case sql + case swift + case php + case julia + case dart + } +} diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/code-language-samples.plist b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/code-language-samples.plist new file mode 100644 index 0000000000..fde4576e2b --- /dev/null +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguageSamples/code-language-samples.plist @@ -0,0 +1,92 @@ + + + + + python + print("Hello World") + cpp + #include <iostream> + + int main() { + std::cout << "Hello World" << std::endl; + } + haskell + module Main where + + main = putStrLn "Hello World" + java + public class Main { + public static void main(String[] args) { + System.out.println("Hello World"); + } + } + octave + printf("Hello World"); + assembler + + mov ax,cs + mov ds,ax + mov ah,9 + mov dx, offset Hello + int 21h + xor ax,ax + int 21h + + Hello: + + db "Hello World!",13,10,"$" + shell + echo "Hello World" + rust + fn main() { + println!("Hello World"); + } + r + cat("Hello World") + ruby + print "Hello World" + clojure + (println "Hello World") + cs + System.Console.WriteLine("Hello World"); + javascript + console.log("Hello World"); + scala + object HelloWorld extends App { + println("Hello World") + } + kotlin + fun main() { + println("Hello World") + } + go + package main + + import "fmt" + + func main() { + fmt.Println("Hello World") + } + pascal + program HelloWorld(output); + begin + writeln('Hello World'); + end. + perl + print "Hello World\n"; + sql + SELECT 'Hello World'; + swift + print("Hello World") + php + <?php + + echo 'Hello World'; + julia + println("Hello World") + dart + main() { + print('Hello World'); + } + + diff --git a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguages.swift b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguages.swift index d8f8272c84..4964386218 100644 --- a/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguages.swift +++ b/Stepic/Legacy/Controllers/Quizzes/CodeQuiz/CodeLanguages.swift @@ -154,54 +154,7 @@ enum CodeLanguage: String, CaseIterable { var displayName: String { self.rawValue } var highlightrSample: String { - switch self { - case .python, .python31: - return "# comment\nprint(\"Hello World\")" - case .cpp, .cpp11, .c, .cValgrind: - return "// comment\n\n#include \n\nint main()\n{\n\tstd::cout << \"Hello World!\" << std::endl;\n}" - case .haskell, .haskell7, .haskell8, .haskell88: - return "-- comment\n\nmain = putStrLn \"Hello World\"" - case .java, .java8, .java9, .java11, .java17: - return "// comment\n\nclass HelloWorld {\n\tstatic public void main(String args[]) {\n\t\tSystem.out.println(\"Hello World!\");\n\t}\n}" - case .octave: - return "# comment\nprintf(\"Hello World\\n\");" - case .asm32, .asm64: - return "; comment\n\nmov ax,cs\nmov ds,ax\nmov ah,9\nmov dx, offset Hello\nint 21h\nxor ax,ax\nint 21h\n\nHello:\n db \"Hello World!\",13,10,\"$\"" - case .shell: - return "# comment\necho Hello World" - case .rust: - return "// comment\nfn main() {\n\tprintln!(\"Hello World!\");\n}" - case .r: - return "# comment\ncat(\"Hello world\\n\")" - case .ruby: - return "# comment\nputs \"Hello World!\"" - case .clojure: - return "; comment\n\n(defn hello []\n (println \"Hello world!\"))\n\n(hello)" - case .cs, .csMono: - return "// comment\nclass HelloWorld\n{\n\tstatic void Main()\n\t{\n\t\tSystem.Console.WriteLine(\"Hello, World!\");\n\t}\n}" - case .javascript: - return "// comment\n\nconsole.log(\"Hello World\");" - case .scala, .scala3: - return "// comment\n\nobject HelloWorld extends App {\n println(\"Hello world!\")\n}" - case .kotlin: - return "// comment\n\nfun main(args: Array) {\n\tprintln(\"Hello, world!\")\n}" - case .go: - return "// comment\n\npackage main\nimport \"fmt\"\nfunc main() {\n\tfmt.Printf(\"Hello World\\n\")\n}" - case .pascal: - return "// comment\nProgram Hello_World;\n\n{$APPTYPE CONSOLE}\n\nBegin\n WriteLn('Hello World');\nEnd." - case .perl: - return "# comment\nprint \"Hello World!\\n\";" - case .sql: - return "# comment\n\nSELECT 'Hello World';" - case .swift: - return "// comment\nprint(\"Hello World!\")" - case .php: - return "// comment\n\n Date: Fri, 30 Sep 2022 17:36:39 +0300 Subject: [PATCH 17/43] bundler: bump fastlane from 2.206.2 to 2.210.1 (#1156) Bumps [fastlane](https://github.com/fastlane/fastlane) from 2.206.2 to 2.210.1. - [Release notes](https://github.com/fastlane/fastlane/releases) - [Commits](https://github.com/fastlane/fastlane/compare/fastlane/2.206.2...fastlane/2.210.1) --- updated-dependencies: - dependency-name: fastlane dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 60 ++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Gemfile b/Gemfile index 3695bf01b8..6de8bcc3b9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" ruby "2.6.5" -gem "fastlane", "2.206.2" +gem "fastlane", "2.210.1" gem "cocoapods", "1.11.3" gem "generamba", "1.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index d9851c1118..4d26682635 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,28 +9,28 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.594.0) - aws-sdk-core (3.131.1) + aws-partitions (1.636.0) + aws-sdk-core (3.154.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.57.0) + aws-sdk-kms (1.58.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.114.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.0) + aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -81,13 +81,13 @@ GEM rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) + dotenv (2.8.1) emoji_regex (3.2.3) escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) - excon (0.92.3) - faraday (1.10.0) + excon (0.92.5) + faraday (1.10.2) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -106,8 +106,8 @@ GEM faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) @@ -116,7 +116,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.206.2) + fastlane (2.210.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -168,9 +168,9 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.21.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-core (0.5.0) + google-apis-androidpublisher_v3 (0.28.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-core (0.9.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -179,27 +179,27 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.10.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-playcustomapp_v1 (0.7.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.14.0) - google-apis-core (>= 0.4, < 2.a) + google-apis-iamcredentials_v1 (0.15.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-playcustomapp_v1 (0.11.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-storage_v1 (0.17.0) + google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.2.0) - google-cloud-storage (1.36.2) + google-cloud-errors (1.3.0) + google-cloud-storage (1.42.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.17.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.1.3) + googleauth (1.2.0) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -214,7 +214,7 @@ GEM concurrent-ruby (~> 1.0) jmespath (1.6.1) json (2.6.2) - jwt (2.3.0) + jwt (2.5.0) liquid (4.0.0) memoist (0.16.2) mini_magick (4.11.0) @@ -243,9 +243,9 @@ GEM ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.16.1) + signet (0.17.0) addressable (~> 2.8) - faraday (>= 0.17.5, < 3.0) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simctl (1.6.8) @@ -269,7 +269,7 @@ GEM unf_ext (0.0.8.2) webrick (1.7.0) word_wrap (1.0.0) - xcodeproj (1.21.0) + xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -287,7 +287,7 @@ PLATFORMS DEPENDENCIES cocoapods (= 1.11.3) - fastlane (= 2.206.2) + fastlane (= 2.210.1) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) From b552273c079ce34f6d04d3bf979757f3c757a0b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 02:43:01 +0800 Subject: [PATCH 18/43] bundler: bump fastlane from 2.210.1 to 2.212.1 (#1161) * bundler: bump fastlane from 2.210.1 to 2.212.1 Bumps [fastlane](https://github.com/fastlane/fastlane) from 2.210.1 to 2.212.1. - [Release notes](https://github.com/fastlane/fastlane/releases) - [Commits](https://github.com/fastlane/fastlane/compare/fastlane/2.210.1...fastlane/2.212.1) --- updated-dependencies: - dependency-name: fastlane dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update label.yml * Update dependabot.yml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Magda --- .github/dependabot.yml | 13 ++++++++ .github/workflows/label.yml | 10 +++--- Gemfile | 2 +- Gemfile.lock | 64 ++++++++++++++++++------------------- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d51d204730..a1e75e52ad 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,3 +16,16 @@ updates: - "dependencies" rebase-strategy: "disabled" target-branch: "dev" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "ivan-magda" + commit-message: + prefix: "GitHub Actions" + labels: + - "dependencies" + - "ci/cd" + rebase-strategy: "disabled" + target-branch: "dev" \ No newline at end of file diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index c01c356959..02fc93da75 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -3,10 +3,10 @@ on: [pull_request] jobs: label: - runs-on: ubuntu-latest - + permissions: + pull-requests: write steps: - - uses: actions/labeler@v2 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + - uses: actions/labeler@4.1.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6de8bcc3b9..16f9176bbf 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" ruby "2.6.5" -gem "fastlane", "2.210.1" +gem "fastlane", "2.212.1" gem "cocoapods", "1.11.3" gem "generamba", "1.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index 4d26682635..c4f2204548 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.6) rexml activesupport (6.1.5) concurrent-ruby (~> 1.0, >= 1.0.2) @@ -17,20 +17,20 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.636.0) - aws-sdk-core (3.154.0) + aws-partitions (1.716.0) + aws-sdk-core (3.170.0) aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) + aws-sdk-kms (1.62.0) + aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.114.0) - aws-sdk-core (~> 3, >= 3.127.0) + aws-sdk-s3 (1.119.1) + aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.1) + aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -86,8 +86,8 @@ GEM escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) - excon (0.92.5) - faraday (1.10.2) + excon (0.99.0) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -116,7 +116,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.210.1) + fastlane (2.212.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -168,9 +168,9 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.28.0) - google-apis-core (>= 0.9.0, < 2.a) - google-apis-core (0.9.0) + google-apis-androidpublisher_v3 (0.34.0) + google-apis-core (>= 0.9.1, < 2.a) + google-apis-core (0.11.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -179,27 +179,27 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.15.0) - google-apis-core (>= 0.9.0, < 2.a) - google-apis-playcustomapp_v1 (0.11.0) + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.12.0) + google-apis-core (>= 0.9.1, < 2.a) + google-apis-storage_v1 (0.19.0) google-apis-core (>= 0.9.0, < 2.a) - google-apis-storage_v1 (0.17.0) - google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.0) - google-cloud-storage (1.42.0) + google-cloud-storage (1.44.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.17.0) + google-apis-storage_v1 (~> 0.19.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.2.0) + googleauth (1.3.0) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -212,12 +212,12 @@ GEM httpclient (2.8.3) i18n (1.10.0) concurrent-ruby (~> 1.0) - jmespath (1.6.1) - json (2.6.2) - jwt (2.5.0) + jmespath (1.6.2) + json (2.6.3) + jwt (2.7.0) liquid (4.0.0) memoist (0.16.2) - mini_magick (4.11.0) + mini_magick (4.12.0) mini_mime (1.1.2) minitest (5.15.0) molinillo (0.8.0) @@ -229,7 +229,7 @@ GEM netrc (0.11.0) optparse (0.1.1) os (1.1.4) - plist (3.6.0) + plist (3.7.0) public_suffix (4.0.7) rake (13.0.6) representable (3.2.0) @@ -248,7 +248,7 @@ GEM faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simctl (1.6.8) + simctl (1.6.10) CFPropertyList naturally terminal-notifier (2.0.0) @@ -267,7 +267,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - webrick (1.7.0) + webrick (1.8.1) word_wrap (1.0.0) xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) @@ -287,7 +287,7 @@ PLATFORMS DEPENDENCIES cocoapods (= 1.11.3) - fastlane (= 2.210.1) + fastlane (= 2.212.1) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) From cdb260a4386431bd3bd35e04798aeb0d3af81148 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 02:46:55 +0800 Subject: [PATCH 19/43] Bump activesupport from 6.1.5 to 6.1.7.2 (#1159) Bumps [activesupport](https://github.com/rails/rails) from 6.1.5 to 6.1.7.2. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.4.2/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v6.1.5...v6.1.7.2) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c4f2204548..94d2de9413 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (6.1.5) + activesupport (6.1.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -75,7 +75,7 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.0) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -210,7 +210,7 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.10.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.6.3) @@ -219,7 +219,7 @@ GEM memoist (0.16.2) mini_magick (4.12.0) mini_mime (1.1.2) - minitest (5.15.0) + minitest (5.17.0) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.0.0) @@ -261,7 +261,7 @@ GEM tty-cursor (~> 0.7) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unf (0.1.4) @@ -280,7 +280,7 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.5.4) + zeitwerk (2.6.6) PLATFORMS ruby From 36a3d55adcbf515e606e036d55f72e18a7c3ee20 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 03:06:13 +0800 Subject: [PATCH 20/43] Bump Ruby from 2.6.5 to 3.2.1 --- .ruby-version | 1 + Gemfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..e4604e3afd --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.1 diff --git a/Gemfile b/Gemfile index 16f9176bbf..37c6e0f8e4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby "2.6.5" +ruby "3.2.1" gem "fastlane", "2.212.1" gem "cocoapods", "1.11.3" From 9d066f7c40c62152a894e2e4715e623daf199d76 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 03:06:39 +0800 Subject: [PATCH 21/43] Run bundle update --- Gemfile.lock | 12 ++++++------ fastlane/Fastfile | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94d2de9413..1b78a47cc9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,7 +75,7 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -84,7 +84,7 @@ GEM dotenv (2.8.1) emoji_regex (3.2.3) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) excon (0.99.0) faraday (1.10.3) @@ -155,7 +155,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.3.4) + fastlane-plugin-firebase_app_distribution (0.5.0) ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -280,7 +280,7 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby @@ -292,7 +292,7 @@ DEPENDENCIES generamba (= 1.5.0) RUBY VERSION - ruby 2.6.5p114 + ruby 3.2.1p31 BUNDLED WITH - 2.1.4 + 2.4.7 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index cf990bf0b7..7d098ded1e 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,4 +1,4 @@ -fastlane_version "2.200.0" +fastlane_version "2.212.1" default_platform :ios From 34ac70330b1782b64f6104f96d227310d184584e Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 04:41:21 +0800 Subject: [PATCH 22/43] Bump Charts from 3.6.0 to 4.1.0 --- Podfile | 142 +++++++++++++++---------------- Podfile.lock | 18 ++-- Stepic.xcodeproj/project.pbxproj | 4 + 3 files changed, 86 insertions(+), 78 deletions(-) diff --git a/Podfile b/Podfile index c720d5fa51..a2eaa7179b 100644 --- a/Podfile +++ b/Podfile @@ -1,100 +1,100 @@ -install! 'cocoapods', :deterministic_uuids => false -source 'https://github.com/CocoaPods/Specs.git' +install! "cocoapods", :deterministic_uuids => false +source "https://github.com/CocoaPods/Specs.git" inhibit_all_warnings! use_frameworks! -project 'Stepic', - 'Production Debug' => :debug, - 'Production Release' => :release, - 'Release Debug' => :debug, - 'Release Release' => :release, - 'Develop Debug' => :debug, - 'Develop Release' => :release +project "Stepic", + "Production Debug" => :debug, + "Production Release" => :release, + "Release Debug" => :debug, + "Release Release" => :release, + "Develop Debug" => :debug, + "Develop Release" => :release def shared_pods - pod 'StepikModel', path: './StepikModel' - - pod 'Alamofire', '5.4.4' - pod 'Atributika', '4.10.1' - pod 'SwiftyJSON', '5.0.0' - pod 'SDWebImage', '5.12.1' - pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x' - pod 'DeviceKit', '4.5.2' - pod 'PromiseKit', :git => 'https://github.com/mxcl/PromiseKit.git', :tag => '6.16.2' - pod 'SwiftLint', '0.45.1' - - if ENV['FASTLANE_BETA_PROFILE'] == 'true' - pod 'FLEX', - :git => 'https://github.com/ivan-magda/FLEX.git', - :branch => 'master' + pod "StepikModel", path: "./StepikModel" + + pod "Alamofire", "5.4.4" + pod "Atributika", "4.10.1" + pod "SwiftyJSON", "5.0.0" + pod "SDWebImage", "5.12.1" + pod "SVGKit", :git => "https://github.com/SVGKit/SVGKit.git", :branch => "2.x" + pod "DeviceKit", "4.5.2" + pod "PromiseKit", :git => "https://github.com/mxcl/PromiseKit.git", :tag => "6.16.2" + pod "SwiftLint", "0.45.1" + + if ENV["FASTLANE_BETA_PROFILE"] == "true" + pod "FLEX", + :git => "https://github.com/ivan-magda/FLEX.git", + :branch => "master" else - pod 'FLEX', - :git => 'https://github.com/ivan-magda/FLEX.git', - :branch => 'master', - :configurations => ['Production Debug', 'Release Debug', 'Develop Debug'] + pod "FLEX", + :git => "https://github.com/ivan-magda/FLEX.git", + :branch => "master", + :configurations => ["Production Debug", "Release Debug", "Develop Debug"] end end def all_pods shared_pods - pod 'DownloadButton', '0.1.0' - pod 'SVProgressHUD', '2.2.5' + pod "DownloadButton", "0.1.0" + pod "SVProgressHUD", "2.2.5" - pod 'SnapKit', '5.0.1' + pod "SnapKit", "5.0.1" # Firebase - pod 'Firebase/Core', '8.9.1' - pod 'Firebase/Messaging', '8.9.1' - pod 'Firebase/Analytics', '8.9.1' - pod 'Firebase/Crashlytics', '8.9.1' - pod 'Firebase/RemoteConfig', '8.9.1' + pod "Firebase/Core", "8.9.1" + pod "Firebase/Messaging", "8.9.1" + pod "Firebase/Analytics", "8.9.1" + pod "Firebase/Crashlytics", "8.9.1" + pod "Firebase/RemoteConfig", "8.9.1" - pod 'YandexMobileMetrica/Dynamic', '3.17.0' - pod 'Amplitude', '8.5.0' - pod 'Branch', '1.40.2' + pod "YandexMobileMetrica/Dynamic", "3.17.0" + pod "Amplitude", "8.5.0" + pod "Branch", "1.40.2" - pod 'BEMCheckBox', '1.4.1' + pod "BEMCheckBox", "1.4.1" - pod 'IQKeyboardManagerSwift', '6.5.6' + pod "IQKeyboardManagerSwift", "6.5.6" - pod 'Kanna', '5.2.7' - pod 'TUSafariActivity', '1.0.4' + pod "Kanna", "5.2.7" + pod "TUSafariActivity", "1.0.4" # Social SDKs - pod 'VK-ios-sdk', '1.6.2' -# pod 'FBSDKCoreKit', '8.2.0' -# pod 'FBSDKLoginKit', '8.2.0' - pod 'GoogleSignIn', '6.1.0' - - pod 'Presentr', :git => 'https://github.com/ivan-magda/Presentr.git', :tag => 'v1.9.1' - pod 'PanModal', :git => 'https://github.com/ivan-magda/PanModal.git', :branch => 'remove-presenting-appearance-transitions' - - pod 'Agrume', '5.6.13' - pod 'Highlightr', :git => 'https://github.com/ivan-magda/Highlightr.git', :tag => 'v2.1.3' - pod 'TTTAttributedLabel', '2.0.0' - pod 'lottie-ios', '3.2.3' - pod 'Koloda', '5.0.1' - pod 'Charts', '3.6.0' - pod 'EasyTipView', '2.1.0' - pod 'ActionSheetPicker-3.0', '2.7.1' - pod 'Nuke', '9.5.0' - pod 'STRegex', '2.1.1' - pod 'Tabman', '2.10.0' - pod 'SwiftDate', '6.3.1' + pod "VK-ios-sdk", "1.6.2" + # pod "FBSDKCoreKit", "8.2.0" + # pod "FBSDKLoginKit", "8.2.0" + pod "GoogleSignIn", "6.1.0" + + pod "Presentr", :git => "https://github.com/ivan-magda/Presentr.git", :tag => "v1.9.1" + pod "PanModal", :git => "https://github.com/ivan-magda/PanModal.git", :branch => "remove-presenting-appearance-transitions" + + pod "Agrume", "5.6.13" + pod "Highlightr", :git => "https://github.com/ivan-magda/Highlightr.git", :tag => "v2.1.3" + pod "TTTAttributedLabel", "2.0.0" + pod "lottie-ios", "3.2.3" + pod "Koloda", "5.0.1" + pod "Charts", "4.1.0" + pod "EasyTipView", "2.1.0" + pod "ActionSheetPicker-3.0", "2.7.1" + pod "Nuke", "9.5.0" + pod "STRegex", "2.1.1" + pod "Tabman", "2.10.0" + pod "SwiftDate", "6.3.1" end def testing_pods - pod 'Quick', '4.0.0' - pod 'Nimble', '9.2.1' - pod 'Mockingjay', :git => 'https://github.com/kylef/Mockingjay.git', :branch => 'master' + pod "Quick", "4.0.0" + pod "Nimble", "9.2.1" + pod "Mockingjay", :git => "https://github.com/kylef/Mockingjay.git", :branch => "master" end -target 'Stepic' do - platform :ios, '12.0' +target "Stepic" do + platform :ios, "12.0" all_pods - target 'StepicTests' do + target "StepicTests" do inherit! :search_paths all_pods testing_pods @@ -104,8 +104,8 @@ end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0 - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' + if config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"].to_f < 9.0 + config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "9.0" end end end diff --git a/Podfile.lock b/Podfile.lock index 0b511ff3cf..378f3d8968 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -12,9 +12,10 @@ PODS: - Atributika (4.10.1) - BEMCheckBox (1.4.1) - Branch (1.40.2) - - Charts (3.6.0): - - Charts/Core (= 3.6.0) - - Charts/Core (3.6.0) + - Charts (4.1.0): + - Charts/Core (= 4.1.0) + - Charts/Core (4.1.0): + - SwiftAlgorithms (~> 1.0) - CocoaLumberjack (3.7.2): - CocoaLumberjack/Core (= 3.7.2) - CocoaLumberjack/Core (3.7.2) @@ -189,6 +190,7 @@ PODS: - SVGKit (2.1.0): - CocoaLumberjack (~> 3.0) - SVProgressHUD (2.2.5) + - SwiftAlgorithms (1.0.0) - SwiftDate (6.3.1) - SwiftLint (0.45.1) - SwiftyGif (5.4.0) @@ -214,7 +216,7 @@ DEPENDENCIES: - Atributika (= 4.10.1) - BEMCheckBox (= 1.4.1) - Branch (= 1.40.2) - - Charts (= 3.6.0) + - Charts (= 4.1.0) - DeviceKit (= 4.5.2) - DownloadButton (= 0.1.0) - EasyTipView (= 2.1.0) @@ -297,6 +299,7 @@ SPEC REPOS: - SnapKit - STRegex - SVProgressHUD + - SwiftAlgorithms - SwiftDate - SwiftLint - SwiftyGif @@ -364,8 +367,8 @@ SPEC CHECKSUMS: AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7 Atributika: 47e778507cfb3cd2c996278b0285221a62e97d71 BEMCheckBox: 5ba6e37ade3d3657b36caecc35c8b75c6c2b1a4e - Branch: c1b244bf1170b0ea5c5eefa897648de8d14ff0d2 - Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af + Branch: d99436c6f3d5b2529ba948d273e47e732830f207 + Charts: 354f86803d11d9c35de280587fef50d1af063978 CocoaLumberjack: b7e05132ff94f6ae4dfa9d5bce9141893a21d9da DeviceKit: c622fc19f795f3e0b4d75d6d11b26604338cdab3 DownloadButton: 49a21a89e0d7d1b42d9134f79aaa40e727cd57c3 @@ -408,6 +411,7 @@ SPEC CHECKSUMS: STRegex: d49e88d0fe58538d3175fdd989bc1243b9be2a07 SVGKit: 8a2fc74258bdb2abb54d3b65f3dd68b0277a9c4d SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 + SwiftAlgorithms: 38dda4731d19027fdeee1125f973111bf3386b53 SwiftDate: 72d28954e8e1c6c1c0f917ccc8005e4f83c7d4b2 SwiftLint: 06ac37e4d38c7068e0935bb30cda95f093bec761 SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7 @@ -419,6 +423,6 @@ SPEC CHECKSUMS: VK-ios-sdk: 5bcf00a2014a7323f98db9328b603d4f96635caa YandexMobileMetrica: 9e713c16bb6aca0ba63b84c8d7b8b86d32f4ecc4 -PODFILE CHECKSUM: e65961cf42aa90c48b6c5358358f1b9e4abc8fd3 +PODFILE CHECKSUM: 2bb5dc24ec01e6805f170e0bb2fbfb3164c01595 COCOAPODS: 1.11.3 diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index e320fbe29f..ce7e49c2d0 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -11013,6 +11013,7 @@ "${BUILT_PRODUCTS_DIR}/SVProgressHUD/SVProgressHUD.framework", "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", "${BUILT_PRODUCTS_DIR}/StepikModel/StepikModel.framework", + "${BUILT_PRODUCTS_DIR}/SwiftAlgorithms/Algorithms.framework", "${BUILT_PRODUCTS_DIR}/SwiftDate/SwiftDate.framework", "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework", @@ -11074,6 +11075,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SVProgressHUD.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StepikModel.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Algorithms.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftDate.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework", @@ -11145,6 +11147,7 @@ "${BUILT_PRODUCTS_DIR}/SVProgressHUD/SVProgressHUD.framework", "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", "${BUILT_PRODUCTS_DIR}/StepikModel/StepikModel.framework", + "${BUILT_PRODUCTS_DIR}/SwiftAlgorithms/Algorithms.framework", "${BUILT_PRODUCTS_DIR}/SwiftDate/SwiftDate.framework", "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework", @@ -11202,6 +11205,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SVProgressHUD.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StepikModel.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Algorithms.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftDate.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework", From 3ac968e9f4974efc55d63d3331823290bf97a634 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 04:45:34 +0800 Subject: [PATCH 23/43] Fix build --- Stepic.xcodeproj/project.pbxproj | 4 + Stepic/Legacy/AppDelegate.swift | 24 ++---- .../AdaptiveStatsViewController.swift | 4 +- .../Legacy/Model/StepikSession/AuthInfo.swift | 7 +- .../CatalogBlockContentValueTransformer.swift | 1 - .../DatasetValueTransformer.swift | 1 - .../Transformers/ReplyValueTransformer.swift | 1 - .../SubmissionFeedbackValueTransformer.swift | 1 - .../TransitionRouters/LastStepRouter.swift | 10 +-- .../BaseExploreViewController.swift | 11 +-- .../ContinueCourseInteractor.swift | 17 ++--- .../ContinueCourse/ContinueCourseView.swift | 1 - .../ContinueCourseViewController.swift | 21 ++--- .../Sources/Modules/Step/StepInteractor.swift | 14 ++-- ...ShortcutsContinueUserActivityService.swift | 2 - .../SiriShortcuts/SiriShortcutsService.swift | 2 - .../SiriShortcutsStorageManager.swift | 3 - .../Services/Widget/WidgetService.swift | 76 +++++++++++++++++++ .../ContinueLastStepView.swift | 23 ++---- 19 files changed, 127 insertions(+), 96 deletions(-) create mode 100644 Stepic/Sources/Services/Widget/WidgetService.swift diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index ce7e49c2d0..8cd66e7bd1 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -687,6 +687,7 @@ 2C5F77C11F90F63B00E8E175 /* Notification+FetchMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5F77C01F90F63B00E8E175 /* Notification+FetchMethods.swift */; }; 2C5F77C41F90FC2500E8E175 /* NotificationsMarkAsReadButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5F77C31F90FC2500E8E175 /* NotificationsMarkAsReadButton.swift */; }; 2C5FF4A927A852D600A68CA1 /* CourseWidgetProgressBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5FF4A827A852D600A68CA1 /* CourseWidgetProgressBarView.swift */; }; + 2C6036C029A94D330069FD81 /* WidgetService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C6036BF29A94D330069FD81 /* WidgetService.swift */; }; 2C604E1F207E45A1001588FB /* CodeEditorPreviewView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C604E1E207E45A1001588FB /* CodeEditorPreviewView.xib */; }; 2C604E21207E4609001588FB /* CodeEditorPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C604E20207E4609001588FB /* CodeEditorPreviewView.swift */; }; 2C60CCEE26CE81F30015C6A8 /* QuizReviewControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C60CCED26CE81F30015C6A8 /* QuizReviewControlsView.swift */; }; @@ -2761,6 +2762,7 @@ 2C5F77C01F90F63B00E8E175 /* Notification+FetchMethods.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Notification+FetchMethods.swift"; sourceTree = ""; }; 2C5F77C31F90FC2500E8E175 /* NotificationsMarkAsReadButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsMarkAsReadButton.swift; sourceTree = ""; }; 2C5FF4A827A852D600A68CA1 /* CourseWidgetProgressBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseWidgetProgressBarView.swift; sourceTree = ""; }; + 2C6036BF29A94D330069FD81 /* WidgetService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetService.swift; sourceTree = ""; }; 2C604E1E207E45A1001588FB /* CodeEditorPreviewView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CodeEditorPreviewView.xib; sourceTree = ""; }; 2C604E20207E4609001588FB /* CodeEditorPreviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeEditorPreviewView.swift; sourceTree = ""; }; 2C60CCED26CE81F30015C6A8 /* QuizReviewControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizReviewControlsView.swift; sourceTree = ""; }; @@ -5279,6 +5281,7 @@ isa = PBXGroup; children = ( 2C3A053E25B7693B0007FBCA /* WidgetRoutingService.swift */, + 2C6036BF29A94D330069FD81 /* WidgetService.swift */, 2C51E1CD25B88B5600E38DF8 /* WidgetUserDefaults.swift */, 2C7AC4CC25B457300024D4D2 /* Content */, 2C8FA6C125B60096006BF4B6 /* Token */, @@ -11613,6 +11616,7 @@ 2CCB4B1A26E77CED0056C44E /* AnnouncementsAPI.swift in Sources */, 08C1FC331F41E74500E14B46 /* QuizPresenter.swift in Sources */, 2C604E21207E4609001588FB /* CodeEditorPreviewView.swift in Sources */, + 2C6036C029A94D330069FD81 /* WidgetService.swift in Sources */, 2C6917D525EE489900BAE0F5 /* ExplorePlaceholderView.swift in Sources */, 2CFED65F252C5AC900FCAD41 /* Result+Stepik.swift in Sources */, 2CE42D4423CCC4530073F774 /* StreamVideoQualityStorageManager.swift in Sources */, diff --git a/Stepic/Legacy/AppDelegate.swift b/Stepic/Legacy/AppDelegate.swift index 0c1199c3bd..a8115d51d2 100644 --- a/Stepic/Legacy/AppDelegate.swift +++ b/Stepic/Legacy/AppDelegate.swift @@ -36,15 +36,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { private lazy var analyticsStorageManager: AnalyticsStorageManagerProtocol = AnalyticsStorageManager.default private lazy var analytics: Analytics = StepikAnalytics.shared - @available(iOS 12.0, *) private lazy var siriShortcutsContinueUserActivityService: SiriShortcutsContinueUserActivityServiceProtocol = SiriShortcutsContinueUserActivityService() - @available(iOS 14.0, *) - private lazy var widgetContentIndexingService: WidgetContentIndexingServiceProtocol = WidgetContentIndexingService.default - @available(iOS 14.0, *) - private lazy var widgetRoutingService: WidgetRoutingServiceProtocol = WidgetRoutingService.default - @available(iOS 14.0, *) - private lazy var widgetUserDefaults: WidgetUserDefaultsProtocol = WidgetUserDefaults.default + private lazy var widgetService = WidgetService() private var applicationDidBecomeActiveAfterLaunch = true @@ -164,12 +158,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { IAPService.shared.prefetchProducts() if #available(iOS 14.0, *) { - self.widgetContentIndexingService.startIndexing(force: self.applicationDidBecomeActiveAfterLaunch) + self.widgetService.startIndexingContent(force: self.applicationDidBecomeActiveAfterLaunch) let widgetAddedEvent = AmplitudeAnalyticsEvent.homeScreenWidgetAdded( - size: self.widgetUserDefaults.lastWidgetSize + size: self.widgetService.getLastWidgetSize() ) - if self.widgetUserDefaults.isWidgetAdded && !self.analyticsStorageManager.didSend(widgetAddedEvent) { + if self.widgetService.getIsWidgetAdded() && !self.analyticsStorageManager.didSend(widgetAddedEvent) { self.analytics.send(widgetAddedEvent) self.analyticsStorageManager.send(widgetAddedEvent) } @@ -184,7 +178,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { self.visitedCoursesCleaner.removeObservers() if #available(iOS 14.0, *) { - self.widgetContentIndexingService.stopIndexing() + self.widgetService.stopIndexingContent() } } @@ -272,8 +266,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } - if #available(iOS 12.0, *), - self.siriShortcutsContinueUserActivityService.continueUserActivity(userActivity) { + if self.siriShortcutsContinueUserActivityService.continueUserActivity(userActivity) { return true } if self.spotlightContinueUserActivityService.continueUserActivity(userActivity) { @@ -333,9 +326,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } else { if self.branchService.canOpenWithBranch(url: url) { self.branchService.openURL(app: app, open: url, options: options) - } else if #available(iOS 14.0, *), - self.widgetRoutingService.canOpen(url: url) { - self.widgetRoutingService.open(url: url) + } else if #available(iOS 14.0, *), self.widgetService.canOpenRouteURL(url) { + self.widgetService.openRouteURL(url) } else { // Other actions self.handleOpenedFromDeepLink(url) diff --git a/Stepic/Legacy/Controllers/AdaptiveSteps/Stats/AdaptiveStats/AdaptiveStatsViewController.swift b/Stepic/Legacy/Controllers/AdaptiveSteps/Stats/AdaptiveStats/AdaptiveStatsViewController.swift index a383ce6051..f3b43f0cf9 100644 --- a/Stepic/Legacy/Controllers/AdaptiveSteps/Stats/AdaptiveStats/AdaptiveStatsViewController.swift +++ b/Stepic/Legacy/Controllers/AdaptiveSteps/Stats/AdaptiveStats/AdaptiveStatsViewController.swift @@ -184,7 +184,7 @@ final class AdaptiveStatsViewController: UIViewController { } private func setUpChart() { - self.progressChart.chartDescription?.enabled = false + self.progressChart.chartDescription.enabled = false self.progressChart.isUserInteractionEnabled = false self.progressChart.setScaleEnabled(false) self.progressChart.pinchZoomEnabled = false @@ -236,7 +236,7 @@ extension AdaptiveStatsViewController: AdaptiveStatsView { let data = LineChartData(dataSet: dataSet) self.progressChart.data = data - self.progressChart.data?.highlightEnabled = true + self.progressChart.data?.isHighlightEnabled = true self.progressChart.animate(yAxisDuration: 1.4, easingOption: .easeInOutCirc) } } diff --git a/Stepic/Legacy/Model/StepikSession/AuthInfo.swift b/Stepic/Legacy/Model/StepikSession/AuthInfo.swift index 7e98e18b94..f0790e9433 100644 --- a/Stepic/Legacy/Model/StepikSession/AuthInfo.swift +++ b/Stepic/Legacy/Model/StepikSession/AuthInfo.swift @@ -23,8 +23,7 @@ final class AuthInfo: NSObject { private lazy var logoutDataClearService: LogoutDataClearServiceProtocol = LogoutDataClearService() - @available(iOS 14.0, *) - private lazy var widgetTokenFileManager: StepikWidgetTokenFileManagerProtocol = StepikWidgetTokenFileManager.default + private lazy var widgetService = WidgetService() override private init() { super.init() @@ -42,7 +41,7 @@ final class AuthInfo: NSObject { } if #available(iOS 14.0, *) { - try? self.widgetTokenFileManager.write(token: StepikWidgetToken(accessToken: self.token?.accessToken)) + try? self.widgetService.writeToken(StepikWidgetToken(accessToken: self.token?.accessToken)) } } @@ -55,7 +54,7 @@ final class AuthInfo: NSObject { self.defaults.synchronize() if #available(iOS 14.0, *) { - try? self.widgetTokenFileManager.write(token: StepikWidgetToken(accessToken: newToken?.accessToken)) + try? self.widgetService.writeToken(StepikWidgetToken(accessToken: newToken?.accessToken)) } } diff --git a/Stepic/Legacy/Model/Transformers/CatalogBlockContentValueTransformer.swift b/Stepic/Legacy/Model/Transformers/CatalogBlockContentValueTransformer.swift index 5b45d9eb2b..6625c85ed7 100644 --- a/Stepic/Legacy/Model/Transformers/CatalogBlockContentValueTransformer.swift +++ b/Stepic/Legacy/Model/Transformers/CatalogBlockContentValueTransformer.swift @@ -1,6 +1,5 @@ import Foundation -@available(iOS 12.0, *) @objc(CatalogBlockContentValueTransformer) final class CatalogBlockContentValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: CatalogBlockContentValueTransformer.self)) diff --git a/Stepic/Legacy/Model/Transformers/DatasetValueTransformer.swift b/Stepic/Legacy/Model/Transformers/DatasetValueTransformer.swift index 84db30d150..0bf259c4c0 100644 --- a/Stepic/Legacy/Model/Transformers/DatasetValueTransformer.swift +++ b/Stepic/Legacy/Model/Transformers/DatasetValueTransformer.swift @@ -1,6 +1,5 @@ import Foundation -@available(iOS 12.0, *) @objc(DatasetValueTransformer) final class DatasetValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: DatasetValueTransformer.self)) diff --git a/Stepic/Legacy/Model/Transformers/ReplyValueTransformer.swift b/Stepic/Legacy/Model/Transformers/ReplyValueTransformer.swift index 8b9c13a172..21ca25e59b 100644 --- a/Stepic/Legacy/Model/Transformers/ReplyValueTransformer.swift +++ b/Stepic/Legacy/Model/Transformers/ReplyValueTransformer.swift @@ -1,6 +1,5 @@ import Foundation -@available(iOS 12.0, *) @objc(ReplyValueTransformer) final class ReplyValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: ReplyValueTransformer.self)) diff --git a/Stepic/Legacy/Model/Transformers/SubmissionFeedbackValueTransformer.swift b/Stepic/Legacy/Model/Transformers/SubmissionFeedbackValueTransformer.swift index 25b875a8b6..7687ba3d1b 100644 --- a/Stepic/Legacy/Model/Transformers/SubmissionFeedbackValueTransformer.swift +++ b/Stepic/Legacy/Model/Transformers/SubmissionFeedbackValueTransformer.swift @@ -1,6 +1,5 @@ import Foundation -@available(iOS 12.0, *) @objc(SubmissionFeedbackValueTransformer) final class SubmissionFeedbackValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: SubmissionFeedbackValueTransformer.self)) diff --git a/Stepic/Legacy/TransitionRouters/LastStepRouter.swift b/Stepic/Legacy/TransitionRouters/LastStepRouter.swift index 87f7f39327..755da8d7a7 100644 --- a/Stepic/Legacy/TransitionRouters/LastStepRouter.swift +++ b/Stepic/Legacy/TransitionRouters/LastStepRouter.swift @@ -368,12 +368,10 @@ final class LastStepRouter { } private static func donateContinueLearningInteraction(for viewController: UIViewController) { - if #available(iOS 12.0, *) { - let siriShortcutsService: SiriShortcutsServiceProtocol = SiriShortcutsService() + let siriShortcutsService: SiriShortcutsServiceProtocol = SiriShortcutsService() - let userActivity = siriShortcutsService.getContinueLearningShortcut() - viewController.userActivity = userActivity - userActivity.becomeCurrent() - } + let userActivity = siriShortcutsService.getContinueLearningShortcut() + viewController.userActivity = userActivity + userActivity.becomeCurrent() } } diff --git a/Stepic/Sources/Modules/BaseExplore/BaseExploreViewController.swift b/Stepic/Sources/Modules/BaseExplore/BaseExploreViewController.swift index 6bb067cf51..0bf599bffb 100644 --- a/Stepic/Sources/Modules/BaseExplore/BaseExploreViewController.swift +++ b/Stepic/Sources/Modules/BaseExplore/BaseExploreViewController.swift @@ -166,17 +166,14 @@ extension BaseExploreViewController: BaseExploreViewControllerProtocol { return } - let shouldDonateInteraction: Bool - if #available(iOS 12.0, *) { + let shouldDonateInteraction: Bool = { switch (viewModel.courseContinueSource, viewModel.courseViewSource) { case (.homeWidget, .fastContinue): - shouldDonateInteraction = true + return true default: - shouldDonateInteraction = false + return false } - } else { - shouldDonateInteraction = false - } + }() LastStepRouter.continueLearning( for: viewModel.course, diff --git a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseInteractor.swift b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseInteractor.swift index 29af0e86df..154144b0d9 100644 --- a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseInteractor.swift +++ b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseInteractor.swift @@ -21,9 +21,7 @@ final class ContinueCourseInteractor: ContinueCourseInteractorProtocol { private let tooltipStorageManager: TooltipStorageManagerProtocol private let dataBackUpdateService: DataBackUpdateServiceProtocol - @available(iOS 12.0, *) private lazy var siriShortcutsService: SiriShortcutsServiceProtocol = SiriShortcutsService() - @available(iOS 12.0, *) private lazy var siriShortcutsStorageManager: SiriShortcutsStorageManagerProtocol = SiriShortcutsStorageManager() private var currentCourse: Course? @@ -73,12 +71,10 @@ final class ContinueCourseInteractor: ContinueCourseInteractorProtocol { viewSource: .fastContinue ) - if #available(iOS 12.0, *) { - self.siriShortcutsStorageManager.didClickFastContinueOnHomeWidget = true + self.siriShortcutsStorageManager.didClickFastContinueOnHomeWidget = true - DispatchQueue.main.asyncAfter(deadline: .now() + Self.siriButtonAvailabilityCheckDelay) { - self.doSiriButtonAvailabilityCheck(request: .init()) - } + DispatchQueue.main.asyncAfter(deadline: .now() + Self.siriButtonAvailabilityCheckDelay) { + self.doSiriButtonAvailabilityCheck(request: .init()) } } @@ -92,8 +88,7 @@ final class ContinueCourseInteractor: ContinueCourseInteractorProtocol { } func doSiriButtonAvailabilityCheck(request: ContinueCourse.SiriButtonAvailabilityCheck.Request) { - if #available(iOS 12.0, *), - self.siriShortcutsStorageManager.shouldShowSiriButtonOnHomeWidget { + if self.siriShortcutsStorageManager.shouldShowSiriButtonOnHomeWidget { let userActivity = self.siriShortcutsService.getContinueLearningShortcut() self.presenter.presentSiriButton(response: .init(shouldShowButton: true, userActivity: userActivity)) } else { @@ -102,9 +97,7 @@ final class ContinueCourseInteractor: ContinueCourseInteractorProtocol { } func doSiriButtonAction(request: ContinueCourse.SiriButtonAction.Request) { - if #available(iOS 12.0, *) { - self.siriShortcutsStorageManager.didClickAddToSiriOnHomeWidget = true - } + self.siriShortcutsStorageManager.didClickAddToSiriOnHomeWidget = true } } diff --git a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseView.swift b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseView.swift index 73f9d646d8..4a2be4c4c5 100644 --- a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseView.swift +++ b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseView.swift @@ -37,7 +37,6 @@ final class ContinueCourseView: UIView { self.lastStepView.coverImageURL = viewModel.coverImageURL } - @available(iOS 12.0, *) func configureSiriButton(contentConfiguration: SiriButtonContentConfiguration?) { self.lastStepView.configureSiriButton(contentConfiguration: contentConfiguration) } diff --git a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseViewController.swift b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseViewController.swift index 3c41085665..33708c6744 100644 --- a/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseViewController.swift +++ b/Stepic/Sources/Modules/ExploreSubmodules/ContinueCourse/ContinueCourseViewController.swift @@ -92,16 +92,14 @@ extension ContinueCourseViewController: ContinueCourseViewControllerProtocol { } func displaySiriButton(viewModel: ContinueCourse.SiriButtonAvailabilityCheck.ViewModel) { - if #available(iOS 12.0, *) { - if viewModel.shouldShowButton, let userActivity = viewModel.userActivity { - let contentConfiguration = SiriButtonContentConfiguration( - shortcut: INShortcut(userActivity: userActivity), - delegate: self - ) - self.continueCourseView?.configureSiriButton(contentConfiguration: contentConfiguration) - } else { - self.continueCourseView?.configureSiriButton(contentConfiguration: nil) - } + if viewModel.shouldShowButton, let userActivity = viewModel.userActivity { + let contentConfiguration = SiriButtonContentConfiguration( + shortcut: INShortcut(userActivity: userActivity), + delegate: self + ) + self.continueCourseView?.configureSiriButton(contentConfiguration: contentConfiguration) + } else { + self.continueCourseView?.configureSiriButton(contentConfiguration: nil) } } } @@ -120,7 +118,6 @@ extension ContinueCourseViewController: ContinueCourseViewDelegate { // MARK: - ContinueCourseViewController: UIViewController, INUIAddVoiceShortcutButtonDelegate - -@available(iOS 12.0, *) extension ContinueCourseViewController: INUIAddVoiceShortcutButtonDelegate { func present( _ addVoiceShortcutViewController: INUIAddVoiceShortcutViewController, @@ -141,7 +138,6 @@ extension ContinueCourseViewController: INUIAddVoiceShortcutButtonDelegate { // MARK: - ContinueCourseViewController: INUIAddVoiceShortcutViewControllerDelegate - -@available(iOS 12.0, *) extension ContinueCourseViewController: INUIAddVoiceShortcutViewControllerDelegate { func addVoiceShortcutViewController( _ controller: INUIAddVoiceShortcutViewController, @@ -159,7 +155,6 @@ extension ContinueCourseViewController: INUIAddVoiceShortcutViewControllerDelega // MARK: - ContinueCourseViewController: INUIEditVoiceShortcutViewControllerDelegate - -@available(iOS 12.0, *) extension ContinueCourseViewController: INUIEditVoiceShortcutViewControllerDelegate { func editVoiceShortcutViewController( _ controller: INUIEditVoiceShortcutViewController, diff --git a/Stepic/Sources/Modules/Step/StepInteractor.swift b/Stepic/Sources/Modules/Step/StepInteractor.swift index d7e5d4e2b5..cb0713fd11 100644 --- a/Stepic/Sources/Modules/Step/StepInteractor.swift +++ b/Stepic/Sources/Modules/Step/StepInteractor.swift @@ -147,16 +147,12 @@ final class StepInteractor: StepInteractorProtocol { } func doARQuickLookPresentation(request: StepDataFlow.ARQuickLookPresentation.Request) { - if #available(iOS 12.0, *) { - self.provider.fetchStoredARQuickLookFile(remoteURL: request.remoteURL).done { storedFile in - if let storedFile = storedFile { - self.presenter.presentARQuickLook(response: .init(result: .success(storedFile.localURL))) - } else { - self.presenter.presentDownloadARQuickLook(response: .init(url: request.remoteURL)) - } + self.provider.fetchStoredARQuickLookFile(remoteURL: request.remoteURL).done { storedFile in + if let storedFile = storedFile { + self.presenter.presentARQuickLook(response: .init(result: .success(storedFile.localURL))) + } else { + self.presenter.presentDownloadARQuickLook(response: .init(url: request.remoteURL)) } - } else { - self.presenter.presentARQuickLook(response: .init(result: .failure(Error.arQuickLookUnsupported))) } } diff --git a/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsContinueUserActivityService.swift b/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsContinueUserActivityService.swift index 55580bd163..a294bc3bed 100644 --- a/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsContinueUserActivityService.swift +++ b/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsContinueUserActivityService.swift @@ -2,12 +2,10 @@ import Foundation import PromiseKit import SVProgressHUD -@available(iOS 12.0, *) protocol SiriShortcutsContinueUserActivityServiceProtocol: AnyObject { func continueUserActivity(_ userActivity: NSUserActivity) -> Bool } -@available(iOS 12.0, *) final class SiriShortcutsContinueUserActivityService: SiriShortcutsContinueUserActivityServiceProtocol { private let lastCourseDataShortcutService: LastCourseDataShortcutServiceProtocol private let adaptiveStorageManager: AdaptiveStorageManagerProtocol diff --git a/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsService.swift b/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsService.swift index 24588d2b2c..84b9a04eae 100644 --- a/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsService.swift +++ b/Stepic/Sources/Services/SiriShortcuts/SiriShortcutsService.swift @@ -2,12 +2,10 @@ import CoreSpotlight import Foundation import MobileCoreServices -@available(iOS 12.0, *) protocol SiriShortcutsServiceProtocol: AnyObject { func getContinueLearningShortcut() -> NSUserActivity } -@available(iOS 12.0, *) final class SiriShortcutsService: SiriShortcutsServiceProtocol { func getContinueLearningShortcut() -> NSUserActivity { let activityType = NSUserActivity.continueLearningActivityType diff --git a/Stepic/Sources/Services/StorageManagers/SiriShortcutsStorageManager.swift b/Stepic/Sources/Services/StorageManagers/SiriShortcutsStorageManager.swift index 7e319eb1fd..8f52ccccfe 100644 --- a/Stepic/Sources/Services/StorageManagers/SiriShortcutsStorageManager.swift +++ b/Stepic/Sources/Services/StorageManagers/SiriShortcutsStorageManager.swift @@ -1,19 +1,16 @@ import Foundation -@available(iOS 12.0, *) protocol SiriShortcutsStorageManagerProtocol: AnyObject { var didClickFastContinueOnHomeWidget: Bool { get set } var didClickAddToSiriOnHomeWidget: Bool { get set } } -@available(iOS 12.0, *) extension SiriShortcutsStorageManagerProtocol { var shouldShowSiriButtonOnHomeWidget: Bool { self.didClickFastContinueOnHomeWidget && !self.didClickAddToSiriOnHomeWidget } } -@available(iOS 12.0, *) final class SiriShortcutsStorageManager: SiriShortcutsStorageManagerProtocol { var didClickFastContinueOnHomeWidget: Bool { get { diff --git a/Stepic/Sources/Services/Widget/WidgetService.swift b/Stepic/Sources/Services/Widget/WidgetService.swift new file mode 100644 index 0000000000..4078fa652e --- /dev/null +++ b/Stepic/Sources/Services/Widget/WidgetService.swift @@ -0,0 +1,76 @@ +import Foundation + +// swiftlint:disable force_cast + +final class WidgetService { + private var _widgetContentIndexingService: AnyObject? + @available(iOS 14.0, *) + private var widgetContentIndexingService: WidgetContentIndexingServiceProtocol { + if _widgetContentIndexingService == nil { + _widgetContentIndexingService = WidgetContentIndexingService.default + } + return _widgetContentIndexingService as! WidgetContentIndexingServiceProtocol + } + + private var _widgetRoutingService: AnyObject? + @available(iOS 14.0, *) + private var widgetRoutingService: WidgetRoutingServiceProtocol { + if _widgetRoutingService == nil { + _widgetRoutingService = WidgetRoutingService.default + } + return _widgetRoutingService as! WidgetRoutingServiceProtocol + } + + private var _widgetUserDefaults: AnyObject? + @available(iOS 14.0, *) + private var widgetUserDefaults: WidgetUserDefaultsProtocol { + if _widgetUserDefaults == nil { + _widgetUserDefaults = WidgetUserDefaults.default + } + return _widgetUserDefaults as! WidgetUserDefaultsProtocol + } + + private var _widgetTokenFileManager: AnyObject? + @available(iOS 14.0, *) + private var widgetTokenFileManager: StepikWidgetTokenFileManagerProtocol { + if _widgetTokenFileManager == nil { + _widgetTokenFileManager = StepikWidgetTokenFileManager.default + } + return _widgetTokenFileManager as! StepikWidgetTokenFileManagerProtocol + } + + @available(iOS 14.0, *) + func startIndexingContent(force: Bool = false) { + self.widgetContentIndexingService.startIndexing(force: force) + } + + @available(iOS 14.0, *) + func stopIndexingContent() { + self.widgetContentIndexingService.stopIndexing() + } + + @available(iOS 14.0, *) + func getLastWidgetSize() -> Int { + self.widgetUserDefaults.lastWidgetSize + } + + @available(iOS 14.0, *) + func getIsWidgetAdded() -> Bool { + self.widgetUserDefaults.isWidgetAdded + } + + @available(iOS 14.0, *) + func canOpenRouteURL(_ url: URL) -> Bool { + self.widgetRoutingService.canOpen(url: url) + } + + @available(iOS 14.0, *) + func openRouteURL(_ url: URL) { + self.widgetRoutingService.open(url: url) + } + + @available(iOS 14.0, *) + func writeToken(_ token: StepikWidgetToken) throws { + try self.widgetTokenFileManager.write(token: token) + } +} diff --git a/Stepic/Sources/Views/ContinueLastStepView/ContinueLastStepView.swift b/Stepic/Sources/Views/ContinueLastStepView/ContinueLastStepView.swift index a3ab6e4a8b..7219425404 100644 --- a/Stepic/Sources/Views/ContinueLastStepView/ContinueLastStepView.swift +++ b/Stepic/Sources/Views/ContinueLastStepView/ContinueLastStepView.swift @@ -32,7 +32,6 @@ extension ContinueLastStepView { } } -@available(iOS 12.0, *) struct SiriButtonContentConfiguration { var shortcut: INShortcut? weak var delegate: INUIAddVoiceShortcutButtonDelegate? @@ -53,7 +52,6 @@ final class ContinueLastStepView: UIView { // Should use wrapped button cause we have stack view private lazy var continueButtonBlock = UIView() - @available(iOS 12.0, *) private lazy var siriButton: INUIAddVoiceShortcutButton = { let button = INUIAddVoiceShortcutButton(style: .white) button.addTarget(self, action: #selector(self.siriButtonClicked), for: .touchUpInside) @@ -196,7 +194,6 @@ final class ContinueLastStepView: UIView { } } - @available(iOS 12.0, *) func configureSiriButton(contentConfiguration: SiriButtonContentConfiguration?) { guard let contentConfiguration = contentConfiguration, !contentConfiguration.isEmpty else { self.siriButtonContainerView.isHidden = true @@ -241,10 +238,8 @@ extension ContinueLastStepView: ProgrammaticallyInitializableViewProtocol { self.continueButtonBlock.addSubview(self.continueButton) self.contentStackView.addArrangedSubview(self.continueButtonBlock) - if #available(iOS 12.0, *) { - self.contentStackView.addArrangedSubview(self.siriButtonContainerView) - self.siriButtonContainerView.addSubview(self.siriButton) - } + self.contentStackView.addArrangedSubview(self.siriButtonContainerView) + self.siriButtonContainerView.addSubview(self.siriButton) self.contentStackView.addArrangedSubview(self.infoStackView) self.addSubview(self.backgroundImageView) @@ -300,14 +295,12 @@ extension ContinueLastStepView: ProgrammaticallyInitializableViewProtocol { make.width.equalTo(self.snp.width).multipliedBy(self.appearance.continueButtonWidthRatio) } - if #available(iOS 12.0, *) { - self.siriButton.snp.makeConstraints { make in - make.top.bottom.equalToSuperview() - make.leading.greaterThanOrEqualToSuperview() - make.trailing.lessThanOrEqualToSuperview() - make.centerX.equalToSuperview() - make.width.equalTo(self.snp.width).multipliedBy(self.appearance.continueButtonWidthRatio) - } + self.siriButton.snp.makeConstraints { make in + make.top.bottom.equalToSuperview() + make.leading.greaterThanOrEqualToSuperview() + make.trailing.lessThanOrEqualToSuperview() + make.centerX.equalToSuperview() + make.width.equalTo(self.snp.width).multipliedBy(self.appearance.continueButtonWidthRatio) } } } From 4e66d643a42e0a4d43f64141eaca7f21fb770366 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 05:21:26 +0800 Subject: [PATCH 24/43] Fix duplicate file in build sources --- Stepic.xcodeproj/project.pbxproj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 8cd66e7bd1..e646d2a7ea 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -444,7 +444,6 @@ 2C11C9F224EFC81500A4647B /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C11C9F124EFC81500A4647B /* LeftAlignedCollectionViewFlowLayout.swift */; }; 2C11C9F424EFCB2600A4647B /* UIFont+SizeOfString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C11C9F324EFCB2600A4647B /* UIFont+SizeOfString.swift */; }; 2C1219901F9655AB00A43E98 /* NotificationsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C12198F1F9655AB00A43E98 /* NotificationsSection.swift */; }; - 2C12E4722565668000DC52CB /* UIViewController+PresentPanModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C12E4712565668000DC52CB /* UIViewController+PresentPanModal.swift */; }; 2C130E3C2512402B00389AEB /* LaunchArguments.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C130E3B2512402B00389AEB /* LaunchArguments.swift */; }; 2C16495922C10DD400DF18CA /* UserActivitiesNetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C16495822C10DD300DF18CA /* UserActivitiesNetworkService.swift */; }; 2C16A88F248F98C9001E5CBD /* UserCoursesPersistenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C16A88E248F98C9001E5CBD /* UserCoursesPersistenceService.swift */; }; @@ -552,6 +551,7 @@ 2C313E5526AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C313E5426AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift */; }; 2C32E71320FF6C1D008BB909 /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2CC351841F6827BE004255B6 /* Auth.storyboard */; }; 2C336D1F2865DDB900C91342 /* CodeInputAccessoryButtonData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C336D1E2865DDB900C91342 /* CodeInputAccessoryButtonData.swift */; }; + 2C35B45029A95F2000F1F62F /* UIViewController+PresentPanModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C35B44F29A95F2000F1F62F /* UIViewController+PresentPanModal.swift */; }; 2C381BEF25505EC90084AD90 /* CourseListFilterBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C381BEE25505EC90084AD90 /* CourseListFilterBarButtonItem.swift */; }; 2C38D49E27BBCAC6002865B7 /* PromoBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49D27BBCAC6002865B7 /* PromoBanner.swift */; }; 2C38D4A027BBD074002865B7 /* PromoBannersService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C38D49F27BBD074002865B7 /* PromoBannersService.swift */; }; @@ -2491,7 +2491,6 @@ 2C11C9F124EFC81500A4647B /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = ""; }; 2C11C9F324EFCB2600A4647B /* UIFont+SizeOfString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+SizeOfString.swift"; sourceTree = ""; }; 2C12198F1F9655AB00A43E98 /* NotificationsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsSection.swift; sourceTree = ""; }; - 2C12E4712565668000DC52CB /* UIViewController+PresentPanModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+PresentPanModal.swift"; sourceTree = ""; }; 2C130E3B2512402B00389AEB /* LaunchArguments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchArguments.swift; sourceTree = ""; }; 2C16495822C10DD300DF18CA /* UserActivitiesNetworkService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserActivitiesNetworkService.swift; sourceTree = ""; }; 2C16A88E248F98C9001E5CBD /* UserCoursesPersistenceService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserCoursesPersistenceService.swift; sourceTree = ""; }; @@ -2605,6 +2604,7 @@ 2C313E5426AFE636004ECBD2 /* StepQuizReviewStatusCircleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepQuizReviewStatusCircleView.swift; sourceTree = ""; }; 2C32664224B00BEF0013C473 /* Model_course_purchases_v54.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_course_purchases_v54.xcdatamodel; sourceTree = ""; }; 2C336D1E2865DDB900C91342 /* CodeInputAccessoryButtonData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeInputAccessoryButtonData.swift; sourceTree = ""; }; + 2C35B44F29A95F2000F1F62F /* UIViewController+PresentPanModal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+PresentPanModal.swift"; sourceTree = ""; }; 2C35C4C61F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/adjectives_f.plist; sourceTree = ""; }; 2C35C4C81F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/adjectives_m.plist; sourceTree = ""; }; 2C35C4CA1F4DA462002F3BF4 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = ru; path = LeaderboardNames/ru.lproj/nouns_f.plist; sourceTree = ""; }; @@ -4594,7 +4594,7 @@ 2C12E4702565663100DC52CB /* PanModal */ = { isa = PBXGroup; children = ( - 2C12E4712565668000DC52CB /* UIViewController+PresentPanModal.swift */, + 2C35B44F29A95F2000F1F62F /* UIViewController+PresentPanModal.swift */, ); path = PanModal; sourceTree = ""; @@ -11591,9 +11591,7 @@ 2C762B402653C93A00E0AB59 /* SwiftyJSON+DecimalNumber.swift in Sources */, 2C6FA0B02588B0EC00D50DAA /* DefaultSimpleCourseListView.swift in Sources */, 2C98423C26DE4CA80098E36B /* SearchResult+CoreDataProperties.swift in Sources */, - 2C12E4722565668000DC52CB /* UIViewController+PresentPanModal.swift in Sources */, 2CBEAACE271EFA9A00B52D2C /* CourseInfoPurchaseModalDisclaimerView.swift in Sources */, - 2C12E4722565668000DC52CB /* UIViewController+PresentPanModal.swift in Sources */, 2C6917C625EE47D700BAE0F5 /* NewExploreBlockPlaceholderView.swift in Sources */, 2CA867C12588FFF40006576E /* GridSimpleCourseListCollectionHeaderView.swift in Sources */, 2C0FE8C425F81A4900626289 /* InstructionPlainObject.swift in Sources */, @@ -11906,6 +11904,7 @@ 2C0F80C525C9BB5A006E9233 /* PromoPriceButton.swift in Sources */, 2CBCBD4A20D1AAFC000B5732 /* AchievementsListTableViewCell.swift in Sources */, 2CA9D97D20109C07007AA743 /* AdaptiveRatingsPresenter.swift in Sources */, + 2C35B45029A95F2000F1F62F /* UIViewController+PresentPanModal.swift in Sources */, 2CEA59D026E4BEF800A905E3 /* CourseSearchResultTableViewCell.swift in Sources */, 2C20C86622F8E4BF0052E9BF /* CodeDetails.swift in Sources */, 2C7024BA23D00762002A0246 /* SettingsRightDetailSwitchTableViewCell.swift in Sources */, From 01323e782bf109b2fa292172234f67a660c98a0b Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 05:21:41 +0800 Subject: [PATCH 25/43] Disable bitcode --- Stepic.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index e646d2a7ea..770195827e 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -13459,7 +13459,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -13489,7 +13489,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = "Stepic/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -13580,7 +13580,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -13713,7 +13713,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -14281,7 +14281,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -14417,7 +14417,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 429; DEVELOPMENT_TEAM = UJ4KC2QN7B; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; From 86d5ca748ec0003c2cd4d596b2c19fcf29498f5b Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 05:22:12 +0800 Subject: [PATCH 26/43] Fix Xcode 14 bundle code signing issue --- Podfile | 11 +++++++++-- Podfile.lock | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Podfile b/Podfile index a2eaa7179b..6d69230e22 100644 --- a/Podfile +++ b/Podfile @@ -104,8 +104,15 @@ end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - if config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"].to_f < 9.0 - config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "9.0" + if config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"].to_f < 12.0 + config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.0" + end + end + + # Fix Xcode 14 bundle code signing issue + if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" + target.build_configurations.each do |config| + config.build_settings["CODE_SIGNING_ALLOWED"] = "NO" end end end diff --git a/Podfile.lock b/Podfile.lock index 378f3d8968..9580683ef1 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -423,6 +423,6 @@ SPEC CHECKSUMS: VK-ios-sdk: 5bcf00a2014a7323f98db9328b603d4f96635caa YandexMobileMetrica: 9e713c16bb6aca0ba63b84c8d7b8b86d32f4ecc4 -PODFILE CHECKSUM: 2bb5dc24ec01e6805f170e0bb2fbfb3164c01595 +PODFILE CHECKSUM: 75718f193cfc7924dbc1854e38c62a6d03cc46c6 COCOAPODS: 1.11.3 From fd6dde183c8a906682baa2b75df9f338d512ce24 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 13:37:25 +0800 Subject: [PATCH 27/43] Set version to 1.218 & bump build --- Stepic.xcodeproj/project.pbxproj | 24 +++++++++++----------- Stepic/Info-Develop.plist | 2 +- Stepic/Info-Production.plist | 2 +- Stepic/Info-Release.plist | 2 +- StepicTests/Info-Develop.plist | 2 +- StepicTests/Info-Production.plist | 2 +- StepicTests/Info-Release.plist | 2 +- StepicUITests/Info-Develop.plist | 4 ++-- StepicUITests/Info-Production.plist | 4 ++-- StepicUITests/Info-Release.plist | 4 ++-- StepicWidget/Info-Develop.plist | 4 ++-- StepicWidget/Info-Production.plist | 4 ++-- StepicWidget/Info-Release.plist | 4 ++-- StickerPackExtension/Info-Develop.plist | 2 +- StickerPackExtension/Info-Production.plist | 2 +- StickerPackExtension/Info-Release.plist | 2 +- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 53a6d2866f..e02743cf17 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -13290,7 +13290,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; @@ -13315,7 +13315,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -13457,7 +13457,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Production.plist"; @@ -13487,7 +13487,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -13578,7 +13578,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13630,7 +13630,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; @@ -13711,7 +13711,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13759,7 +13759,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -14279,7 +14279,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14333,7 +14333,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; @@ -14415,7 +14415,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14463,7 +14463,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 430; + CURRENT_PROJECT_VERSION = 431; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; diff --git a/Stepic/Info-Develop.plist b/Stepic/Info-Develop.plist index d741ac6725..dc323a135d 100644 --- a/Stepic/Info-Develop.plist +++ b/Stepic/Info-Develop.plist @@ -62,7 +62,7 @@ CFBundleVersion - 430 + 431 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Production.plist b/Stepic/Info-Production.plist index aecca9ecc4..bc3ac3f201 100644 --- a/Stepic/Info-Production.plist +++ b/Stepic/Info-Production.plist @@ -62,7 +62,7 @@ CFBundleVersion - 430 + 431 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Release.plist b/Stepic/Info-Release.plist index ed80b87ffe..042f86a291 100644 --- a/Stepic/Info-Release.plist +++ b/Stepic/Info-Release.plist @@ -62,7 +62,7 @@ CFBundleVersion - 430 + 431 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/StepicTests/Info-Develop.plist b/StepicTests/Info-Develop.plist index bea5f88a51..5e06471c4a 100644 --- a/StepicTests/Info-Develop.plist +++ b/StepicTests/Info-Develop.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 430 + 431 diff --git a/StepicTests/Info-Production.plist b/StepicTests/Info-Production.plist index 26ab624a36..d2187ccd0f 100644 --- a/StepicTests/Info-Production.plist +++ b/StepicTests/Info-Production.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 430 + 431 diff --git a/StepicTests/Info-Release.plist b/StepicTests/Info-Release.plist index d6ee262d48..4df74b4ad6 100644 --- a/StepicTests/Info-Release.plist +++ b/StepicTests/Info-Release.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 430 + 431 diff --git a/StepicUITests/Info-Develop.plist b/StepicUITests/Info-Develop.plist index cfc78eb1cd..f1120459bc 100644 --- a/StepicUITests/Info-Develop.plist +++ b/StepicUITests/Info-Develop.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217-develop + 1.218-develop CFBundleVersion - 429 + 431 diff --git a/StepicUITests/Info-Production.plist b/StepicUITests/Info-Production.plist index 55dcde2726..6a6110b648 100644 --- a/StepicUITests/Info-Production.plist +++ b/StepicUITests/Info-Production.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217 + 1.218 CFBundleVersion - 429 + 431 diff --git a/StepicUITests/Info-Release.plist b/StepicUITests/Info-Release.plist index 108db69cbc..80db501a2d 100644 --- a/StepicUITests/Info-Release.plist +++ b/StepicUITests/Info-Release.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217-release + 1.218-release CFBundleVersion - 429 + 431 diff --git a/StepicWidget/Info-Develop.plist b/StepicWidget/Info-Develop.plist index 3866afa79b..4e2901594d 100644 --- a/StepicWidget/Info-Develop.plist +++ b/StepicWidget/Info-Develop.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217-develop + 1.218-develop CFBundleVersion - 429 + 431 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Production.plist b/StepicWidget/Info-Production.plist index 5d84e8deb1..61f7e167a5 100644 --- a/StepicWidget/Info-Production.plist +++ b/StepicWidget/Info-Production.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217 + 1.218 CFBundleVersion - 429 + 431 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Release.plist b/StepicWidget/Info-Release.plist index e8acb7d75c..e97efb87f0 100644 --- a/StepicWidget/Info-Release.plist +++ b/StepicWidget/Info-Release.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.217-release + 1.218-release CFBundleVersion - 429 + 431 NSExtension NSExtensionPointIdentifier diff --git a/StickerPackExtension/Info-Develop.plist b/StickerPackExtension/Info-Develop.plist index a1fda89646..50d7915dde 100644 --- a/StickerPackExtension/Info-Develop.plist +++ b/StickerPackExtension/Info-Develop.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-develop CFBundleVersion - 430 + 431 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Production.plist b/StickerPackExtension/Info-Production.plist index 60f6e7f588..373d8c51a1 100644 --- a/StickerPackExtension/Info-Production.plist +++ b/StickerPackExtension/Info-Production.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218 CFBundleVersion - 430 + 431 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Release.plist b/StickerPackExtension/Info-Release.plist index 8e72c32154..e7947b9e1d 100644 --- a/StickerPackExtension/Info-Release.plist +++ b/StickerPackExtension/Info-Release.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-release CFBundleVersion - 430 + 431 UIRequiredDeviceCapabilities arm64 From b3a508e1bfefd026fa5559bdb3d038322d8edb2d Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 13:41:39 +0800 Subject: [PATCH 28/43] Update copyright date --- fastlane/metadata/Stepic/copyright.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/metadata/Stepic/copyright.txt b/fastlane/metadata/Stepic/copyright.txt index 601c285460..bb902e47fa 100644 --- a/fastlane/metadata/Stepic/copyright.txt +++ b/fastlane/metadata/Stepic/copyright.txt @@ -1 +1 @@ -2013-2022 Stepik +2013-2023 Stepik From ca65b0eb882a98c0f989baa0ea2242eef29bac11 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 13:47:34 +0800 Subject: [PATCH 29/43] Update release notes for beta testers --- fastlane/release-notes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/release-notes.txt b/fastlane/release-notes.txt index 70e74c4f03..d3abff975f 100644 --- a/fastlane/release-notes.txt +++ b/fastlane/release-notes.txt @@ -1,2 +1,2 @@ Что тестировать: -- Аналитика accessibility APPS-3634 \ No newline at end of file +- Черная полоса в navbar на iPhone 14 Pro APPS-3667 \ No newline at end of file From 76ab9c2ea51ce21b66cb6366181d919b7284f02d Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 14:00:19 +0800 Subject: [PATCH 30/43] Add Appfile --- fastlane/Appfile | Bin 0 -> 122 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 fastlane/Appfile diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 0000000000000000000000000000000000000000..dfc80dbdf3ef320d438970f1a5a6d697eac77e21 GIT binary patch literal 122 zcmV-=0EPbmM@dveQdv+`084HmV`$eMPQZ4b3=Vm@MtSwZv-NnT45)D?+glk{5N{_F z9L6Wg!Qg<7`~~Y>!eTm7B~5{$UsqHmP!K{?=H$F=B(pcgAaoB_2@*)uZh$DR37saT ckUbQqDH>=@yH@?%EGGI^`z~@ed<;M1OzB=Sk^lez literal 0 HcmV?d00001 From fcd5757a590050f518f687886d8fe4afe93781e7 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 14:09:51 +0800 Subject: [PATCH 31/43] Add Matchfile --- fastlane/Matchfile | Bin 0 -> 96 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 fastlane/Matchfile diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 0000000000000000000000000000000000000000..3ea943dca25c39345aaec1c9c4de607e6594a7d5 GIT binary patch literal 96 zcmV-m0H6N=M@dveQdv+`08~h$Q3aCVYoBUa)tfMF+~9Q8z~Nh3DDjCF{w}4$aGC-iVDjDG>w>wJ_twYRr?}*eC+tAFU4KPU34PXr=*brx@$c*6 CEHeWD literal 0 HcmV?d00001 From 3f1c43536a32f46257dc1214f033ffcf1017c233 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 14:24:26 +0800 Subject: [PATCH 32/43] Update Appfile --- fastlane/Appfile | Bin 122 -> 185 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/fastlane/Appfile b/fastlane/Appfile index dfc80dbdf3ef320d438970f1a5a6d697eac77e21..40121e91e8647f0d7308d2298cbeb4bf806e0dec 100644 GIT binary patch literal 185 zcmV;q07m}+M@dveQdv+`02sxcI^0#Ah&lmODE`2!B7xfaWExUZU67aO)+<;YZ$Fg8 zi96a%cAPZa;NjIHSGS2?P9WUJCekD@~{E9Fal4f&nz>ggqQ#vlcD9&(hn`P zzPC)m`Na+ELeTuw$jLK@vyNq!^JYERaPM9dqiPDS;suE40s>X^qS^={sJvC|#QNZ) nu|r%`Udaz(UT=a)G^M@UW~Y!eTm7B~5{$UsqHmP!K{?=H$F=B(pcgAaoB_2@*)uZh$DR37saT ckUbQqDH>=@yH@?%EGGI^`z~@ed<;M1OzB=Sk^lez From c71eedbd84bda5ece1971cd01c1b6eb7d3e72291 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sat, 25 Feb 2023 15:10:43 +0800 Subject: [PATCH 33/43] Update Fastfile --- fastlane/Fastfile | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7d098ded1e..9d78943d78 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -5,7 +5,14 @@ default_platform :ios platform :ios do # Config variables - team_id = ENV["FASTLANE_TEAM_ID"] + team_name = CredentialsManager::AppfileConfig.try_fetch_value(:team_name) + team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) + + itc_team_name = CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name) + itc_team_id = CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id) + + firebase_app_id = ENV["FIREBASE_APP_ID"] + keychain_password = ENV["KEYCHAIN_PASSWORD"] # Constants @@ -98,7 +105,7 @@ platform :ios do end def update_beta_profile_compilation_condition(options) - require 'xcodeproj' + require "xcodeproj" target_name = options[:target] || "Stepic" scheme = options[:scheme] @@ -115,10 +122,10 @@ platform :ios do project = Xcodeproj::Project.open("../Stepic.xcodeproj") - target = project.targets.find {|it| it.name == target_name } + target = project.targets.find { |it| it.name == target_name } UI.user_error!("Can't find target for name #{target_name}") if target.nil? - build_configuration = target.build_configurations.find {|it| it.name == configuration_name } + build_configuration = target.build_configurations.find { |it| it.name == configuration_name } UI.user_error!("Can't find build configuration for name #{configuration_name}") if build_configuration.nil? old_build_setting = build_configuration.build_settings["SWIFT_ACTIVE_COMPILATION_CONDITIONS"] @@ -145,11 +152,11 @@ platform :ios do match( type: type, - storage_mode: "google_cloud", - google_cloud_bucket_name: "stepik-ios-cert", - force_for_new_devices: true, readonly: read_only, app_identifier: identifiers, + team_id: team_id, + team_name: team_name, + force_for_new_devices: true, ) end @@ -228,7 +235,6 @@ platform :ios do desc "Options: scheme" lane :beta do |options| scheme = options[:scheme] - firebase_app_id = ENV["FIREBASE_APP_ID"] UI.user_error!("Wrong scheme parameter") if scheme.nil? UI.user_error!("Firebase App ID is required") if firebase_app_id.nil? @@ -236,7 +242,7 @@ platform :ios do ENV["FASTLANE_BETA_PROFILE"] = "true" clear_derived_data - cocoapods(repo_update: true) + cocoapods(try_repo_update_on_error: true) unlock_keychain(password: keychain_password) @@ -337,7 +343,11 @@ platform :ios do desc "Update iOS UDID's on the Developer Portal." lane :sync_device_info do - register_devices(devices_file: "fastlane/Devicefile") + register_devices( + devices_file: "fastlane/Devicefile", + team_id: team_id, + team_name: team_name, + ) end desc "Increment build number in project" @@ -412,7 +422,7 @@ platform :ios do should_submit = options.key?(:should_submit) ? options[:should_submit] : false clear_derived_data - cocoapods(repo_update: true) + cocoapods(try_repo_update_on_error: true) unlock_keychain(password: keychain_password) From d38face4dad84e0cc1c7dd420ee78fc46a1c9a5a Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sun, 26 Feb 2023 15:16:45 +0800 Subject: [PATCH 34/43] Update author referral link appearance (#1162) ^APPS-3653 --- .../Contents.json | 2 +- .../course-revenue-transaction-a-link.pdf | Bin 0 -> 2655 bytes .../course-revenue-transaction-z-link.pdf | Bin 2902 -> 0 bytes .../CourseBenefit+CoreDataProperties.swift | 3 ++- .../Entities/CourseBenefit/CourseBenefit.swift | 3 ++- .../PlainObjects/CourseBenefitPlainObject.swift | 4 ++-- .../CourseBenefitDetailPresenter.swift | 4 ++-- .../Cell/CourseRevenueTabMonthlyCellView.swift | 4 ++-- .../CourseRevenueTabPurchasesPresenter.swift | 2 +- .../CourseRevenueTabPurchasesViewModel.swift | 2 +- .../Cell/CourseRevenueTabPurchasesCellView.swift | 4 ++-- Stepic/en.lproj/Localizable.strings | 4 ++-- Stepic/ru.lproj/Localizable.strings | 4 ++-- 13 files changed, 19 insertions(+), 17 deletions(-) rename Stepic/Images.xcassets/Course revenue/{course-revenue-transaction-z-link.imageset => course-revenue-transaction-a-link.imageset}/Contents.json (76%) create mode 100644 Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/course-revenue-transaction-a-link.pdf delete mode 100644 Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/course-revenue-transaction-z-link.pdf diff --git a/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/Contents.json b/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/Contents.json similarity index 76% rename from Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/Contents.json rename to Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/Contents.json index b2c46161ca..9cf76fef7d 100644 --- a/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/Contents.json +++ b/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "course-revenue-transaction-z-link.pdf", + "filename" : "course-revenue-transaction-a-link.pdf", "idiom" : "universal" } ], diff --git a/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/course-revenue-transaction-a-link.pdf b/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-a-link.imageset/course-revenue-transaction-a-link.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9dc182723b794e7d7674051235233c75e1e1c1dc GIT binary patch literal 2655 zcmb7GO^@3)5WVwP@UlR12+iTQfFMA#n*>2ybnEmM-$EgNE!|h zLM5!~TK)3e)1NUxxkT>65eo*ZkJ; zbQm@}vAP@n+4jTw%}aUvuKm{^#ovOIo-e7Fn`h;&d1j->Yj`Q&^gE$dr+rG`pgPxS zqh)#j*zX0A3MMbgTkHfSrJc8ggqH1$Rr70FdS$c=sgo6|L3+`kB}$FgJS`hntQY6t zoo<2`3N=cFN{}9jX8wg>3059eq6O;3C-G72#qU3?G8~|@bhFGR;EGVp8}gxJy-nxH zNR}BnW_DzjRl5fDDmfDa%!%+T8pkHiW&$cn7O21QEgLhkZh$kn%?g=(#!no_NRid`sD;xPXo>ZPE(w-Iv&^>3}# zNq)bT2%fo!Id*Pg>m(Wp^C~8^Pr;0G&f4ICSWhkmX<$d^yvO{b&KnzKFDxELhgeoo zG|7`31(e1*dx1e83`8^~)*=d`jUu6CDb0<_MFgx<#^%;#W5BFaU2+!Vtnh+x+%qw@ zAQZ;1^)uutdBmy^DdUo!>9(LJiU0wb5W`F@V!odtat`-MS$D+DdSn&wQkn>;w<(Z($pl{I9bNm)I9BVz3bJ`3az{cQh9i z{aWvqNbBJ^eL3{QQSz~6ox|Nu`_r(;j(lcW!28Vsm_#qlP;;_jsGN9KKW`sERdNPv zx$JX0eZg9~;(r9vM1pZmBu?;HHmr%?ZcdwVdc0iv^)P%CT1Ii6hWsl7=8Bhq^F^o! zzU00@XwOT?kiLctzUUVV4aU?J6zjs%VY3~FgJAdG-a(Eh$7we_l~1-0PtT&P*3)#7 fobW90>fQFg0qp0a;O20e(=ixc;^yYnZ?FFcgdiHA literal 0 HcmV?d00001 diff --git a/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/course-revenue-transaction-z-link.pdf b/Stepic/Images.xcassets/Course revenue/course-revenue-transaction-z-link.imageset/course-revenue-transaction-z-link.pdf deleted file mode 100644 index 0e39c740c35b9f8e7b071273922af93c3818b10a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2902 zcmd^BO>f*b5WVwP%*8-bAY6Wkln4X?8runqwy3=>&_mFJDl7IDyQ^lU6ls5bAGOkq zw!1)k>8Y||Q;(XNH;+SduI_H$y|TJg%95e(mtPgp>({ip{W83N80w)tzS;3#QY`^Rji+==~n?fz+aCJ%6p4^=-L+Ipu}H|_76rd_{(OVa|}c=^WYVa&gXcl*(va=3U3Qo24ho1Ryw&58=8{Ophmc56 zl*BY2v`MijED0oT8s(Ucpj-942*r_hsQ8I6V>~#Y5`T>nVuEfLD3j#DB@4lpQZR)~ zn_nbOJ{aa@V4a!nrThh3#u5Ft5aLW!A$Ms#gihZ6GaX*eQ^h6zE-&s>8iLB`((E#n za29l%cmK?QOGijAW|^O0CyH?GWd6sK<^JDpsHk1?CRqx)9NEx6AK^yF5R)&-TJ4TT zd36O$1vUcqlXf#!{(^Y~v|` zfse*f#I=*WPt+)ngWckiB(GD5-c$s!wKG)_3t+MI&Q|2$!j_22Onmm`V-%!O3Cuxw zfq@#XxKuib#-@PEtVvFK&VB(+Dq+_3&ge5H{ze6NDCQ&LKn6=zY6+1XaoztZ9yO-F=3wJ>%a4S$K*k zo{ni=*F(MSo+i_rbbpD&mqYte87kE=*Zh}a2tE+t>9Oel@ Date: Sun, 26 Feb 2023 15:25:48 +0800 Subject: [PATCH 35/43] Update release notes for beta testers --- fastlane/release-notes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/release-notes.txt b/fastlane/release-notes.txt index d3abff975f..561aa5bc5b 100644 --- a/fastlane/release-notes.txt +++ b/fastlane/release-notes.txt @@ -1,2 +1,3 @@ Что тестировать: +- Заменить z-ссылку на a-ссылку в Доходах курса APPS-3653 - Черная полоса в navbar на iPhone 14 Pro APPS-3667 \ No newline at end of file From 1907311e6a7ee86171a66b968c03655b48efadd9 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sun, 26 Feb 2023 16:37:22 +0800 Subject: [PATCH 36/43] Fix course share URL (#1163) ^APPS-3541 --- .../CourseInfo/CourseInfoDataFlow.swift | 2 +- .../CourseInfo/CourseInfoInteractor.swift | 31 +++++-------------- .../CourseInfo/CourseInfoPresenter.swift | 2 +- .../CourseInfo/CourseInfoViewController.swift | 2 +- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/Stepic/Sources/Modules/CourseInfo/CourseInfoDataFlow.swift b/Stepic/Sources/Modules/CourseInfo/CourseInfoDataFlow.swift index e592829b76..ea9bce8a26 100644 --- a/Stepic/Sources/Modules/CourseInfo/CourseInfoDataFlow.swift +++ b/Stepic/Sources/Modules/CourseInfo/CourseInfoDataFlow.swift @@ -105,7 +105,7 @@ enum CourseInfo { /// Present exam in web enum ExamLessonPresentation { struct Response { - let urlPath: String + let url: URL } struct ViewModel { diff --git a/Stepic/Sources/Modules/CourseInfo/CourseInfoInteractor.swift b/Stepic/Sources/Modules/CourseInfo/CourseInfoInteractor.swift index 7f14df4b66..78c3415aea 100644 --- a/Stepic/Sources/Modules/CourseInfo/CourseInfoInteractor.swift +++ b/Stepic/Sources/Modules/CourseInfo/CourseInfoInteractor.swift @@ -71,25 +71,6 @@ final class CourseInfoInteractor: CourseInfoInteractorProtocol { self.shouldCheckIAPPurchaseSupport && self.currentMobileTier?.priceTier != nil } - private var courseWebURL: URL? { - guard let course = self.currentCourse else { - return nil - } - - if let slug = course.slug { - return self.urlFactory.makeCourse(slug: slug) - } else { - return self.urlFactory.makeCourse(id: course.id) - } - } - - private var courseWebSyllabusURLPath: String? { - guard let courseWebURLPath = self.courseWebURL?.absoluteString else { - return nil - } - return "\(courseWebURLPath)/syllabus" - } - // Tab index -> Submodule private var submodules: [Int: CourseInfoSubmoduleProtocol] = [:] @@ -213,12 +194,13 @@ final class CourseInfoInteractor: CourseInfoInteractorProtocol { } func doCourseShareAction(request: CourseInfo.CourseShareAction.Request) { - guard let courseWebURL = self.courseWebURL else { + guard let currentCourse = self.currentCourse, + let courseURL = self.urlFactory.makeCourse(id: currentCourse.id) else { return } self.analytics.send(.shareCourseTapped) - self.presenter.presentCourseSharing(response: .init(url: courseWebURL, courseViewSource: self.courseViewSource)) + self.presenter.presentCourseSharing(response: .init(url: courseURL, courseViewSource: self.courseViewSource)) } func doCourseUnenrollmentAction(request: CourseInfo.CourseUnenrollmentAction.Request) { @@ -755,9 +737,12 @@ extension CourseInfoInteractor: CourseInfoTabSyllabusOutputProtocol { } func presentExamLesson() { - if let courseWebSyllabusURLPath = self.courseWebSyllabusURLPath { - self.presenter.presentExamLesson(response: .init(urlPath: courseWebSyllabusURLPath)) + guard let currentCourse = self.currentCourse, + let courseSyllabusURL = self.urlFactory.makeCourseSyllabus(id: currentCourse.id) else { + return } + + self.presenter.presentExamLesson(response: .init(url: courseSyllabusURL)) } } diff --git a/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift b/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift index 457612f6c6..a204242b14 100644 --- a/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift +++ b/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift @@ -71,7 +71,7 @@ final class CourseInfoPresenter: CourseInfoPresenterProtocol { func presentExamLesson(response: CourseInfo.ExamLessonPresentation.Response) { let viewModel = CourseInfo.ExamLessonPresentation.ViewModel( - urlPath: response.urlPath + urlPath: response.url.absoluteString ) self.viewController?.displayExamLesson(viewModel: viewModel) } diff --git a/Stepic/Sources/Modules/CourseInfo/CourseInfoViewController.swift b/Stepic/Sources/Modules/CourseInfo/CourseInfoViewController.swift index a30708dab1..c9c218f2a8 100644 --- a/Stepic/Sources/Modules/CourseInfo/CourseInfoViewController.swift +++ b/Stepic/Sources/Modules/CourseInfo/CourseInfoViewController.swift @@ -527,7 +527,7 @@ extension CourseInfoViewController: CourseInfoViewControllerProtocol { return } WebControllerManager.shared.presentWebControllerWithURLString( - "\(viewModel.urlPath)?from_mobile_app=true", + viewModel.urlPath, inController: strongSelf, withKey: .exam, allowsSafari: true, From 1e72dcde800e95d314edd1ec98fb3651872c952c Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Sun, 26 Feb 2023 16:40:18 +0800 Subject: [PATCH 37/43] Update release notes for beta testers --- fastlane/release-notes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/release-notes.txt b/fastlane/release-notes.txt index 561aa5bc5b..94c86eef10 100644 --- a/fastlane/release-notes.txt +++ b/fastlane/release-notes.txt @@ -1,3 +1,4 @@ Что тестировать: +- Расшаренная ссылка не открывается в приложении APPS-3541 - Заменить z-ссылку на a-ссылку в Доходах курса APPS-3653 - Черная полоса в navbar на iPhone 14 Pro APPS-3667 \ No newline at end of file From a0e1541c5c07c23ae576d7721623f56a9daf810e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:46:37 +0700 Subject: [PATCH 38/43] bundler: bump cocoapods from 1.11.3 to 1.12.0 (#1164) * bundler: bump cocoapods from 1.11.3 to 1.12.0 Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.11.3 to 1.12.0. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.11.3...1.12.0) --- updated-dependencies: - dependency-name: cocoapods dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Run bundle update --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Magda --- Gemfile | 2 +- Gemfile.lock | 36 +++++++++++++++++------------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index 37c6e0f8e4..d13be903e9 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" ruby "3.2.1" gem "fastlane", "2.212.1" -gem "cocoapods", "1.11.3" +gem "cocoapods", "1.12.0" gem "generamba", "1.5.0" eval_gemfile("fastlane/Pluginfile") diff --git a/Gemfile.lock b/Gemfile.lock index 1b78a47cc9..0c1fce0b35 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,12 +3,11 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (6.1.7.2) + activesupport (7.0.4.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) @@ -17,13 +16,13 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.716.0) + aws-partitions (1.721.0) aws-sdk-core (3.170.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.62.0) + aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.119.1) @@ -34,15 +33,15 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) - cocoapods (1.11.3) + cocoapods (1.12.0) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.12.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 1.6.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -50,10 +49,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) + ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + cocoapods-core (1.12.0) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -168,8 +167,8 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.34.0) - google-apis-core (>= 0.9.1, < 2.a) + google-apis-androidpublisher_v3 (0.35.0) + google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) @@ -181,8 +180,8 @@ GEM webrick google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-playcustomapp_v1 (0.12.0) - google-apis-core (>= 0.9.1, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) google-apis-storage_v1 (0.19.0) google-apis-core (>= 0.9.0, < 2.a) google-cloud-core (1.6.0) @@ -190,7 +189,7 @@ GEM google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) + google-cloud-errors (1.3.1) google-cloud-storage (1.44.0) addressable (~> 2.8) digest-crc (~> 0.4) @@ -219,7 +218,7 @@ GEM memoist (0.16.2) mini_magick (4.12.0) mini_mime (1.1.2) - minitest (5.17.0) + minitest (5.18.0) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.0.0) @@ -280,13 +279,12 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.6.7) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.11.3) + cocoapods (= 1.12.0) fastlane (= 2.212.1) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) From d654dd4c023ebbcc93b3b37e242b6a40e9cb511e Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Mon, 3 Apr 2023 23:17:30 +0700 Subject: [PATCH 39/43] Course info update purchase feedback UI (#1166) ^APPS-3680 --- Stepic.xcodeproj/project.pbxproj | 4 + .../CourseInfo/CourseInfoPresenter.swift | 4 +- .../Views/CourseInfoHeaderView.swift | 11 +- .../CourseInfoPurchaseFeedbackView.swift | 105 ++++++++++++++++++ Stepic/en.lproj/Localizable.strings | 3 +- Stepic/ru.lproj/Localizable.strings | 3 +- 6 files changed, 121 insertions(+), 9 deletions(-) create mode 100644 Stepic/Sources/Modules/CourseInfo/Views/CourseInfoPurchaseFeedbackView.swift diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 770195827e..950c99bd02 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -1089,6 +1089,7 @@ 2CCBE69426B0659B00A2E922 /* StepQuizReviewSkeletonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCBE69326B0659B00A2E922 /* StepQuizReviewSkeletonView.swift */; }; 2CCC505E21E8EA88004D9FC1 /* PersonalDeadlinesTimeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08194EB920B813AC00B34327 /* PersonalDeadlinesTimeService.swift */; }; 2CCD26A9269CB9A600053536 /* CourseRevenueTabMonthlyCellSkeletonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD26A8269CB9A600053536 /* CourseRevenueTabMonthlyCellSkeletonView.swift */; }; + 2CCD68FB29DAA771004CB6A2 /* CourseInfoPurchaseFeedbackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD68FA29DAA771004CB6A2 /* CourseInfoPurchaseFeedbackView.swift */; }; 2CCDD1FE24DBB35700A48EE0 /* Protected.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCDD1FD24DBB35700A48EE0 /* Protected.swift */; }; 2CCDD20124DBB61100A48EE0 /* ProtectedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCDD20024DBB61100A48EE0 /* ProtectedTests.swift */; }; 2CCDD80024F8A59B006644A8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2CCDD80224F8A59B006644A8 /* InfoPlist.strings */; }; @@ -3187,6 +3188,7 @@ 2CCBE69326B0659B00A2E922 /* StepQuizReviewSkeletonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepQuizReviewSkeletonView.swift; sourceTree = ""; }; 2CCC7DBD219F09C60000540F /* Model_course_language_code_v27.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model_course_language_code_v27.xcdatamodel; sourceTree = ""; }; 2CCD26A8269CB9A600053536 /* CourseRevenueTabMonthlyCellSkeletonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseRevenueTabMonthlyCellSkeletonView.swift; sourceTree = ""; }; + 2CCD68FA29DAA771004CB6A2 /* CourseInfoPurchaseFeedbackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseInfoPurchaseFeedbackView.swift; sourceTree = ""; }; 2CCDD1FD24DBB35700A48EE0 /* Protected.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Protected.swift; sourceTree = ""; }; 2CCDD20024DBB61100A48EE0 /* ProtectedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProtectedTests.swift; sourceTree = ""; }; 2CCDD80124F8A59B006644A8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -9690,6 +9692,7 @@ 62E98382552527F92D26C681 /* CourseInfoBlurredBackgroundView.swift */, 2CC29ADA27C40F1E00D4EDD0 /* CourseInfoHeaderTitleView.swift */, 62E989A8236D0E5624DAD9ED /* CourseInfoHeaderView.swift */, + 2CCD68FA29DAA771004CB6A2 /* CourseInfoPurchaseFeedbackView.swift */, 62E9825DC46191B6B299CBC2 /* CourseInfoStatsView.swift */, 2CDC9EF924E4FD0D00916BAE /* CourseInfoTryForFreeButton.swift */, 62E98ABA6ADA2DEA8E21746B /* CourseInfoView.swift */, @@ -12518,6 +12521,7 @@ 62E98EEB59DAF1D0700A7DB9 /* CodeLanguagePickerView.swift in Sources */, 2C49911E2722BD0A008D7F15 /* EditRemoteConfigValueViewController.swift in Sources */, 62E98A2B85DD1D883B5BFEC7 /* CodeToolbarLanguagePickerButton.swift in Sources */, + 2CCD68FB29DAA771004CB6A2 /* CourseInfoPurchaseFeedbackView.swift in Sources */, 2C94C7FA248F86C900E4104E /* UserCourse+CoreDataProperties.swift in Sources */, 2CC5AA71242A34FA00C09F94 /* AdaptiveStatsManager.swift in Sources */, 62E98F91C1E401E5C9855DB1 /* CodeToolbarView.swift in Sources */, diff --git a/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift b/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift index a204242b14..b505a38baa 100644 --- a/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift +++ b/Stepic/Sources/Modules/CourseInfo/CourseInfoPresenter.swift @@ -347,11 +347,11 @@ final class CourseInfoPresenter: CourseInfoPresenterProtocol { } if course.isPaid && !course.isPurchased && !course.canBeBought { - return NSLocalizedString("CourseIntoPaymentsCantBeBought", comment: "") + return NSLocalizedString("CourseInfoPaymentsCantBeBought", comment: "") } return shouldCheckIAPPurchaseSupport && !isSupportedIAPPurchase - ? NSLocalizedString("CourseInfoPurchaseModalPurchaseErrorUnsupportedCourseMessage", comment: "") + ? NSLocalizedString("CourseInfoPaymentsIAPUnsupported", comment: "") : nil }() diff --git a/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoHeaderView.swift b/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoHeaderView.swift index 291cce671e..82017bec1d 100644 --- a/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoHeaderView.swift +++ b/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoHeaderView.swift @@ -116,7 +116,11 @@ final class CourseInfoHeaderView: UIView { private lazy var titleView = CourseInfoHeaderTitleView() - private lazy var purchaseFeedbackView = QuizFeedbackView() + private lazy var purchaseFeedbackView: CourseInfoPurchaseFeedbackView = { + let view = CourseInfoPurchaseFeedbackView() + view.isHidden = true + return view + }() private lazy var contentStackView: UIStackView = { let stackView = UIStackView() @@ -245,10 +249,7 @@ final class CourseInfoHeaderView: UIView { if let purchaseFeedbackText = viewModel.purchaseFeedbackText { self.purchaseFeedbackView.isHidden = false - self.purchaseFeedbackView.update(state: .wrong, title: purchaseFeedbackText) - self.purchaseFeedbackView.setIconImage( - UIImage(named: "quiz-feedback-info")?.withRenderingMode(.alwaysTemplate) - ) + self.purchaseFeedbackView.set(title: purchaseFeedbackText) } else { self.purchaseFeedbackView.isHidden = true } diff --git a/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoPurchaseFeedbackView.swift b/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoPurchaseFeedbackView.swift new file mode 100644 index 0000000000..eab3dab4d4 --- /dev/null +++ b/Stepic/Sources/Modules/CourseInfo/Views/CourseInfoPurchaseFeedbackView.swift @@ -0,0 +1,105 @@ +import Atributika +import SnapKit +import UIKit + +extension CourseInfoPurchaseFeedbackView { + struct Appearance { + let tintColor = UIColor.white + let backgroundColor = UIColor.white.withAlphaComponent(0.12) + let cornerRadius: CGFloat = 6 + + let titleFont = UIFont.systemFont(ofSize: 16) + let titleMinHeight: CGFloat = 18 + let titleInsets = LayoutInsets.default + + let iconImageViewInsets = LayoutInsets(horizontal: 16) + let iconImageViewSize = CGSize(width: 24, height: 26) + } +} + +final class CourseInfoPurchaseFeedbackView: UIView { + let appearance: Appearance + + private lazy var htmlToAttributedStringConverter = HTMLToAttributedStringConverter(font: self.appearance.titleFont) + + private lazy var titleLabel: AttributedLabel = { + let label = AttributedLabel() + label.textColor = self.appearance.tintColor + label.font = self.appearance.titleFont + label.numberOfLines = 0 + return label + }() + + private lazy var iconImageView: UIImageView = { + let imageView = UIImageView( + image: UIImage(named: "quiz-feedback-info")?.withRenderingMode(.alwaysTemplate) + ) + imageView.contentMode = .scaleAspectFit + imageView.tintColor = self.appearance.tintColor + return imageView + }() + + override var intrinsicContentSize: CGSize { + let titleLabelHeight = self.titleLabel.sizeThatFits(CGSize(width: self.bounds.width, height: .infinity)).height + let height = self.appearance.titleInsets.top + + max(self.appearance.titleMinHeight, titleLabelHeight) + + self.appearance.titleInsets.bottom + return CGSize(width: UIView.noIntrinsicMetric, height: height) + } + + init(frame: CGRect = .zero, appearance: Appearance = Appearance()) { + self.appearance = appearance + super.init(frame: frame) + + self.setupView() + self.addSubviews() + self.makeConstraints() + } + + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func set(title: String) { + self.titleLabel.attributedText = self.htmlToAttributedStringConverter.convertToAttributedText(htmlString: title) + + self.titleLabel.sizeToFit() + self.titleLabel.setNeedsLayout() + + self.invalidateIntrinsicContentSize() + } +} + +extension CourseInfoPurchaseFeedbackView: ProgrammaticallyInitializableViewProtocol { + func setupView() { + self.backgroundColor = self.appearance.backgroundColor + + self.layer.cornerRadius = self.appearance.cornerRadius + self.layer.masksToBounds = true + self.clipsToBounds = true + } + + func addSubviews() { + self.addSubview(self.titleLabel) + self.addSubview(self.iconImageView) + } + + func makeConstraints() { + self.iconImageView.translatesAutoresizingMaskIntoConstraints = false + self.iconImageView.snp.makeConstraints { make in + make.leading.equalToSuperview().offset(self.appearance.iconImageViewInsets.left) + make.trailing.equalTo(self.titleLabel.snp.leading).offset(-self.appearance.iconImageViewInsets.right) + make.centerY.equalTo(self.titleLabel.snp.centerY) + make.size.equalTo(self.appearance.iconImageViewSize) + } + + self.titleLabel.translatesAutoresizingMaskIntoConstraints = false + self.titleLabel.snp.makeConstraints { make in + make.top.greaterThanOrEqualToSuperview().offset(self.appearance.titleInsets.top) + make.bottom.lessThanOrEqualToSuperview().offset(-self.appearance.titleInsets.bottom) + make.trailing.equalToSuperview().offset(-self.appearance.titleInsets.right) + make.centerY.equalToSuperview() + } + } +} diff --git a/Stepic/en.lproj/Localizable.strings b/Stepic/en.lproj/Localizable.strings index df5ca5312f..8f0a2a1357 100644 --- a/Stepic/en.lproj/Localizable.strings +++ b/Stepic/en.lproj/Localizable.strings @@ -487,7 +487,8 @@ CourseInfoRemoveFromWishlistFailureMessage = "Failed to Remove Course from Wishl CourseInfoPaymentsNotAvailableEnded = "Course ended on %@"; CourseInfoPaymentsNotAvailableEndedOther = "Course currently unavailable"; -CourseIntoPaymentsCantBeBought = "You cannot buy this course yet"; +CourseInfoPaymentsCantBeBought = "You cannot buy this course yet"; +CourseInfoPaymentsIAPUnsupported = "The course cannot be purchased in the mobile app yet. Add it to your Wishlist to come back later or be notified of the price drop."; CourseInfoRestorePurchaseTitle = "Restore Purchase"; CourseInfoRestorePurchaseSuccessMessage = "Purchase Successfully Restored"; diff --git a/Stepic/ru.lproj/Localizable.strings b/Stepic/ru.lproj/Localizable.strings index 31bca13de5..f349c1c33b 100644 --- a/Stepic/ru.lproj/Localizable.strings +++ b/Stepic/ru.lproj/Localizable.strings @@ -489,7 +489,8 @@ CourseInfoRemoveFromWishlistFailureMessage = "Не удалось убрать CourseInfoPaymentsNotAvailableEnded = "Курс закончился %@"; CourseInfoPaymentsNotAvailableEndedOther = "Курс сейчас недоступен"; -CourseIntoPaymentsCantBeBought = "Пока нельзя купить этот курс"; +CourseInfoPaymentsCantBeBought = "Пока нельзя купить этот курс"; +CourseInfoPaymentsIAPUnsupported = "Курс пока нельзя купить в мобильном приложении. Добавьте курс в Cписок желаний, чтобы вернуться к нему позже или узнать о снижении цены."; CourseInfoRestorePurchaseTitle = "Восстановить покупку"; CourseInfoRestorePurchaseSuccessMessage = "Покупка успешно восстановлена"; From 5d71518eeeb1809a2f7a37f322362b37942194e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 23:40:37 +0700 Subject: [PATCH 40/43] Bump activesupport from 6.1.5 to 6.1.7.3 (#1165) * Bump activesupport from 6.1.5 to 6.1.7.3 Bumps [activesupport](https://github.com/rails/rails) from 6.1.5 to 6.1.7.3. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.4.3/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v6.1.5...v6.1.7.3) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] * Bump Ruby from 2.6.5 to 3.2.1 * Run bundle update * Run bundle update --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Magda --- .ruby-version | 2 +- Gemfile.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.ruby-version b/.ruby-version index e4604e3afd..0444f32076 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.1 +3.2.1 \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 0c1fce0b35..08609515af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,12 +3,12 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (7.0.4.2) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.1) + addressable (2.8.2) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) @@ -16,8 +16,8 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.721.0) - aws-sdk-core (3.170.0) + aws-partitions (1.739.0) + aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -25,7 +25,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.119.1) + aws-sdk-s3 (1.120.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) @@ -167,7 +167,7 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.35.0) + google-apis-androidpublisher_v3 (0.38.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.0) addressable (~> 2.5, >= 2.5.1) @@ -198,7 +198,7 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.3.0) + googleauth (1.5.0) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -293,4 +293,4 @@ RUBY VERSION ruby 3.2.1p31 BUNDLED WITH - 2.4.7 + 2.4.10 From 41648b57e15e56900f532a74095fa5041a9212dd Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Mon, 3 Apr 2023 23:45:25 +0700 Subject: [PATCH 41/43] Update Swift language version --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index e4d41db984..3659ea2fa3 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.5.2 +5.8 From e9d2a1f45cbac859508c9019bd196fc30dc982a0 Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Tue, 4 Apr 2023 00:06:09 +0700 Subject: [PATCH 42/43] Bump build --- Stepic.xcodeproj/project.pbxproj | 24 +++++++++++----------- Stepic/Info-Develop.plist | 2 +- Stepic/Info-Production.plist | 2 +- Stepic/Info-Release.plist | 2 +- StepicTests/Info-Develop.plist | 2 +- StepicTests/Info-Production.plist | 2 +- StepicTests/Info-Release.plist | 2 +- StepicUITests/Info-Develop.plist | 2 +- StepicUITests/Info-Production.plist | 2 +- StepicUITests/Info-Release.plist | 2 +- StepicWidget/Info-Develop.plist | 2 +- StepicWidget/Info-Production.plist | 2 +- StepicWidget/Info-Release.plist | 2 +- StickerPackExtension/Info-Develop.plist | 2 +- StickerPackExtension/Info-Production.plist | 2 +- StickerPackExtension/Info-Release.plist | 2 +- 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index cda9411d9d..eb04c33cbb 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -13294,7 +13294,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; @@ -13319,7 +13319,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -13461,7 +13461,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Production.plist"; @@ -13491,7 +13491,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -13582,7 +13582,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13634,7 +13634,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; @@ -13715,7 +13715,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13763,7 +13763,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -14283,7 +14283,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14337,7 +14337,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; @@ -14419,7 +14419,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14467,7 +14467,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 431; + CURRENT_PROJECT_VERSION = 432; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; diff --git a/Stepic/Info-Develop.plist b/Stepic/Info-Develop.plist index dc323a135d..a208aa71a5 100644 --- a/Stepic/Info-Develop.plist +++ b/Stepic/Info-Develop.plist @@ -62,7 +62,7 @@ CFBundleVersion - 431 + 432 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Production.plist b/Stepic/Info-Production.plist index bc3ac3f201..b3a9ed6591 100644 --- a/Stepic/Info-Production.plist +++ b/Stepic/Info-Production.plist @@ -62,7 +62,7 @@ CFBundleVersion - 431 + 432 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Release.plist b/Stepic/Info-Release.plist index 042f86a291..cff8a372e2 100644 --- a/Stepic/Info-Release.plist +++ b/Stepic/Info-Release.plist @@ -62,7 +62,7 @@ CFBundleVersion - 431 + 432 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/StepicTests/Info-Develop.plist b/StepicTests/Info-Develop.plist index 5e06471c4a..1d022c9ee2 100644 --- a/StepicTests/Info-Develop.plist +++ b/StepicTests/Info-Develop.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 431 + 432 diff --git a/StepicTests/Info-Production.plist b/StepicTests/Info-Production.plist index d2187ccd0f..81b7e015f4 100644 --- a/StepicTests/Info-Production.plist +++ b/StepicTests/Info-Production.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 431 + 432 diff --git a/StepicTests/Info-Release.plist b/StepicTests/Info-Release.plist index 4df74b4ad6..3219e24a16 100644 --- a/StepicTests/Info-Release.plist +++ b/StepicTests/Info-Release.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 431 + 432 diff --git a/StepicUITests/Info-Develop.plist b/StepicUITests/Info-Develop.plist index f1120459bc..0ec59ca193 100644 --- a/StepicUITests/Info-Develop.plist +++ b/StepicUITests/Info-Develop.plist @@ -17,6 +17,6 @@ CFBundleShortVersionString 1.218-develop CFBundleVersion - 431 + 432 diff --git a/StepicUITests/Info-Production.plist b/StepicUITests/Info-Production.plist index 6a6110b648..2725f77a30 100644 --- a/StepicUITests/Info-Production.plist +++ b/StepicUITests/Info-Production.plist @@ -17,6 +17,6 @@ CFBundleShortVersionString 1.218 CFBundleVersion - 431 + 432 diff --git a/StepicUITests/Info-Release.plist b/StepicUITests/Info-Release.plist index 80db501a2d..be3833f798 100644 --- a/StepicUITests/Info-Release.plist +++ b/StepicUITests/Info-Release.plist @@ -17,6 +17,6 @@ CFBundleShortVersionString 1.218-release CFBundleVersion - 431 + 432 diff --git a/StepicWidget/Info-Develop.plist b/StepicWidget/Info-Develop.plist index 4e2901594d..6a345568ed 100644 --- a/StepicWidget/Info-Develop.plist +++ b/StepicWidget/Info-Develop.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-develop CFBundleVersion - 431 + 432 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Production.plist b/StepicWidget/Info-Production.plist index 61f7e167a5..f2ff512ff6 100644 --- a/StepicWidget/Info-Production.plist +++ b/StepicWidget/Info-Production.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218 CFBundleVersion - 431 + 432 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Release.plist b/StepicWidget/Info-Release.plist index e97efb87f0..632d42a24c 100644 --- a/StepicWidget/Info-Release.plist +++ b/StepicWidget/Info-Release.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-release CFBundleVersion - 431 + 432 NSExtension NSExtensionPointIdentifier diff --git a/StickerPackExtension/Info-Develop.plist b/StickerPackExtension/Info-Develop.plist index 50d7915dde..e2a83b23f7 100644 --- a/StickerPackExtension/Info-Develop.plist +++ b/StickerPackExtension/Info-Develop.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-develop CFBundleVersion - 431 + 432 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Production.plist b/StickerPackExtension/Info-Production.plist index 373d8c51a1..bc2612cfc7 100644 --- a/StickerPackExtension/Info-Production.plist +++ b/StickerPackExtension/Info-Production.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218 CFBundleVersion - 431 + 432 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Release.plist b/StickerPackExtension/Info-Release.plist index e7947b9e1d..9fdf7de5fe 100644 --- a/StickerPackExtension/Info-Release.plist +++ b/StickerPackExtension/Info-Release.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.218-release CFBundleVersion - 431 + 432 UIRequiredDeviceCapabilities arm64 From 56e3c9fcaebfc2e242c7edd24f02c848c2972a9e Mon Sep 17 00:00:00 2001 From: Ivan Magda Date: Tue, 4 Apr 2023 00:23:22 +0700 Subject: [PATCH 43/43] Update cocoapods --- Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile.lock b/Podfile.lock index 9580683ef1..1788a66dc8 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -425,4 +425,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 75718f193cfc7924dbc1854e38c62a6d03cc46c6 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.0