Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- SeSAC
- Firebase
- SwiftUI
- arc
- swift
- RxSwift
- combinecocoa
- swift 6
- Tuist Swift
- swift 5.9
- 카카오뱅크 ios
- realm
- JSON
- observable
- 네트워크 통신
- ribs
- xcode
- ios
- Subscribe
- Subject
- uitableviewdiffabledatasource
- swift db
- GCD
- ios database
- Firebase Analytics
- KeyPath
- Swift Tuist
- swift database
- Combine
- Tuist
Archives
- Today
- Total
천원의 개발
IOS Firebase에 데이터 추가 하기 본문
공식문서
제일 먼저 AppDelegate와 사용할 Controller에
let db = Firestore.firestore() // 추가 해주고
if let messageBody = messageTextfield.text, let messageSender = Auth.auth().currentUser?.email { //유저정보
db.collection("컬렉션이름").addDocument(data: ["송신자": messageSender,
"수신자": messageBody]) { error in
if let e = error{
print("There was an issue saving data to firestore")
}
else {
print("Successfully saved data.")
}
}
}
'iOS&Swift🍎' 카테고리의 다른 글
IOS ObservableObject (0) | 2022.05.19 |
---|---|
IOS Firebase에서 데이터 가져오기 (0) | 2022.04.04 |
IOS TableView 커스텀 (0) | 2022.03.31 |
IOS TableView 초기설정 (0) | 2022.03.30 |
IOS Firebase를 활용한 로그인 화면 구현 (0) | 2022.03.29 |