Search code examples
iosswiftuitableviewalamofire

add dynamic image into UIView at UITableview's headerview


I have a UIView above the tableview cells. There are UIImageView and UILabels.

What I expect is that the UIImageView and UILabels can get data from networking request.

May I know where can I reference UIImageView and UILabels, where should I write logic code(api calls)

enter image description here

Here is my view structure

enter image description here


Solution

  • Create IBOutlet of UIImageview and UILabel in MainTableViewcontroller and initiates networking request in viewcontroller's viewDidAppear() method.Update UI on main thread once response received.