Skip to main content
improved details
Source Link
J.Paravicini
  • 912
  • 1
  • 13
  • 42

Swift - Image color resets with URLSessionwhen Alert is displayed

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any URLSessionsAlerts or modal views like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask dataTask and display an alert telling to please wait, the images turn grey like the following:

enter image description here

I'm not sure how this is even possible that one viewcontroller can change another viewcontrollers subviews. Thanks in advance -Jorge

Swift - Image color resets with URLSession

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any URLSessions like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask the images turn grey like the following:

enter image description here

I'm not sure how this is even possible that one viewcontroller can change another viewcontrollers subviews. Thanks in advance -Jorge

Swift - Image color resets when Alert is displayed

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any Alerts or modal views like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask and display an alert telling to please wait, the images turn grey like the following:

enter image description here

I'm not sure how this is even possible that one viewcontroller can change another viewcontrollers subviews. Thanks in advance -Jorge

Improved clearness
Source Link
J.Paravicini
  • 912
  • 1
  • 13
  • 42

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any URLSessions like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask the images turn grey like the following:

enter image description here

I'm not sure how this is even possible, and i'm quite sure it's an Apple bug, but i want to be sure that there's nothing else that may cause this problem before creating a bug reportone viewcontroller can change another viewcontrollers subviews. Thanks in advance -Jorge

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any URLSessions like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask the images turn grey like the following:

enter image description here

I'm not sure how this is possible, and i'm quite sure it's an Apple bug, but i want to be sure that there's nothing else that may cause this problem before creating a bug report. Thanks in advance -Jorge

So in my iOS app I have a menu designed like this:

enter image description here

The Images are created with the following code:

cell.imageCell?.image = menuItems[indexPath.row].image cell.imageCell.image = cell.imageCell.image?.withRenderingMode(.alwaysTemplate) cell.imageCell.tintColor = MenuTableViewController.fontColor cell.imageCell.backgroundColor = UIColor.clear 

This code is placed in the tableview cellForRowAt function. Now all the different viewcontrollers(HomeViewController, InfoViewController etc...) have no access at all to the menu controller and thus are not able to change the color of the image and nowhere else am I changing the color of these images. Now when I press one of the tabs that don't use any URLSessions like home or info, the images stay perfectly fine, however when I press on Weather or excursions which download a json file with URLSession dataTask the images turn grey like the following:

enter image description here

I'm not sure how this is even possible that one viewcontroller can change another viewcontrollers subviews. Thanks in advance -Jorge

edited tags
Link
rmaddy
  • 319.5k
  • 44
  • 548
  • 591
Source Link
J.Paravicini
  • 912
  • 1
  • 13
  • 42
Loading