From 5d6ce0e8671454386bce7f2159b795fa698ad174 Mon Sep 17 00:00:00 2001 From: Indragie Karunaratne Date: Fri, 25 Aug 2023 15:28:09 -0700 Subject: [PATCH] fix: TrendingMovies build on Swift 5.8 & UI glitches (#3253) --- Samples/TrendingMovies/Cartfile | 1 - Samples/TrendingMovies/Cartfile.resolved | 1 - .../TrendingMovies.xcodeproj/project.pbxproj | 64 +++++++++++++++++-- .../Credits/CreditCollectionViewCell.swift | 5 +- .../Movies/MovieCollectionViewCell.swift | 2 +- 5 files changed, 63 insertions(+), 10 deletions(-) diff --git a/Samples/TrendingMovies/Cartfile b/Samples/TrendingMovies/Cartfile index 0204b678604..d3aa9000716 100644 --- a/Samples/TrendingMovies/Cartfile +++ b/Samples/TrendingMovies/Cartfile @@ -1,3 +1,2 @@ github "onevcat/Kingfisher" == 5.9.0 -github "BeauNouvelle/FaceAware" ~> 2.1.1 github "indragiek/TUSafariActivity" "master" diff --git a/Samples/TrendingMovies/Cartfile.resolved b/Samples/TrendingMovies/Cartfile.resolved index 1d5f4e3490a..9156d7804af 100644 --- a/Samples/TrendingMovies/Cartfile.resolved +++ b/Samples/TrendingMovies/Cartfile.resolved @@ -1,3 +1,2 @@ -github "BeauNouvelle/FaceAware" "2.1.1" github "indragiek/TUSafariActivity" "74b9c9959129b1297225cd790f9221cbb6fd5695" github "onevcat/Kingfisher" "5.9.0" diff --git a/Samples/TrendingMovies/TrendingMovies.xcodeproj/project.pbxproj b/Samples/TrendingMovies/TrendingMovies.xcodeproj/project.pbxproj index 9264de4293a..e9193c6eae8 100644 --- a/Samples/TrendingMovies/TrendingMovies.xcodeproj/project.pbxproj +++ b/Samples/TrendingMovies/TrendingMovies.xcodeproj/project.pbxproj @@ -58,8 +58,6 @@ 844A3561282B2B9B00C6D1DF /* VideoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844A352D282B2B9B00C6D1DF /* VideoCollectionViewCell.swift */; }; 844A3574282B4B6500C6D1DF /* TUSafariActivity.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3570282B4B6500C6D1DF /* TUSafariActivity.xcframework */; }; 844A3575282B4B6500C6D1DF /* TUSafariActivity.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3570282B4B6500C6D1DF /* TUSafariActivity.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 844A3576282B4B6500C6D1DF /* FaceAware.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3571282B4B6500C6D1DF /* FaceAware.xcframework */; }; - 844A3577282B4B6500C6D1DF /* FaceAware.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3571282B4B6500C6D1DF /* FaceAware.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 844A3578282B4B6500C6D1DF /* Kingfisher.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3572282B4B6500C6D1DF /* Kingfisher.xcframework */; }; 844A3579282B4B6500C6D1DF /* Kingfisher.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3572282B4B6500C6D1DF /* Kingfisher.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 844A357A282B4B6500C6D1DF /* KingfisherSwiftUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 844A3573282B4B6500C6D1DF /* KingfisherSwiftUI.xcframework */; }; @@ -70,6 +68,34 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 039F53352A96A5660034F766 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 844A3565282B3E4500C6D1DF /* Sentry.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D81A3488291D0AC0005A27A9; + remoteInfo = SentryPrivate; + }; + 039F53372A96A5660034F766 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 844A3565282B3E4500C6D1DF /* Sentry.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D8199DAA29376E9B0074249E; + remoteInfo = SentrySwiftUI; + }; + 039F53392A96A5660034F766 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 844A3565282B3E4500C6D1DF /* Sentry.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8431EFD929B27B1100D8DC56; + remoteInfo = SentryProfilerTests; + }; + 039F533B2A96A5660034F766 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 844A3565282B3E4500C6D1DF /* Sentry.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8431F00A29B284F200D8DC56; + remoteInfo = SentryTestUtils; + }; 844A356A282B3E4500C6D1DF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 844A3565282B3E4500C6D1DF /* Sentry.xcodeproj */; @@ -104,7 +130,6 @@ 844A357B282B4B6500C6D1DF /* KingfisherSwiftUI.xcframework in Embed Frameworks */, 844A3575282B4B6500C6D1DF /* TUSafariActivity.xcframework in Embed Frameworks */, 844A359D282DAA6100C6D1DF /* Sentry.framework in Embed Frameworks */, - 844A3577282B4B6500C6D1DF /* FaceAware.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -183,7 +208,6 @@ 844A357A282B4B6500C6D1DF /* KingfisherSwiftUI.xcframework in Frameworks */, 844A3574282B4B6500C6D1DF /* TUSafariActivity.xcframework in Frameworks */, 844A359C282DAA6100C6D1DF /* Sentry.framework in Frameworks */, - 844A3576282B4B6500C6D1DF /* FaceAware.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -390,6 +414,10 @@ children = ( 844A356B282B3E4500C6D1DF /* Sentry.framework */, 844A356D282B3E4500C6D1DF /* SentryTests.xctest */, + 039F53362A96A5660034F766 /* SentryPrivate.framework */, + 039F53382A96A5660034F766 /* SentrySwiftUI.framework */, + 039F533A2A96A5660034F766 /* SentryProfilerTests.xctest */, + 039F533C2A96A5660034F766 /* libSentryTestUtils.a */, ); name = Products; sourceTree = ""; @@ -498,6 +526,34 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 039F53362A96A5660034F766 /* SentryPrivate.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SentryPrivate.framework; + remoteRef = 039F53352A96A5660034F766 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 039F53382A96A5660034F766 /* SentrySwiftUI.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SentrySwiftUI.framework; + remoteRef = 039F53372A96A5660034F766 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 039F533A2A96A5660034F766 /* SentryProfilerTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = SentryProfilerTests.xctest; + remoteRef = 039F53392A96A5660034F766 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 039F533C2A96A5660034F766 /* libSentryTestUtils.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libSentryTestUtils.a; + remoteRef = 039F533B2A96A5660034F766 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 844A356B282B3E4500C6D1DF /* Sentry.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; diff --git a/Samples/TrendingMovies/TrendingMovies/Credits/CreditCollectionViewCell.swift b/Samples/TrendingMovies/TrendingMovies/Credits/CreditCollectionViewCell.swift index 89fe3b33249..d59d487db11 100644 --- a/Samples/TrendingMovies/TrendingMovies/Credits/CreditCollectionViewCell.swift +++ b/Samples/TrendingMovies/TrendingMovies/Credits/CreditCollectionViewCell.swift @@ -1,4 +1,3 @@ -import FaceAware import Kingfisher import UIKit @@ -19,9 +18,9 @@ class CreditCollectionViewCell: UICollectionViewCell { var profileImage: UIImage? { didSet { if let profileImage = profileImage { - profileImageView.set(image: profileImage, focusOnFaces: true) + profileImageView.image = profileImage } else { - profileImageView.set(image: UIImage(named: CreditCollectionViewCell.placeholderImageName), focusOnFaces: false) + profileImageView.image = UIImage(named: CreditCollectionViewCell.placeholderImageName) } } } diff --git a/Samples/TrendingMovies/TrendingMovies/Movies/MovieCollectionViewCell.swift b/Samples/TrendingMovies/TrendingMovies/Movies/MovieCollectionViewCell.swift index bc554ae7a44..88cf94f64d6 100644 --- a/Samples/TrendingMovies/TrendingMovies/Movies/MovieCollectionViewCell.swift +++ b/Samples/TrendingMovies/TrendingMovies/Movies/MovieCollectionViewCell.swift @@ -155,7 +155,7 @@ class MovieCollectionViewCell: UICollectionViewCell { private func blurPosterImage(_ image: UIImage, completion: @escaping (UIImage?) -> Void) { let efficiently = ProcessInfo.processInfo.arguments.contains("--io.sentry.sample.trending-movies.launch-arg.efficient-implementation") func performBlur() { - let blurredImage = ImageEffects.createBlurredBackdrop(image: image, downsamplingFactor: 1.0, blurRadius: 20.0, tintColor: nil, saturationDeltaFactor: 2.0) + let blurredImage = ImageEffects.createBlurredBackdrop(image: image, downsamplingFactor: 0.87, blurRadius: 20.0, tintColor: nil, saturationDeltaFactor: 2.0) if efficiently { DispatchQueue.main.async { completion(blurredImage)