-
Notifications
You must be signed in to change notification settings - Fork 2
/
ProfilePostImageURL.swift
51 lines (38 loc) · 1.12 KB
/
ProfilePostImageURL.swift
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// ProfilePostImageURL.swift
// weWrk_1
//
// Created by Pan Guan on 4/20/17.
// Copyright © 2017 luis castill0. All rights reserved.
//
import Foundation
import Firebase
class siteImagePost {
private var _imageUrl: String!
private var _sitePostKey: String!
private var _postKey: String!
private var _postRef: FIRDatabaseReference!
var imageUrl: String {
return _imageUrl
}
var sitePostKey: String {
return _sitePostKey
}
var postKey: String {
return _postKey
}
init(imageUrl: String, sitePostKey: String) {
self._imageUrl = imageUrl
self._sitePostKey = sitePostKey
}
init(postKey: String, postData: Dictionary<String, AnyObject>) {
self._postKey = postKey
if let imageUrl = postData["imageUrl"] as? String {
self._imageUrl = imageUrl
}
if let sitePostKey = postData["sitePostKey"] as? String {
self._sitePostKey = sitePostKey
}
_postRef = ProfileDataService.ds.REF_SITE_IMAGE_POSTS.child(_postKey)
}
}