Get started building a custom API that serves only a specific web host. Also go over methods to switch between staging and production servers.
- [Instructor] Okay, so,…we're going to use the table view itself…to tell us when we need to scroll…to the next page.…And the way that we're going to do that…is by implementing a new delegate method…in our UI table view data source delegate.…So we're going to implement…the function table view will display self row index path.…Now this is a nice method that will be called back…when the cell is about to be displayed,…so prior to becoming on screen.…
So what we need to do is, first,…calculate what our next page is going to be.…So let's go ahead and create…a nice little helper variable…that will tell us what our next page index is.…And this will be an integer,…and it will be calculated.…So, we get our next page by figuring out…what the last page is.…So if we have product pages,…and maybe we just want to get the last one,…and, because last again returns an optional value,…let's safely unwrap this with a guard clause.…
And if we don't have a last page,…let's just go ahead and return a zero…so that we load the first page again…
Author
Released
7/13/2017- Requesting data from an HTTP server
- Parsing with JSON
- Decoding JSON
- Parsing data with XML
- Loading data a page at a time to avoid HTTP errors
- Error handling
- Loading and caching image data
Skill Level Intermediate
Duration
Views
Related Courses
-
iOS App Development: Accessibility
with Kevin Favro2h 34m Intermediate
-
Introduction
-
Welcome1m 8s
-
Using the exercise files1m 11s
-
-
1. Introducing Data in iOS
-
Foundation network objects4m 55s
-
-
2. Working with JSON
-
Introduction to JSON4m 38s
-
JSON parsing pipeline4m 44s
-
Decoding JSON5m 49s
-
Decoding dates within JSON9m 10s
-
-
3. Working with XML
-
Introduction to XML parsing4m 13s
-
XML parse() function6m 20s
-
Testing out the XML parser3m 11s
-
-
4. Paging Data
-
Introduction to paging data1m 37s
-
Loading the next page3m 44s
-
-
5. Error Handling
-
Validating a URL response5m 32s
-
6. Loading Images
-
Caching image data4m 24s
-
Conclusion
-
Next steps2m 7s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Loading the next page