Post

Replies

Boosts

Views

Activity

Making sure remote data is loaded before setting Collection View delegate and datasource
Hi, I wish to remotely load some data before I initialise the collection view. I read somewhere one way to do this is to only set the delegate and datasource after I loaded the data. However I'm setting the error "UICollectionView.delegate must be used from main thread only" next to the line self.myCollectionView.delegate = self I suppose this is not the best way to do this. What is the recommended way? Cheers Richard
1
0
1.1k
Apr ’22
Getting the following error when trying to fetch a remote image.
Hi, I'm writing code to get a remote image via URL and I get the following error each time. I converted the URL to https as recommended. This is the error I get. URL is Optional(https://img.recipepuppy.com/627470.jpg) 2022-03-29 16:27:41.892870+1100 QantasTest[13489:314159] ATS failed system trust 2022-03-29 16:27:41.892949+1100 QantasTest[13489:314159] Connection 3: system TLS Trust evaluation failed(-9802) 2022-03-29 16:27:41.893119+1100 QantasTest[13489:314159] Connection 3: TLS Trust encountered error 3:-9802 2022-03-29 16:27:41.893212+1100 QantasTest[13489:314159] Connection 3: encountered error(3:-9802) 2022-03-29 16:27:41.894548+1100 QantasTest[13489:314159] Task <526F7B9B-ADC8-4D14-8EA6-DEAD629E7C5A>.<0> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802]) 2022-03-29 16:27:41.894666+1100 QantasTest[13489:314182] NSURLConnection finished with error - code -1200 The code I use is: print("URL is \(String(describing: self.thumbNailUrl))") DispatchQueue.global().async { [weak self] in if let data = try? Data(contentsOf: self!.thumbNailUrl!) {             if let image = UIImage(data: data) {                                 DispatchQueue.main.async {                                     self?.imageView.image = image                                 }                             }                         }               } Any suggestions? Cheers Richard
2
0
1.8k
Mar ’22
Making sure remote data is loaded before setting Collection View delegate and datasource
Hi, I wish to remotely load some data before I initialise the collection view. I read somewhere one way to do this is to only set the delegate and datasource after I loaded the data. However I'm setting the error "UICollectionView.delegate must be used from main thread only" next to the line self.myCollectionView.delegate = self I suppose this is not the best way to do this. What is the recommended way? Cheers Richard
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’22
Getting the following error when trying to fetch a remote image.
Hi, I'm writing code to get a remote image via URL and I get the following error each time. I converted the URL to https as recommended. This is the error I get. URL is Optional(https://img.recipepuppy.com/627470.jpg) 2022-03-29 16:27:41.892870+1100 QantasTest[13489:314159] ATS failed system trust 2022-03-29 16:27:41.892949+1100 QantasTest[13489:314159] Connection 3: system TLS Trust evaluation failed(-9802) 2022-03-29 16:27:41.893119+1100 QantasTest[13489:314159] Connection 3: TLS Trust encountered error 3:-9802 2022-03-29 16:27:41.893212+1100 QantasTest[13489:314159] Connection 3: encountered error(3:-9802) 2022-03-29 16:27:41.894548+1100 QantasTest[13489:314159] Task <526F7B9B-ADC8-4D14-8EA6-DEAD629E7C5A>.<0> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802]) 2022-03-29 16:27:41.894666+1100 QantasTest[13489:314182] NSURLConnection finished with error - code -1200 The code I use is: print("URL is \(String(describing: self.thumbNailUrl))") DispatchQueue.global().async { [weak self] in if let data = try? Data(contentsOf: self!.thumbNailUrl!) {             if let image = UIImage(data: data) {                                 DispatchQueue.main.async {                                     self?.imageView.image = image                                 }                             }                         }               } Any suggestions? Cheers Richard
Replies
2
Boosts
0
Views
1.8k
Activity
Mar ’22