custom image view

This commit is contained in:
Aiden Vigue 2021-06-12 22:29:33 -04:00
parent 7c3dab23cb
commit 2c410c0e57
No known key found for this signature in database
GPG Key ID: B9A09843AB079D5B
4 changed files with 12 additions and 11 deletions

View File

@ -1042,7 +1042,7 @@
repositoryURL = "https://github.com/kean/NukeUI";
requirement = {
kind = exactVersion;
version = 0.6.1;
version = 0.3.0;
};
};
/* End XCRemoteSwiftPackageReference section */

View File

@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/kean/NukeUI",
"state": {
"branch": null,
"revision": "62b55e26eddc2ed59e63377ab877efac4f9e049c",
"version": "0.6.1"
"revision": "d2580b8d22b29c6244418d8e4b568f3162191460",
"version": "0.3.0"
}
},
{

View File

@ -128,6 +128,9 @@ struct ConnectToServerView: View {
let keychain = KeychainSwift()
keychain.set(response.accessToken!, forKey: "AccessToken_\(newUser.user_id!)")
globalData.expiredCredentials = false
globalData.networkError = false
do {
try viewContext.save()
DispatchQueue.main.async { [self] in

View File

@ -24,16 +24,14 @@ struct ImageView: View {
}
var body: some View {
LazyImage(source: source, content: { state in
if let image = state.image {
image.resizingMode(.aspectFill)
} else if state.error != nil {
Image(uiImage: UIImage(blurHash: "001fC^", size: CGSize(width: 1, height: 1))!)
.resizable()
} else {
LazyImage(source: source)
.placeholder {
Image(uiImage: UIImage(blurHash: blurhash, size: CGSize(width: 16, height: 16))!)
.resizable()
}
})
.failure {
Rectangle()
.background(Color.gray)
}
}
}