Skip to Content
Native Mobile Development
book

Native Mobile Development

by Shaun Lewis, Mike Dunn
November 2019
Intermediate to advanced
394 pages
9h 44m
English
O'Reilly Media, Inc.
Content preview from Native Mobile Development

Chapter 18. Modeling Our Library

At this point, we’ve made a fair amount of headway on our library application; we’ve got some basic structural elements in place for the app, we’re transitioning between some screens, and we’re listing out some data. Unfortunately that data is static, hard-coded data—this won’t get us far for very long. In order to move forward with the rest of the app, we need to look at our data model. Paying attention to it now will allow us to make something a bit more maintainable and robust.

Now, static data in and of itself is not a terrible thing. In fact, we’ll continue to use “static” data throughout this tutorial until we talk about networking in Chapter 9. A large part of the problem with the way we’re serving up a list of books right now is that it’s not very portable to other places inside the app.

Right now, we’re only displaying books in a catalog view within the app. Later, however, we’ll be searching for books, saving books, and more. Let’s figure out a way to move forward that is a bit more adaptable for the future.

Dynamic Data in List Views

Our list view of books is a great place to start looking at ways to make our display of data a bit more dynamic. If you’ll recall, the list of books is currently stored as a temporary property on our main object type, Book, as sampleData to make it a bit easier to find and use.

As we add more views that display data to our application, however, we’ll find that this is a bit repetitive and cumbersome to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro iPhone Development with SwiftUI: Design and Manage Top Quality Apps

Pro iPhone Development with SwiftUI: Design and Manage Top Quality Apps

Wallace Wang
Ionic in Action

Ionic in Action

Jeremy Wilken
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 9781492052869Errata PageSupplemental Content