Skip to content

Commit

Permalink
More bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Short committed Jan 17, 2021
1 parent 7b75633 commit 3603070
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Sources/ImageViewerRemote/ImageViewerRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ public struct ImageViewerRemote: View {

loader = ImageLoader(url: imageURL)
}

func getURLRequest(url: String) -> URLRequest {
let url = URL(string: url)!
var request = URLRequest(url: url)
request.httpMethod = "GET"

return request;
}

@ViewBuilder
public var body: some View {
Expand All @@ -60,7 +52,7 @@ public struct ImageViewerRemote: View {
VStack {
ZStack {
if(self.disableCache == nil || self.disableCache == false) {
URLImage(url: URL(string: self.imageURL)!, content: { image in
URLImage(url: URL(string: self.imageURL) ?? URL(string: "https://via.placeholder.com/150.png")!, content: { image in
image
.resizable()
.aspectRatio(self.aspectRatio?.wrappedValue, contentMode: .fit)
Expand Down Expand Up @@ -321,7 +313,9 @@ class ImageLoader: ObservableObject {
init(url: Binding<String>) {
self.url = url

load()
if(url.wrappedValue.count > 0) {
load()
}
}

deinit {
Expand Down

0 comments on commit 3603070

Please sign in to comment.