vhart / InterviewFlashCards

14 stars 17 forks source link

Migrate from Firebase to Realm. Render using SyntaxKit instead of UIImages #39

Open vhart opened 8 years ago

vhart commented 8 years ago

Having Firebase as the backing persistence layer makes it hard for other people to add questions. It also leaves the app in a bad place since someone can easily request a deletion of the database.

If we switch over to local persistence, we would either need the images to be assets OR we can render code blocks using SyntaxKit. I've been playing with it and made some modification for convenience and it works well. This would mean no more fetching the code block images.

I propose we roll this out in two phases:

  1. Set up the Realm database and schema
  2. Migrate the data from Firebase to Realm, rendering code blocks as attributed string.

cc/ @mesbekmek @charleshkang

mesbekmek commented 8 years ago

Good points V. Could you elaborate a bit more on what you mean by rendering code blocks as attributed strings, I don't have much experience with SyntaxKit...yet

vhart commented 8 years ago

@mesbeskmek syntax kit lets you set a text mate language and theme file for the parser. The parser takes a string input and returns the string as an attributed string where the text is color coded like in Xcode. We can use those rather than fetch images. This would also give us more control over sizing and zoom(increased font).

vhart commented 8 years ago

@mesbekmek I pushed up a test project for SyntaxKit: https://github.com/vhart/SyntaxKitTesting , feel free to play around with that.