35 questions
0
votes
1
answer
78
views
SwiftUI can't have working rounded corners with AsyncImage and ultra-wide images
I am trying to display a list of images from panoramic webcams with following display constraints:
rounded corners
16/9 aspect ratio
center crop scale type (image is centered and cropped to fill ...
0
votes
0
answers
47
views
Swiftui, ImageRenderer on AsyncImage not working [duplicate]
I am using ImageRenderer to render a view containing an AsyncImage, the problem is, when calling the my render function on onAppear, only the placeholder of the AsyncImage is beeing rendered.
And I am ...
0
votes
0
answers
83
views
SwiftUI ScrollViewReader does not scroll to last message when images are included
I am working on a SwiftUI chat application where I want the chat view to automatically scroll to the last message when the view appears and when new messages are added. The scrolling works fine for ...
1
vote
1
answer
194
views
Store loaded image in swifui Asyncimage to an array
I have one swiftui application in i am loading images from server and displaying it and uaisng AsyncImage. I want to store image in an array. how to store image inside asynview
in array
@State private ...
1
vote
1
answer
829
views
AsyncImage in SwiftUI View content of UITableViewCell flickers previous image
I have a UITableViewController to host an infinite scrolling list, because I wanted to experiment with UITableView performance versus any kind of SwiftUI implementation, especially when going over ...
4
votes
1
answer
7k
views
How define a size for image with AsyncImage [duplicate]
The problem:
When i use AsyncImage to display an image. The size of image is big and dont fit the size of frame.
Thats the code i used:
AsyncImage(url: URL(string: mockImageUrl))
.frame(width: ...
4
votes
2
answers
1k
views
Why does AsyncImage with .fill ContentMode cover buttons in a ZStack in iOS 17?
I am working on a SwiftUI view that displays an image fetched from a URL using AsyncImage. I want the image to fill the entire screen, and I have a row of buttons overlaid at the bottom of the image ...
1
vote
2
answers
312
views
How do I prevent an image from being squashed in a LazyVGrid cell?
I have a simple grid view where I have cells that show a square image with a couple of lines of text below it.
I'm trying to get the image to fill the square, clipped and not squashed in any way. I ...
0
votes
1
answer
890
views
AsyncImage inside list is consuming a lot of memory when scrolling and eventually crash in SwiftUI
Here is what I have done: the app crashes when the memory goes over 1 GB or more. I tried commenting asyncImage, and it took only 25–30 MB of memory and didn't crash.
List {
ForEach(0..<...
2
votes
2
answers
5k
views
AsyncImage with a placeholder sizing to fit to aspect ratio and clipping
I'm trying to create an AsyncImage with a placeholder image. With the following constraints...
The placeholder image may not have the same aspect ratio as the AsyncImage.
The remote image may not ...
0
votes
1
answer
865
views
Error message: "Type 'any ViewModifier' cannot conform to 'ViewModifier'"
At the moment I try to create a package with SwiftUI. I created a ProfileImageView. I get an Url as an optional String, which I convert to a non-optional String with if...let... In the body I use this ...
0
votes
1
answer
329
views
How can I implement a "Drag to resize" for an image in SwiftUI?
Consider having a screen like on the wireframe consisting of text, an image, and a sheet. When the sheet is dragged down, the image should grow vertically and go out of bounds.
This already works to ...
0
votes
1
answer
944
views
How do I show an AsyncImage only after its downloaded?
I am using AsyncImage to load remote images, once a certain condition is met ('ready' in the example), meanwhile I show a default placeholder image.
The problem I have is that while the remote image ...
0
votes
0
answers
1k
views
How to properly center and set aspect ratio for an image in SwiftUI?
I've been trying like a million different ways in terms of modifier order but I just don't seem to get the centering of the image correct, this is what my struct looks like
struct RecipeDetailView: ...
0
votes
1
answer
1k
views
SwiftUI AsyncImage ProgressView deadline
How can I achieve such a scenario.
Using the AsyncImage I load the url.
Progress view turns around as placeholder
After 2 seconds we don't get an error
Our ProgressView changes to an image
This is a ...
0
votes
1
answer
603
views
Moving to details view with Image in SwiftUI
I am new to swift. I am trying to achieve the requirement is when the spacific view record is selected I am want to move into details view with selected record including image. But the problems is the ...
2
votes
0
answers
976
views
AsyncImage doesn't work in images loaded for iOS widgets using SwiftUI
This is my simple class file:
import SwiftUI
struct NetworkImage: View {
let url: URL?
var body: some View {
//1st part
if let url = URL(string: "https://thumbs.dreamstime.com/b/...
1
vote
1
answer
712
views
async image in SwiftUI
I am working on an api, in which i retrieve the texts but the image from the api is not showing inside the view. I have given it an async image. The async image shows as a grey part in the view. ...
5
votes
1
answer
6k
views
Adding a placeholder to AsyncImage and showing a different image if AsyncImage fails to get the image
I'm trying to use an AsyncImage to show a ProgressView while it gets an image from a URL, but if it fails to get the image then a different image should be displayed. My code is working in the sense ...
1
vote
1
answer
556
views
SwiftUI List containing AsyncImages only updates when scrolled out of view
I have a List of Pokemon objects, displayed in PokemonCells. When these PokemonCells are created, it checks if it has a PokemonDetail object. The PokemonDetail is an @State var. If it's nil, it ...
0
votes
2
answers
708
views
AsyncImage in List is broken on iOS 16
struct Item: Identifiable {
let id: String
let url = URL(string: "https://styles.redditmedia.com/t5_j6lc8/styles/communityIcon_9uopq0bazux01.jpg")!
}
struct Content: View {
let ...
1
vote
0
answers
592
views
SwiftUI AsyncImage orientation
I am using AsyncImage to download a jpg from my Parse Server. If I download the file manually it has an orientation of 6 (90 Degree counterclockwise), but when the file is returned by AsyncImage, it ...
0
votes
0
answers
63
views
Where/How to put an image on the internet so it can be pulled via Swift?
So I want to just pass in an image https://... url into AsyncImage but for the life of me, I can't figure out how to upload this image to the internet so that it can be pulled into the swift code. Any ...
1
vote
0
answers
3k
views
Turn AsyncImage to UIImage
I got an AsyncImage and want to use UIImageWriteToSavedPhotosAlbum for save my AsyncImage to user library.
I used Paul Hudson course for find what to do but it downloads an empty white picture on ...
12
votes
3
answers
7k
views
AsyncImage not rendering all images in a List and producing error Code =-999 "cancelled"
I'm having trouble getting all images to show in a List using AsyncImage. When you first run the app, it seems fine but if you start scrolling, some Images aren't shown. Either the ProgressView doesn'...
0
votes
1
answer
360
views
AsyncImage. Cannot use switch statement in Phase closure?
When I use switch statement in phase in asyncImage it gave me this error.
Trailing closure passed to parameter of type 'CGFloat' that does not accept a closure
I understand that docs uses if let ...
4
votes
0
answers
2k
views
Asyncimage not loading image preview on swift playgrounds 4.1 [mac] app
The URL posted above shows an example of the problem i can't seem to solve so far. On the ipad version of swift playgrounds the use of Asyncimage works, however when i load the same code on the mac ...
2
votes
0
answers
475
views
Why does returning EmptyView make AsyncImage not work?
This code loads the image:
AsyncImage(url: URL(string: "https://ychef.files.bbci.co.uk/976x549/p01j3jyb.jpg")) { phase in
switch phase {
case .success(let image):
image
...
1
vote
0
answers
609
views
AsyncImage is Rotating Portrait Images
I am downloading a JPG image from a remote server. If I use AsyncImage, portrait images taken from the phone's library are rotated 90 degrees. Landscape images taken from the phone's photo library are ...
2
votes
1
answer
3k
views
AsyncImage not loading inside VStack
When using an AsyncImage inside a VStack, the image never loads. The handler is called once, and the AsyncImagePhase is .empty. Sample code:
import SwiftUI
struct ContentView: View {
var body: ...
17
votes
2
answers
5k
views
SwiftUI AsyncImage animation misbehavior
While testing out SwiftUI, I've found that AsyncImage does not work well while animating a transition. It seems to settle on its final position of the transition before the rest of the UI has moved ...
0
votes
0
answers
660
views
AsyncImage inside ForEach Loop
I'm using stock AsyncImage to load an image from Firebase Storage to my app. I'm using two exactly same fragments of code to load the same image however the app compiles only when there is only the ...
6
votes
4
answers
7k
views
Image doesn't appear with AsyncImage in SwiftUI
I have AsyncImage inside a TabView. When I do this the image never appears. I just see the progress bar.
@available(iOS 15.0, *)
struct TEST: View {
var body: some View {
VStack {
...
2
votes
2
answers
2k
views
Matched Geometry Effect with AsyncImage iOS 15
Consider the following example:
struct ContentView: View {
@State var showSplash: Bool = true
@Namespace var animationNamespace
var body: some View {
ZStack {
if ...
1
vote
1
answer
809
views
TabItem + AsyncImage - image is extremly big
I'm trying to load image async using AsyncImage - but the results is that the image is very big and covers all the screen.
TabView {
CreateView()
.tabItem {
...