-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loading indicator to WebViewContainer
#355
Conversation
3 builds increased size
HackerNews 3.6 (1)
|
Item | Install Size Change |
---|---|
DYLD.String Table | ⬆️ 38.7 kB |
📝 HackerNews.LoadingView.body | ⬆️ 6.0 kB |
SwiftUI.ModifiedContent | ⬆️ 3.0 kB |
Code Signature | ⬆️ 2.8 kB |
Swift._unimplementedInitializer(className,initName,file,line,colu... | ⬆️ 2.3 kB |
HackerNews 3.6 (1)
com.emergetools.hackernews.adhoc
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 18.8 kB (0.3%)
Total download size change: ⬆️ 6.4 kB (0.17%)
Largest size changes
Item | Install Size Change |
---|---|
📝 HackerNews.LoadingView.body | ⬆️ 4.3 kB |
📝 WKNavigationDelegate.Objc Metadata | ⬆️ 2.0 kB |
DYLD.Fixups | ⬆️ 1.2 kB |
DYLD.String Table | ⬆️ 1.0 kB |
📝 HackerNews.WebViewModel.WebViewModel | ⬆️ 756 B |
HackerNews 3.6 (1)
com.emergetools.hackernews
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 14.6 kB (0.25%)
Total download size change: ⬆️ 6.5 kB (0.18%)
Largest size changes
Item | Install Size Change |
---|---|
📝 HackerNews.LoadingView.body | ⬆️ 4.3 kB |
📝 WKNavigationDelegate.Objc Metadata | ⬆️ 2.0 kB |
DYLD.Fixups | ⬆️ 1.2 kB |
📝 HackerNews.WebViewModel.WebViewModel | ⬆️ 756 B |
SwiftUI.View.View | ⬆️ 612 B |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
📸 Snapshot Test1 added, 88 unchanged
🛸 Powered by Emerge Tools |
ios/HackerNews/Web/WebView.swift
Outdated
@@ -10,23 +10,40 @@ import SwiftUI | |||
import UIKit | |||
import WebKit | |||
|
|||
final class WebViewModel: ObservableObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using @Observable
everywhere we can, I don't see a need for this to be ObservableObject
ios/HackerNews/Web/WebView.swift
Outdated
struct WebViewContainer: View { | ||
@Environment(\.openURL) var openURL | ||
|
||
@StateObject var model: WebViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same we should not use @StateObject
ios/HackerNews/Web/WebView.swift
Outdated
@@ -39,18 +56,34 @@ struct WebViewContainer: View { | |||
} | |||
|
|||
struct WebView: UIViewRepresentable { | |||
let url: URL | |||
@ObservedObject var viewModel: WebViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same think this should be @Binding
Implements a very basic loading indicator
Fixes: #349