Skip to content

Commit

Permalink
MOB-330: Upgrade SDWebImageSwiftUI pod (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang authored and mike-dydx committed Aug 21, 2024
1 parent 08b361b commit b6cac06
Show file tree
Hide file tree
Showing 27 changed files with 19,802 additions and 20,307 deletions.
17 changes: 7 additions & 10 deletions PlatformUI/PlatformUI/Components/Icons/PlatformIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import SDWebImageSwiftUI
public class PlatformIconViewModel: PlatformViewModel {
public enum IconType {
case asset(name: String?, bundle: Bundle?)
case url(url: URL?)
case urlWithPlaceholder(url: URL?, placeholderContent: () -> AnyView)
case url(url: URL?, placeholderContent: (() -> AnyView)? = nil)
case system(name: String)
case uiImage(image: UIImage)
case any(viewModel: PlatformViewModel)
Expand Down Expand Up @@ -62,14 +61,12 @@ public class PlatformIconViewModel: PlatformViewModel {
} else {
PlatformView.nilView
}
case .url(let url):
WebImage (url: url)
.resizable()
.templateColor(self.templateColor)
.scaledToFit()
case .urlWithPlaceholder(let url, let placeholderContent):
WebImage (url: url)
.placeholder(content: placeholderContent)
case .url(let url, let placeholderContent):
WebImage(url: url) { image in
image.resizable() // Control layout like SwiftUI.AsyncImage, you must use this modifier or the view will use the image bitmap size
} placeholder: {
placeholderContent?()
}
.resizable()
.templateColor(self.templateColor)
.scaledToFit()
Expand Down
4 changes: 3 additions & 1 deletion Shared/CommonAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ open class CommonAppDelegate: ParticlesAppDelegate {
private lazy var firebaseNotification: FirebaseNotificationHandler = {
return FirebaseNotificationHandler(tag: notificationTag)
}()

private let notificationHandlerDelegate = dydxNotificationHandlerDelegate()

override open func inject(completion: @escaping () -> Void) {
super.inject { [weak self] in
Expand Down Expand Up @@ -160,7 +162,7 @@ open class CommonAppDelegate: ParticlesAppDelegate {
injectURLHandler()
super.startup { [weak self] in
self?.injectNotification()
self?.firebaseNotification.delegate = dydxNotificationHandlerDelegate()
self?.firebaseNotification.delegate = self?.notificationHandlerDelegate
completion()
}
}
Expand Down
2 changes: 1 addition & 1 deletion dydx/PodFile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ end
def swifiui_pods
pod 'SDWebImage'
pod 'SDWebImageSVGCoder'
pod 'SDWebImageSwiftUI', '2.2.6'
pod 'SDWebImageSwiftUI'
pod 'Popovers'
end

Expand Down
8 changes: 4 additions & 4 deletions dydx/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ PODS:
- SDWebImage/Core (5.19.1)
- SDWebImageSVGCoder (1.7.0):
- SDWebImage/Core (~> 5.6)
- SDWebImageSwiftUI (2.2.6):
- SDWebImageSwiftUI (3.0.4):
- SDWebImage (~> 5.10)
- SimpleKeychain (0.12.5)
- SnapKit (5.7.1)
Expand Down Expand Up @@ -309,7 +309,7 @@ DEPENDENCIES:
- ReachabilitySwift
- SDWebImage
- SDWebImageSVGCoder
- SDWebImageSwiftUI (= 2.2.6)
- SDWebImageSwiftUI
- SimpleKeychain (~> 0.12.5)
- SnapKit
- SVGKit
Expand Down Expand Up @@ -436,13 +436,13 @@ SPEC CHECKSUMS:
ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c
SDWebImageSwiftUI: 3a8448b76833ed0e954a651be6c6f45faceed29d
SDWebImageSwiftUI: 824628d8220906aa101f62b39a7492edd138449d
SimpleKeychain: 8193a9e40967eccac933c1fde82de46c07a5ae26
SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
SVGKit: 1ad7513f8c74d9652f94ed64ddecda1a23864dea
Validator: 80a6f567220c962dfd2d9928ae98a8c1d164f6f4
ZSWTappableLabel: 92f11d677bb395a8294df48482316c4981783ca0

PODFILE CHECKSUM: 96db9e18859b897ba93282f59a6a43f75d6c5312
PODFILE CHECKSUM: e6f17a3740fec78173732202f4a12a9dd7ed9e8e

COCOAPODS: 1.15.2
8 changes: 4 additions & 4 deletions dydx/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6cac06

Please sign in to comment.