简体   繁体   中英

iOS - get JSON feed in every tableview cell with Swift

I'm building an iOS app with a table view. I have an array containing ID's that I use to populate the table view. Now I want to do a call to a web service in each table view cell that contains this ID in the URL. I want to use the JSON response to fill the cell with the correct data. I think the data has to be fetched in the background.

Can anyone point me in the right direction of how I can do this with Swift? I searched the web but I couldn't find any tutorials about this.

I think help full this step for you.

Step 1 :- Call API service from viewDidLoad() function.

Step 2 :- Handle API response and Use one array for store API data

Step 3 :- array count use for numberOfRowsInSection

Step 4 :- Use array data in cellForRowAtIndexPath

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM