From 726598069a136fd8cf09abed744e8731549d3061 Mon Sep 17 00:00:00 2001 From: Eugene Fozekosh Date: Thu, 11 Apr 2024 14:00:50 +0300 Subject: [PATCH 1/2] point Texture to the latest master fixes + LessonController improvements --- Podfile | 3 +- Podfile.lock | 15 ++- Sabbath School.xcodeproj/project.pbxproj | 114 +++++++++--------- Sabbath School/Common/Extensions/Image.swift | 4 + .../Lesson/Controller/LessonController.swift | 76 ++++++------ 5 files changed, 115 insertions(+), 97 deletions(-) diff --git a/Podfile b/Podfile index cede8b52..6916f207 100644 --- a/Podfile +++ b/Podfile @@ -16,7 +16,8 @@ target 'Sabbath School' do pod 'SwiftEntryKit' pod 'SwiftMessages' pod 'SwiftDate' - pod 'Texture' + pod 'Texture', :git => 'https://github.com/TextureGroup/Texture.git', :branch => 'master' + pod 'Zip' pod 'Wormholy', :configurations => ['Debug'] end diff --git a/Podfile.lock b/Podfile.lock index dd35ba5c..09f64461 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -86,7 +86,7 @@ DEPENDENCIES: - SwiftDate - SwiftEntryKit - SwiftMessages - - Texture + - Texture (from `https://github.com/TextureGroup/Texture.git`, branch `master`) - Wormholy - Zip @@ -113,13 +113,20 @@ SPEC REPOS: - SwiftDate - SwiftEntryKit - SwiftMessages - - Texture - Wormholy - Zip EXTERNAL SOURCES: PSPDFKit: :podspec: https://customers.pspdfkit.com/pspdfkit-ios/10.4.2.podspec + Texture: + :branch: master + :git: https://github.com/TextureGroup/Texture.git + +CHECKOUT OPTIONS: + Texture: + :commit: 923901a1cebf0b6c51627aca2a6748dee84af143 + :git: https://github.com/TextureGroup/Texture.git SPEC CHECKSUMS: AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7 @@ -148,6 +155,6 @@ SPEC CHECKSUMS: Wormholy: 3252bc3e55a1847ef9a0976c1377bd77bf3635fa Zip: 414f59909701fda9a84ab774ebe0f5449b1082cc -PODFILE CHECKSUM: c5f23ca7fa97a774176c6348f848720dad6f29ef +PODFILE CHECKSUM: 1083c154ae12e46b55478ceb07886977f2d96412 -COCOAPODS: 1.15.0 +COCOAPODS: 1.15.2 diff --git a/Sabbath School.xcodeproj/project.pbxproj b/Sabbath School.xcodeproj/project.pbxproj index 1bed368a..0fe540b8 100644 --- a/Sabbath School.xcodeproj/project.pbxproj +++ b/Sabbath School.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1A43D7801EF8BABD00D6A639 /* SnapshotUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A43D77F1EF8BABD00D6A639 /* SnapshotUITests.swift */; }; 1A43D7881EF8C48B00D6A639 /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A43D7871EF8C48B00D6A639 /* SnapshotHelper.swift */; }; + 2A8E4A6ACD4052E52188A566 /* Pods_Sabbath_School.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9539E61BEEC72B127723245 /* Pods_Sabbath_School.framework */; }; 2F487E8126D8567300B4AA7A /* VideoPlaybackRateButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F487E8026D8567300B4AA7A /* VideoPlaybackRateButton.swift */; }; 2F487E8B26D87A5E00B4AA7A /* PDFController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F487E8A26D87A5E00B4AA7A /* PDFController.swift */; }; 2F487E8F26DC80F300B4AA7A /* ReadMenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F487E8E26DC80F300B4AA7A /* ReadMenuController.swift */; }; @@ -63,7 +64,7 @@ 2FC6F69E27A8E35C00BBC4A9 /* APICache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC6F69D27A8E35C00BBC4A9 /* APICache.swift */; }; 2FC6F69F27A8E35C00BBC4A9 /* APICache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC6F69D27A8E35C00BBC4A9 /* APICache.swift */; }; 2FE24EFD26BB90170036FD75 /* AudioController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE24EFC26BB90170036FD75 /* AudioController.swift */; }; - 3DDC3D2AB9F67FC70562F316 /* Pods_WidgetExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDEA0CA8DEEB383392D21EE1 /* Pods_WidgetExtension.framework */; }; + 44F42BD67818F032A1C862E3 /* Pods_WidgetExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 409B5B73C5388ECFA0B0538E /* Pods_WidgetExtension.framework */; }; 4E149B712814CCCE0014A070 /* Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7B098B2814CA8A00687C33 /* Comparable.swift */; }; 4E149B722814CCDE0014A070 /* Encodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7B09882814CA3D00687C33 /* Encodable.swift */; }; 4E2882CA280CCB7000AB8C31 /* PublishingInfoData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E2882C9280CCB7000AB8C31 /* PublishingInfoData.swift */; }; @@ -206,8 +207,7 @@ 7AF371611EF9CB5A00547916 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7AF3715F1EF9CB5A00547916 /* InfoPlist.strings */; }; 7AF3716C1EF9E6EC00547916 /* AboutController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF3716B1EF9E6EC00547916 /* AboutController.swift */; }; 7AF3716E1EF9E6FF00547916 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF3716D1EF9E6FF00547916 /* AboutView.swift */; }; - CCE50F0449C65DA9670BF26D /* Pods_Sabbath_School.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE3C632E5F9AA2671315C637 /* Pods_Sabbath_School.framework */; }; - F9E3440F8274F03CD9616C93 /* Pods_SnapshotUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0062CE9270231E032A0CDBA1 /* Pods_SnapshotUITests.framework */; }; + AA94D333D9D7759075506DD5 /* Pods_SnapshotUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3507CF23E74AC140B0B81EBD /* Pods_SnapshotUITests.framework */; }; FE0249EA2669C2E3006BFADC /* Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0249E92669C2E3006BFADC /* Helper.swift */; }; FE0249F8266A9068006BFADC /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0249F7266A9068006BFADC /* Configuration.swift */; }; FE0249FE266A91C9006BFADC /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0249FD266A91C9006BFADC /* Notifications.swift */; }; @@ -314,14 +314,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0062CE9270231E032A0CDBA1 /* Pods_SnapshotUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnapshotUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1A43D77D1EF8BABD00D6A639 /* SnapshotUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SnapshotUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 1A43D77F1EF8BABD00D6A639 /* SnapshotUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnapshotUITests.swift; sourceTree = ""; }; 1A43D7811EF8BABD00D6A639 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1A43D7871EF8C48B00D6A639 /* SnapshotHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnapshotHelper.swift; sourceTree = ""; }; 1BDC817E4DEE5647231E268B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 1BDC81CE3CAC580E4EC0FB13 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = ""; }; - 2AE4CFA0F070E8924C3095AD /* Pods-SnapshotUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnapshotUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnapshotUITests/Pods-SnapshotUITests.debug.xcconfig"; sourceTree = ""; }; 2F487E8026D8567300B4AA7A /* VideoPlaybackRateButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPlaybackRateButton.swift; sourceTree = ""; }; 2F487E8226D879D100B4AA7A /* PSPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = PSPDFKit.xcframework; sourceTree = ""; }; 2F487E8326D879D100B4AA7A /* PSPDFKitUI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = PSPDFKitUI.xcframework; sourceTree = ""; }; @@ -371,8 +369,11 @@ 2FC6F69A27A8E0FA00BBC4A9 /* API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; 2FC6F69D27A8E35C00BBC4A9 /* APICache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APICache.swift; sourceTree = ""; }; 2FE24EFC26BB90170036FD75 /* AudioController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioController.swift; sourceTree = ""; }; - 33A1833F54A1D35D2D3B68FC /* Pods-Sabbath School.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sabbath School.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sabbath School/Pods-Sabbath School.release.xcconfig"; sourceTree = ""; }; - 44E5FA6B2654B5A0A51181F5 /* Pods-Sabbath School.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sabbath School.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sabbath School/Pods-Sabbath School.debug.xcconfig"; sourceTree = ""; }; + 3507CF23E74AC140B0B81EBD /* Pods_SnapshotUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnapshotUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 363BDFBBCA390FCFFE6616D5 /* Pods-SnapshotUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnapshotUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnapshotUITests/Pods-SnapshotUITests.release.xcconfig"; sourceTree = ""; }; + 3653664986DDFB50AC3B917B /* Pods-WidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WidgetExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WidgetExtension/Pods-WidgetExtension.debug.xcconfig"; sourceTree = ""; }; + 3F4AE71B119E4E74F7E63CD8 /* Pods-Sabbath School.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sabbath School.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sabbath School/Pods-Sabbath School.release.xcconfig"; sourceTree = ""; }; + 409B5B73C5388ECFA0B0538E /* Pods_WidgetExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WidgetExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4E2882C9280CCB7000AB8C31 /* PublishingInfoData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishingInfoData.swift; sourceTree = ""; }; 4E2882CB280CCBB600AB8C31 /* PublishingInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishingInfo.swift; sourceTree = ""; }; 4E2882CD280CE46000AB8C31 /* PublishingInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishingInfoView.swift; sourceTree = ""; }; @@ -432,8 +433,6 @@ 4EDDA4E22A83B8F70078B29E /* SabbathSchoolTVUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SabbathSchoolTVUITestsLaunchTests.swift; sourceTree = ""; }; 4EE2DF0727DA7AFC00812552 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; 4EE8B6F4284D1FAA003C1A46 /* NotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationCenter.swift; sourceTree = ""; }; - 5A51BC726313000839EA7865 /* Pods-WidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WidgetExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-WidgetExtension/Pods-WidgetExtension.release.xcconfig"; sourceTree = ""; }; - 65B94D25F690F7C382F6C186 /* Pods-SnapshotUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnapshotUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnapshotUITests/Pods-SnapshotUITests.release.xcconfig"; sourceTree = ""; }; 7A280F771ED7CF05003C7458 /* LoginWireFrame.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginWireFrame.swift; sourceTree = ""; }; 7A280F791ED7CF2C003C7458 /* LoginView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; 7A280F841ED7D6B6003C7458 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -558,9 +557,10 @@ 7AF3716A1EF9CB7100547916 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InfoPlist.strings; sourceTree = ""; }; 7AF3716B1EF9E6EC00547916 /* AboutController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutController.swift; sourceTree = ""; }; 7AF3716D1EF9E6FF00547916 /* AboutView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = ""; }; - 8A9E98DA874C45C84F5492F2 /* Pods-WidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WidgetExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WidgetExtension/Pods-WidgetExtension.debug.xcconfig"; sourceTree = ""; }; - CE3C632E5F9AA2671315C637 /* Pods_Sabbath_School.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sabbath_School.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EDEA0CA8DEEB383392D21EE1 /* Pods_WidgetExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WidgetExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8875F32FDAE0121349EE0A37 /* Pods-WidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WidgetExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-WidgetExtension/Pods-WidgetExtension.release.xcconfig"; sourceTree = ""; }; + 933858DCED8C4612BB78B07A /* Pods-Sabbath School.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sabbath School.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sabbath School/Pods-Sabbath School.debug.xcconfig"; sourceTree = ""; }; + AF57639522EFECD80011787B /* Pods-SnapshotUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnapshotUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnapshotUITests/Pods-SnapshotUITests.debug.xcconfig"; sourceTree = ""; }; + B9539E61BEEC72B127723245 /* Pods_Sabbath_School.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sabbath_School.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FE002A5B200C89D6009CE4DF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; }; FE002A5C200C89D6009CE4DF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; FE002A5D200C89F3009CE4DF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -674,7 +674,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F9E3440F8274F03CD9616C93 /* Pods_SnapshotUITests.framework in Frameworks */, + AA94D333D9D7759075506DD5 /* Pods_SnapshotUITests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -707,8 +707,8 @@ buildActionMask = 2147483647; files = ( 4E58E7972B4B48CA004B5D64 /* Cache in Frameworks */, - CCE50F0449C65DA9670BF26D /* Pods_Sabbath_School.framework in Frameworks */, 4E860A452B4B461200749BC3 /* Alamofire in Frameworks */, + 2A8E4A6ACD4052E52188A566 /* Pods_Sabbath_School.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -719,8 +719,8 @@ FE1E35002673C5DF00DAC2D6 /* SwiftUI.framework in Frameworks */, 4E860A472B4B461D00749BC3 /* Alamofire in Frameworks */, FE1E34FE2673C5DF00DAC2D6 /* WidgetKit.framework in Frameworks */, - 3DDC3D2AB9F67FC70562F316 /* Pods_WidgetExtension.framework in Frameworks */, 4E58E7992B4B48D4004B5D64 /* Cache in Frameworks */, + 44F42BD67818F032A1C862E3 /* Pods_WidgetExtension.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1591,12 +1591,12 @@ isa = PBXGroup; children = ( 7AC26AE11EE48925003F946C /* Fastlane */, - 44E5FA6B2654B5A0A51181F5 /* Pods-Sabbath School.debug.xcconfig */, - 33A1833F54A1D35D2D3B68FC /* Pods-Sabbath School.release.xcconfig */, - 2AE4CFA0F070E8924C3095AD /* Pods-SnapshotUITests.debug.xcconfig */, - 65B94D25F690F7C382F6C186 /* Pods-SnapshotUITests.release.xcconfig */, - 8A9E98DA874C45C84F5492F2 /* Pods-WidgetExtension.debug.xcconfig */, - 5A51BC726313000839EA7865 /* Pods-WidgetExtension.release.xcconfig */, + 933858DCED8C4612BB78B07A /* Pods-Sabbath School.debug.xcconfig */, + 3F4AE71B119E4E74F7E63CD8 /* Pods-Sabbath School.release.xcconfig */, + AF57639522EFECD80011787B /* Pods-SnapshotUITests.debug.xcconfig */, + 363BDFBBCA390FCFFE6616D5 /* Pods-SnapshotUITests.release.xcconfig */, + 3653664986DDFB50AC3B917B /* Pods-WidgetExtension.debug.xcconfig */, + 8875F32FDAE0121349EE0A37 /* Pods-WidgetExtension.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -1611,9 +1611,9 @@ FEE3024224730E8000A71314 /* MenuItemKit.framework */, FE1E34FD2673C5DF00DAC2D6 /* WidgetKit.framework */, FE1E34FF2673C5DF00DAC2D6 /* SwiftUI.framework */, - CE3C632E5F9AA2671315C637 /* Pods_Sabbath_School.framework */, - 0062CE9270231E032A0CDBA1 /* Pods_SnapshotUITests.framework */, - EDEA0CA8DEEB383392D21EE1 /* Pods_WidgetExtension.framework */, + B9539E61BEEC72B127723245 /* Pods_Sabbath_School.framework */, + 3507CF23E74AC140B0B81EBD /* Pods_SnapshotUITests.framework */, + 409B5B73C5388ECFA0B0538E /* Pods_WidgetExtension.framework */, ); name = Frameworks; sourceTree = ""; @@ -1673,11 +1673,11 @@ isa = PBXNativeTarget; buildConfigurationList = 1A43D7861EF8BABD00D6A639 /* Build configuration list for PBXNativeTarget "SnapshotUITests" */; buildPhases = ( - 34887B7D0A9012ED2D784DA4 /* [CP] Check Pods Manifest.lock */, + D84F73F975E2FEA93BAAB36D /* [CP] Check Pods Manifest.lock */, 1A43D7791EF8BABD00D6A639 /* Sources */, 1A43D77A1EF8BABD00D6A639 /* Frameworks */, 1A43D77B1EF8BABD00D6A639 /* Resources */, - 620D92872913E1067066C46D /* [CP] Embed Pods Frameworks */, + 9CE8DBF2A4DBB56CE3094090 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -1749,13 +1749,13 @@ isa = PBXNativeTarget; buildConfigurationList = 7AF191BA1ED7B89B000CCF0C /* Build configuration list for PBXNativeTarget "Sabbath School" */; buildPhases = ( - 6FBEF8CE6791655426904A80 /* [CP] Check Pods Manifest.lock */, + 2DC53C2AA936625F90A785BF /* [CP] Check Pods Manifest.lock */, 7A280F951ED94883003C7458 /* R.swift */, 7AF191A41ED7B89B000CCF0C /* Sources */, 7AF191A51ED7B89B000CCF0C /* Frameworks */, 7AF191A61ED7B89B000CCF0C /* Resources */, FE1E350D2673C5E400DAC2D6 /* Embed App Extensions */, - 2CC4038581AE3EC3C74812B1 /* [CP] Embed Pods Frameworks */, + 1D12A69D7E8D1A692F87A628 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -1775,7 +1775,7 @@ isa = PBXNativeTarget; buildConfigurationList = FE1E350A2673C5E400DAC2D6 /* Build configuration list for PBXNativeTarget "WidgetExtension" */; buildPhases = ( - 57B7D25E5D4AB86CA3D546CD /* [CP] Check Pods Manifest.lock */, + D6674F819C74B808FB056C9C /* [CP] Check Pods Manifest.lock */, FE1E34F82673C5DF00DAC2D6 /* Sources */, FE1E34F92673C5DF00DAC2D6 /* Frameworks */, FE1E34FA2673C5DF00DAC2D6 /* Resources */, @@ -1984,7 +1984,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2CC4038581AE3EC3C74812B1 /* [CP] Embed Pods Frameworks */ = { + 1D12A69D7E8D1A692F87A628 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2048,7 +2048,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sabbath School/Pods-Sabbath School-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 34887B7D0A9012ED2D784DA4 /* [CP] Check Pods Manifest.lock */ = { + 2DC53C2AA936625F90A785BF /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2063,36 +2063,30 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SnapshotUITests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Sabbath School-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 57B7D25E5D4AB86CA3D546CD /* [CP] Check Pods Manifest.lock */ = { + 7A280F951ED94883003C7458 /* R.swift */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "$TEMP_DIR/rswift-lastrun", ); + name = R.swift; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-WidgetExtension-checkManifestLockResult.txt", + "$SRCROOT/R.generated.swift", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "\"$PODS_ROOT/R.swift/rswift\" generate \"$SRCROOT/R.generated.swift\"\n"; }; - 620D92872913E1067066C46D /* [CP] Embed Pods Frameworks */ = { + 9CE8DBF2A4DBB56CE3094090 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2110,7 +2104,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SnapshotUITests/Pods-SnapshotUITests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 6FBEF8CE6791655426904A80 /* [CP] Check Pods Manifest.lock */ = { + D6674F819C74B808FB056C9C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2125,28 +2119,34 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Sabbath School-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-WidgetExtension-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 7A280F951ED94883003C7458 /* R.swift */ = { + D84F73F975E2FEA93BAAB36D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "$TEMP_DIR/rswift-lastrun", + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = R.swift; outputPaths = ( - $SRCROOT/R.generated.swift, + "$(DERIVED_FILE_DIR)/Pods-SnapshotUITests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$PODS_ROOT/R.swift/rswift\" generate \"$SRCROOT/R.generated.swift\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -2594,7 +2594,7 @@ /* Begin XCBuildConfiguration section */ 1A43D7841EF8BABD00D6A639 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2AE4CFA0F070E8924C3095AD /* Pods-SnapshotUITests.debug.xcconfig */; + baseConfigurationReference = AF57639522EFECD80011787B /* Pods-SnapshotUITests.debug.xcconfig */; buildSettings = { DEVELOPMENT_TEAM = BB84388PVM; INFOPLIST_FILE = SnapshotUITests/Info.plist; @@ -2615,7 +2615,7 @@ }; 1A43D7851EF8BABD00D6A639 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 65B94D25F690F7C382F6C186 /* Pods-SnapshotUITests.release.xcconfig */; + baseConfigurationReference = 363BDFBBCA390FCFFE6616D5 /* Pods-SnapshotUITests.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = BB84388PVM; @@ -2936,7 +2936,7 @@ }; 7AF191BB1ED7B89B000CCF0C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 44E5FA6B2654B5A0A51181F5 /* Pods-Sabbath School.debug.xcconfig */; + baseConfigurationReference = 933858DCED8C4612BB78B07A /* Pods-Sabbath School.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "Sabbath School/Resources/Sabbath School.entitlements"; @@ -3078,7 +3078,7 @@ }; 7AF191BC1ED7B89B000CCF0C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 33A1833F54A1D35D2D3B68FC /* Pods-Sabbath School.release.xcconfig */; + baseConfigurationReference = 3F4AE71B119E4E74F7E63CD8 /* Pods-Sabbath School.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "Sabbath School/Resources/Sabbath School.entitlements"; @@ -3219,7 +3219,7 @@ }; FE1E350B2673C5E400DAC2D6 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8A9E98DA874C45C84F5492F2 /* Pods-WidgetExtension.debug.xcconfig */; + baseConfigurationReference = 3653664986DDFB50AC3B917B /* Pods-WidgetExtension.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; @@ -3268,7 +3268,7 @@ }; FE1E350C2673C5E400DAC2D6 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5A51BC726313000839EA7865 /* Pods-WidgetExtension.release.xcconfig */; + baseConfigurationReference = 8875F32FDAE0121349EE0A37 /* Pods-WidgetExtension.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; diff --git a/Sabbath School/Common/Extensions/Image.swift b/Sabbath School/Common/Extensions/Image.swift index 470fbe5a..0b697f39 100644 --- a/Sabbath School/Common/Extensions/Image.swift +++ b/Sabbath School/Common/Extensions/Image.swift @@ -24,6 +24,7 @@ import UIKit extension UIImage { func imageTintColor(_ tintColor: UIColor) -> UIImage { + if (size.width == 0 || size.height == 0) { return UIImage() } UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale) let context = UIGraphicsGetCurrentContext()! as CGContext @@ -44,6 +45,7 @@ extension UIImage { class func imageWithColor(_ color: UIColor?, width: CGFloat = 1.0, height: CGFloat = 1.0) -> UIImage! { let rect = CGRect(x: 0.0, y: 0.0, width: width, height: height) + if (rect.size.width == 0 || rect.size.height == 0) { return UIImage() } UIGraphicsBeginImageContextWithOptions(rect.size, false, 0) let context = UIGraphicsGetCurrentContext() @@ -61,6 +63,7 @@ extension UIImage { } class func imageWithView(_ view: UIView) -> UIImage { + if (view.bounds.size.width == 0 || view.bounds.size.height == 0) { return UIImage() } UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.isOpaque, 0.0) view.drawHierarchy(in: view.bounds, afterScreenUpdates: true) @@ -114,6 +117,7 @@ extension UIImage { private func modifiedImage( draw: (CGContext, CGRect) -> Void) -> UIImage { // using scale correctly preserves retina images + if (size.width == 0 || size.height == 0) { return UIImage() } UIGraphicsBeginImageContextWithOptions(size, false, scale) let context: CGContext! = UIGraphicsGetCurrentContext() assert(context != nil) diff --git a/Sabbath School/Lesson/Controller/LessonController.swift b/Sabbath School/Lesson/Controller/LessonController.swift index c0c09e4c..2cee02b8 100644 --- a/Sabbath School/Lesson/Controller/LessonController.swift +++ b/Sabbath School/Lesson/Controller/LessonController.swift @@ -36,9 +36,10 @@ enum LessonControllerSections: Int { } final class LessonController: ASDKViewController { - var tableNode: ASTableNode? { return node as? ASTableNode } - - var delegate: LessonControllerDelegate? + var tableNode: ASTableNode { + return node as! ASTableNode + } + weak var delegate: LessonControllerDelegate? var presenter: LessonPresenterProtocol? var dataSource: QuarterlyInfo? private var publishingInfo: PublishingInfo? @@ -51,54 +52,58 @@ final class LessonController: ASDKViewController { override init() { super.init(node: ASTableNode()) - tableNode?.delegate = self - tableNode?.dataSource = self - navigationController?.delegate = self + commonInit() + } + + private func commonInit() { + tableNode.delegate = self + tableNode.dataSource = self } required init?(coder aDecoder: NSCoder) { fatalError("storyboards are incompatible with truth and beauty") } + deinit { + NotificationCenter.default.removeObserver(self) + } + override func viewDidLoad() { super.viewDidLoad() - navigationController?.delegate = self - - self.tableNode?.allowsSelection = false - - tableNode?.view.contentInsetAdjustmentBehavior = .never - + tableNode.allowsSelection = false + tableNode.view.contentInsetAdjustmentBehavior = .never presenter?.configure() Armchair.userDidSignificantEvent(true) if #available(iOS 13, *) {} else { - if self.traitCollection.forceTouchCapability == .available, let view = tableNode?.view { - registerForPreviewing(with: self, sourceView: view) + if self.traitCollection.forceTouchCapability == .available { + registerForPreviewing(with: self, sourceView: tableNode.view) } } setupNavigationbar() - self.tableNode?.backgroundColor = AppStyle.Lesson.Color.backgroundFooter + tableNode.backgroundColor = AppStyle.Lesson.Color.backgroundFooter } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - if let selected = tableNode?.indexPathForSelectedRow { - tableNode?.view.deselectRow(at: selected, animated: true) + if let selected = tableNode.indexPathForSelectedRow { + tableNode.view.deselectRow(at: selected, animated: true) } - self.setupNavigationbar() + navigationController?.delegate = self + setupNavigationbar() } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() - self.tableNode?.view.separatorColor = AppStyle.Base.Color.tableSeparator + tableNode.view.separatorColor = AppStyle.Base.Color.tableSeparator } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if #available(iOS 13.0, *) { if UIApplication.shared.applicationState != .background && self.traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { - tableNode?.reloadData() + tableNode.reloadData() } } } @@ -218,13 +223,13 @@ final class LessonController: ASDKViewController { } func parallax(scrollView: UIScrollView) { - if let coverHeader = self.tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfoSplashView { + if let coverHeader = tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfoSplashView { let scrollOffset = scrollView.contentOffset.y if scrollOffset >= 0 { coverHeader.coverImage.frame.origin.y = scrollOffset / 2 } else { - if let cellHeader = self.tableNode?.cellForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) { + if let cellHeader = tableNode.cellForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) { cellHeader.frame.origin.y = scrollOffset-1 cellHeader.frame.size.height = coverHeader.initialCoverHeight + (-scrollOffset) coverHeader.frame.size.height = coverHeader.initialCoverHeight + (-scrollOffset) @@ -244,7 +249,7 @@ final class LessonController: ASDKViewController { if dataSource.lessons.count <= 0 { return } } - let titleOrigin = (self.tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.lessons.rawValue)) as! LessonView).view.rectCorrespondingToWindow + let titleOrigin = (tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.lessons.rawValue)) as! LessonView).view.rectCorrespondingToWindow guard let navigationBarMaxY = self.navigationController?.navigationBar.rectCorrespondingToWindow.maxY else { return } var navBarAlpha: CGFloat = (initialOffset - (titleOrigin.minY + mn - navigationBarMaxY)) / initialOffset @@ -272,7 +277,7 @@ final class LessonController: ASDKViewController { override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - self.tableNode?.reloadData() + tableNode.reloadData() } @available(iOS 13.0, *) @@ -282,7 +287,7 @@ final class LessonController: ASDKViewController { guard let readController = self.getReadControllerForPeek(indexPath: indexPath, point: point) else { return nil } return readController }, actionProvider: { suggestedActions in - let imageView = (self.tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as! LessonQuarterlyInfo).coverImage.image! + let imageView = (self.tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as! LessonQuarterlyInfo).coverImage.image! let lesson: Lesson = (self.dataSource?.lessons[indexPath.row])! let share = UIAction(title: "Share".localized(), image: UIImage(systemName: "square.and.arrow.up")) { action in let objectToShare = ShareItem(title: lesson.title, subtitle: lesson.dateRange, url: lesson.webURL, image: imageView) @@ -371,7 +376,7 @@ extension LessonController: LessonControllerProtocol { } func setReadViewState(_ state: ReadButtonState) { - if let coverHeader = self.tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfo { + if let coverHeader = tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfo { coverHeader.readView.setState(state) } } @@ -391,8 +396,8 @@ extension LessonController: LessonControllerProtocol { func showLessons(quarterlyInfo: QuarterlyInfo) { self.dataSource = quarterlyInfo - self.tableNode?.allowsSelection = true - self.tableNode?.reloadData() + tableNode.allowsSelection = true + tableNode.reloadData() self.title = quarterlyInfo.quarterly.title @@ -412,7 +417,7 @@ extension LessonController: LessonControllerProtocol { func showPublishingInfo(publishingInfo: PublishingInfo?) { self.publishingInfo = publishingInfo - tableNode?.reloadSections(IndexSet(integer: LessonControllerSections.publishingInfo.rawValue), with: .automatic) + tableNode.reloadSections(IndexSet(integer: LessonControllerSections.publishingInfo.rawValue), with: .automatic) } } @@ -425,12 +430,12 @@ extension LessonController: UIViewControllerPreviewingDelegate { } func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { - guard let indexPath = tableNode?.indexPathForRow(at: location) else { return nil } + guard let indexPath = tableNode.indexPathForRow(at: location) else { return nil } if indexPath.section > LessonControllerSections.lessons.rawValue { return nil } - guard let cell = tableNode?.cellForRow(at: indexPath) else { return nil } + guard let cell = tableNode.cellForRow(at: indexPath) else { return nil } let readController = getReadControllerForPeek(indexPath: indexPath, point: location) - previewingContext.sourceRect = (tableNode?.convert(cell.frame, to: tableNode))! + previewingContext.sourceRect = (tableNode.convert(cell.frame, to: tableNode)) return readController } @@ -541,9 +546,10 @@ extension LessonController: ASTableDataSource { // MARK: Setup Observers extension LessonController { private func setupObservers() { - if let quarterlyIndex = dataSource?.quarterly.index { - let notificationName = Notification.Name(Constants.DownloadQuarterly.quarterlyDownloadStatus(quarterlyIndex: quarterlyIndex)) - NotificationCenter.default.addObserver(self, selector: #selector(updateQuarterlyDownloadState), name: notificationName, object: nil) + guard let quarterlyIndex = dataSource?.quarterly.index else { return } + let notificationName = Notification.Name(Constants.DownloadQuarterly.quarterlyDownloadStatus(quarterlyIndex: quarterlyIndex)) + NotificationCenter.default.addObserver(forName: notificationName, object: nil, queue: .main) { [weak self] notification in + self?.updateQuarterlyDownloadState(notification: notification) } } From 771279299df9a600aa0591a7f5d961b6455a6905 Mon Sep 17 00:00:00 2001 From: Eugene Fozekosh Date: Thu, 25 Apr 2024 11:09:49 +0300 Subject: [PATCH 2/2] code review changes --- Sabbath School.xcodeproj/project.pbxproj | 10 ++-- .../Lesson/Controller/LessonController.swift | 59 ++++++++++--------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Sabbath School.xcodeproj/project.pbxproj b/Sabbath School.xcodeproj/project.pbxproj index 0fe540b8..e6f19bf5 100644 --- a/Sabbath School.xcodeproj/project.pbxproj +++ b/Sabbath School.xcodeproj/project.pbxproj @@ -2080,7 +2080,7 @@ ); name = R.swift; outputPaths = ( - "$SRCROOT/R.generated.swift", + $SRCROOT/R.generated.swift, ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -2943,7 +2943,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = XVGX5G4YQ9; @@ -2958,7 +2958,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 3.5.0; + MARKETING_VERSION = 3.5.1; OTHER_LDFLAGS = ( "$(inherited)", "-l\"c++\"", @@ -3085,7 +3085,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = XVGX5G4YQ9; ENABLE_BITCODE = NO; @@ -3099,7 +3099,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 3.5.0; + MARKETING_VERSION = 3.5.1; OTHER_LDFLAGS = ( "$(inherited)", "-l\"c++\"", diff --git a/Sabbath School/Lesson/Controller/LessonController.swift b/Sabbath School/Lesson/Controller/LessonController.swift index 2cee02b8..8484a7c8 100644 --- a/Sabbath School/Lesson/Controller/LessonController.swift +++ b/Sabbath School/Lesson/Controller/LessonController.swift @@ -36,9 +36,8 @@ enum LessonControllerSections: Int { } final class LessonController: ASDKViewController { - var tableNode: ASTableNode { - return node as! ASTableNode - } + var tableNode: ASTableNode? { return node as? ASTableNode } + weak var delegate: LessonControllerDelegate? var presenter: LessonPresenterProtocol? var dataSource: QuarterlyInfo? @@ -56,8 +55,8 @@ final class LessonController: ASDKViewController { } private func commonInit() { - tableNode.delegate = self - tableNode.dataSource = self + tableNode?.delegate = self + tableNode?.dataSource = self } required init?(coder aDecoder: NSCoder) { @@ -70,25 +69,27 @@ final class LessonController: ASDKViewController { override func viewDidLoad() { super.viewDidLoad() - tableNode.allowsSelection = false - tableNode.view.contentInsetAdjustmentBehavior = .never + tableNode?.allowsSelection = false + tableNode?.view.contentInsetAdjustmentBehavior = .never presenter?.configure() Armchair.userDidSignificantEvent(true) - + setupNavigationbar() + tableNode?.backgroundColor = AppStyle.Lesson.Color.backgroundFooter if #available(iOS 13, *) {} else { if self.traitCollection.forceTouchCapability == .available { - registerForPreviewing(with: self, sourceView: tableNode.view) + guard let tableview = tableNode else { + return + } + registerForPreviewing(with: self, sourceView: tableview.view) } } - setupNavigationbar() - tableNode.backgroundColor = AppStyle.Lesson.Color.backgroundFooter } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - if let selected = tableNode.indexPathForSelectedRow { - tableNode.view.deselectRow(at: selected, animated: true) + if let selected = tableNode?.indexPathForSelectedRow { + tableNode?.view.deselectRow(at: selected, animated: true) } navigationController?.delegate = self setupNavigationbar() @@ -96,14 +97,14 @@ final class LessonController: ASDKViewController { override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() - tableNode.view.separatorColor = AppStyle.Base.Color.tableSeparator + tableNode?.view.separatorColor = AppStyle.Base.Color.tableSeparator } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if #available(iOS 13.0, *) { if UIApplication.shared.applicationState != .background && self.traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { - tableNode.reloadData() + tableNode?.reloadData() } } } @@ -223,13 +224,13 @@ final class LessonController: ASDKViewController { } func parallax(scrollView: UIScrollView) { - if let coverHeader = tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfoSplashView { + if let coverHeader = tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfoSplashView { let scrollOffset = scrollView.contentOffset.y if scrollOffset >= 0 { coverHeader.coverImage.frame.origin.y = scrollOffset / 2 } else { - if let cellHeader = tableNode.cellForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) { + if let cellHeader = tableNode?.cellForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) { cellHeader.frame.origin.y = scrollOffset-1 cellHeader.frame.size.height = coverHeader.initialCoverHeight + (-scrollOffset) coverHeader.frame.size.height = coverHeader.initialCoverHeight + (-scrollOffset) @@ -249,7 +250,7 @@ final class LessonController: ASDKViewController { if dataSource.lessons.count <= 0 { return } } - let titleOrigin = (tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.lessons.rawValue)) as! LessonView).view.rectCorrespondingToWindow + let titleOrigin = (tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.lessons.rawValue)) as! LessonView).view.rectCorrespondingToWindow guard let navigationBarMaxY = self.navigationController?.navigationBar.rectCorrespondingToWindow.maxY else { return } var navBarAlpha: CGFloat = (initialOffset - (titleOrigin.minY + mn - navigationBarMaxY)) / initialOffset @@ -277,7 +278,7 @@ final class LessonController: ASDKViewController { override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - tableNode.reloadData() + tableNode?.reloadData() } @available(iOS 13.0, *) @@ -287,7 +288,7 @@ final class LessonController: ASDKViewController { guard let readController = self.getReadControllerForPeek(indexPath: indexPath, point: point) else { return nil } return readController }, actionProvider: { suggestedActions in - let imageView = (self.tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as! LessonQuarterlyInfo).coverImage.image! + let imageView = (self.tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as! LessonQuarterlyInfo).coverImage.image! let lesson: Lesson = (self.dataSource?.lessons[indexPath.row])! let share = UIAction(title: "Share".localized(), image: UIImage(systemName: "square.and.arrow.up")) { action in let objectToShare = ShareItem(title: lesson.title, subtitle: lesson.dateRange, url: lesson.webURL, image: imageView) @@ -376,7 +377,7 @@ extension LessonController: LessonControllerProtocol { } func setReadViewState(_ state: ReadButtonState) { - if let coverHeader = tableNode.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfo { + if let coverHeader = tableNode?.nodeForRow(at: IndexPath(row: 0, section: LessonControllerSections.header.rawValue)) as? LessonQuarterlyInfo { coverHeader.readView.setState(state) } } @@ -396,9 +397,9 @@ extension LessonController: LessonControllerProtocol { func showLessons(quarterlyInfo: QuarterlyInfo) { self.dataSource = quarterlyInfo - tableNode.allowsSelection = true - tableNode.reloadData() - + tableNode?.allowsSelection = true + tableNode?.reloadData() + self.title = quarterlyInfo.quarterly.title if !self.isPeeking! { @@ -417,7 +418,7 @@ extension LessonController: LessonControllerProtocol { func showPublishingInfo(publishingInfo: PublishingInfo?) { self.publishingInfo = publishingInfo - tableNode.reloadSections(IndexSet(integer: LessonControllerSections.publishingInfo.rawValue), with: .automatic) + tableNode?.reloadSections(IndexSet(integer: LessonControllerSections.publishingInfo.rawValue), with: .automatic) } } @@ -430,13 +431,13 @@ extension LessonController: UIViewControllerPreviewingDelegate { } func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { - guard let indexPath = tableNode.indexPathForRow(at: location) else { return nil } + guard let indexPath = tableNode?.indexPathForRow(at: location) else { return nil } if indexPath.section > LessonControllerSections.lessons.rawValue { return nil } - guard let cell = tableNode.cellForRow(at: indexPath) else { return nil } + guard let cell = tableNode?.cellForRow(at: indexPath) else { return nil } let readController = getReadControllerForPeek(indexPath: indexPath, point: location) - previewingContext.sourceRect = (tableNode.convert(cell.frame, to: tableNode)) - + previewingContext.sourceRect = (tableNode?.convert(cell.frame, to: tableNode)) ?? CGRectZero + return readController } }