DOWNLOAD RESOURCES: https://ductran.co/p/39
Most apps nowadays have a backend so that we can authenticate users (sign up and log in), save user's information, post and store data, retrieve and share data either it's a video, photo or even secured information.
How can we do that? In this training, I'd love to share with you how to build a simple version of Twitter in iOS with Firebase.
You'll learn:
How to use Firebase to authenticate users
Post data to Firebase
Structure data model using MVC
How to install Firebase using Cocoapods
DOWNLOAD RESOURCES: https://ductran.co/p/39
*********
ABOUT CODE MASTERY
*********
Code Mastery is hosted by Duc Tran, founder of Developers Academy.
This is his free-style no notes, no teleprompter presentation and live coding broadcast with you guys everyday.
To join Duc's free courses, register for free at http://ductran.co/
*********
MEET DUC TRAN
*********
Duc Tran is founder of Developers Academy, one of the world's leading iOS, Android and Web development trainers.
More than 2,000,000 developers have studied his video trainings; 100,000 developers see his posts each month. Each year, Duc has helped 20,000 plus developers graduate from his online courses or video series.
*********
FREE TRAININGS IN IOS DEVELOPMENT
*********
To subscribe and get free tutorials, courses and weekly content, visit me at: http://ductran.co/
Connect with Duc on facebook: / ductranfan
Tweet him: / ductrongtran
Get daily inspiration: / ductran.co
*********
SOURCE CODE IN THIS COURSE
*********
SET UP FIREBASE in AppDelegate.swift
import Firebase
FirebaseApp.configure()
--
import Foundation
import Firebase
class Story
{
var text: String = ""
var numberOfLikes = 0
var numberOfAngry = 0
let ref: DatabaseReference!
init(text: String) {
self.text = text
ref = Database.database().reference().child("stories").childByAutoId()
}
init(snapshot: DataSnapshot)
{
ref = snapshot.ref
if let value = snapshot.value as? [String : Any] {
text = value["text"] as! String
numberOfLikes = value["numberOfLikes"] as! Int
numberOfAngry = value["numberOfAngry"] as! Int
}
}
func save() {
ref.setValue(toDictionary())
}
func toDictionary() - [String : Any]
{
return [
"text" : text,
"numberOfLikes" : numberOfLikes,
"numberOfAngry" : numberOfAngry
]
}
}
// Like and Dislike
extension Story {
func like() {
numberOfLikes += 1
ref.child("numberOfLikes").setValue(numberOfLikes)
}
}
--
DOWNLOAD DATA FROM FIREBASE
storiesRef.observe(.value, with: { (snapshot) in
self.stories.removeAll()
for child in snapshot.children {
let childSnapshot = child as! DataSnapshot
let story = Story(snapshot: childSnapshot)
print(story)
self.stories.insert(story, at: 0)
}
self.tableView.reloadData()
})
--
FULL SOURCE CODE AND VIDEO TRAINING: https://ductran.co/p/39
On this page of the site you can watch the video online FIREBASE iOS TUTORIAL - BUILD TWITTER USING FIREBASE with a duration of hours minute second in good quality, which was uploaded by the user David Tran 05 September 2017, share the link with friends and acquaintances, this video has already been watched 6,785 times on youtube and it was liked by 117 viewers. Enjoy your viewing!