Git Product home page Git Product logo

swag's Introduction

SWAG4PI

Overview

If you love reading and sharing books with your friends, but struggle to keep track of which friend has which exact book, then SWAG4PI is the perfect solution for you! Not only can you easily add new books to your collection, but you can also update the book's details to include which friend "checked out" the book and on what date. If you decide to give the book away, you can delete the book from your collection. Sharing books with your friends is fun and easy, and with SWAG4PI keeping track of those books is now fun and easy too!

Implementation Details

SWAG4PI's architectural pattern is MVC. BooksTableViewController manages NoDataView, BookTableViewCell and ClearBooksView. DetailViewController manages DetailView and ShareDropDownView. AddBookViewController manages AddBookView. All three controllers interact with the Book model.

I opted to use a singleton creational pattern to handle the data from the server in order to organize the app’s data in one place (BookDataStore). I marked the class as final to ensure that BookDataStore would not be changed or subclassed. I also set sharedInstance as static in order to prevent its methods from being overridden. Finally, the singleton's initializer is marked as private to prevent other objects from creating their own instances of the BookDataStore class.

I chose to make the Book model a class instead of a struct because any changes made to an instance of Book I wanted to be reflected throughout the app; therefore, I determined that a reference type, rather than a value type, was better suited. BookAPICalls, by contrast, I made a struct because its primary purpose is to encapsulate the functions interacting with the server; therefore, there was no need for reference semantics. Marking the functions in BookAPICalls as static allowed me to call these functions without creating an instance of BookAPICalls.

swag's People

Contributors

fsjohnson avatar

Watchers

Oleks avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.