Day-15 Flashcards
Firebase Storage
Analytics are embedded in the framework
Support - nsstring nsnumber nsarray nsdictionary
Its a smart database, it can call an API, get data, store it in the data base and present it to you!
- Everything is stored as a single JSON file
Firebase Auth - User Authentication for login/signup
Sync engine to have data in sync among devices or users.. it tracks a cache when the user is offline and persist data to disk. Once we are back online, it syncs it with the database.
Ideally, We can build iMessage and chatting apps with this because its a realtime database. It fires off notifications whenever theres a change in data.
JSON Tree with Firebase
Unlike a SQL database, there are NO tables or records.
Avoid nesting objects/data ; Flatten data structure is the common term here.
All Firebase Realtime Database data is stored as JSON objects. You can think of the database as a cloud-hosted JSON tree.
Carthage vs. Cocoa Pods
If you had the choice, always go for Carthage.
Otherwise Cocoa Pods are not bad.
Pros: any of the framework can be built into a new thing (workSpace). Anytime we wanna update it, we do it in the command line.
Cons: XC work space, it gets very bulky and heavy whenever we build more stuff on it
Uses a handful of dependencies and keep things lighter to use, update and incorporate to our DataBase.
FireBase workflow
FIRDatabaseReference : We instantiate it to be able to read/write from the database
//if theres a change go to the block ObserveEventType:withBlock
FIRDataEventTypeValue listens to updates
Whenever there’s a change a snapshot is taken with:
FIRDataSnapshot - to get notified on the json tree updates
Container View Controllers
class ViewController: UIViewController { func setup() { guard let storyboard = self.storyboard else { return } guard let anotherVC = storyboard.instantiate..
self. addChildViewController(anotherVC) self. view.addSubview(anotherVC.view) anotherVC.didMoveToParentViewController(self) } }
func remove(vc: UIViewController) { vc.willMoveToParentViewController(nil) vc.view.removeFromSuperview() vc.removeFromParentViewController() }
NSError
&Error
A status code
A corresponding error domain
Additional context provided in the userInfo dictionary week