Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Finish coding data model classes and database accessor singleton class. #85

Merged
merged 8 commits into from
Jun 19, 2017

Conversation

identity2
Copy link
Contributor

@identity2 identity2 commented Jun 9, 2017

  • Added data model classes: Answer, Question, Avatar, Accessory, so the database accessor singleton could communicate better with controller code.
  • Implemented database accessor singleton to handle all database calls. Replaced the original database accessing code in controllers with single function calls to DatabaseAccessor. (Simply put, separated model code from controller code).
  • Changed orientation from portrait to landscape. Adjusted views to adapt to landscape orientation.
  • Deleted unneeded database "Choices.sqlite".

(Issue #70 Fixed)

Change the project to landscape orientation, reposition views accordingly.
Complete separating controllers and models for ScenarioViewController.
Create database singleton and data models.
"
"
Seperate models and controllers code from ShopViewController and CustomizeAvatarViewController.
Redesign DatabaseAccessor so that it uses the Avatar and Accessory data models
…e bought. Add TODO comments in DatabaseAccessor
@sunjunkie
Copy link
Contributor

You should use the simpler Swift 3 pattern for singleton classes:

class ClassName {
static let sharedInstance = ClassName()
private init() {...}
}

then access the singleton : ClassName.sharedInstance.somefunc()

And then you don't need to check for whether the instance is nil.

@identity2
Copy link
Contributor Author

identity2 commented Jun 16, 2017

@sunjunkie , I finished modifying the singleton class! :)

@sunjunkie
Copy link
Contributor

There are still several instances of DatabaseAccessor.sharedInstance() so the project does not compile. (need to remove parentheses)

@identity2
Copy link
Contributor Author

Oops, not sure why I did not compile the class for testing in the first place.
The compiler errors are all fixed now.

@sunjunkie sunjunkie merged commit d3aef7d into anitab-org:develop Jun 19, 2017
@identity2 identity2 deleted the database-model branch June 22, 2017 04:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants