mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 22:06:40 +10:00
rename messagesCount of Feed
This commit is contained in:
@@ -41,7 +41,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
let directory: NSURL = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier(YepConfig.appGroupID)!
|
||||
let realmPath = directory.URLByAppendingPathComponent("db.realm").path!
|
||||
|
||||
return Realm.Configuration(path: realmPath, schemaVersion: 5, migrationBlock: { migration, oldSchemaVersion in
|
||||
return Realm.Configuration(path: realmPath, schemaVersion: 6, migrationBlock: { migration, oldSchemaVersion in
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -504,7 +504,7 @@ class Feed: Object {
|
||||
|
||||
dynamic var creator: User?
|
||||
dynamic var distance: Double = 0
|
||||
dynamic var messageCount: Int = 0
|
||||
dynamic var messagesCount: Int = 0
|
||||
dynamic var body: String = ""
|
||||
var attachments = List<Attachment>()
|
||||
|
||||
@@ -681,7 +681,7 @@ func saveFeedWithFeedDataWithFullGroup(feedData: DiscoveredFeed, group: Group, i
|
||||
newFeed.distance = distance
|
||||
}
|
||||
|
||||
newFeed.messageCount = feedData.messageCount
|
||||
newFeed.messagesCount = feedData.messagesCount
|
||||
|
||||
if let feedSkill = feedData.skill {
|
||||
let _ = try? realm.write {
|
||||
|
||||
@@ -2504,7 +2504,7 @@ struct DiscoveredFeed: Hashable {
|
||||
|
||||
let skill: Skill?
|
||||
let groupID: String
|
||||
var messageCount: Int
|
||||
var messagesCount: Int
|
||||
|
||||
static func fromJSONDictionary(json: JSONDictionary) -> DiscoveredFeed? {
|
||||
|
||||
@@ -2518,7 +2518,7 @@ struct DiscoveredFeed: Hashable {
|
||||
attachmentsData = json["attachments"] as? [JSONDictionary],
|
||||
//skill // TODO: skill
|
||||
groupInfo = json["circle"] as? JSONDictionary,
|
||||
messageCount = json["message_count"] as? Int else {
|
||||
messagesCount = json["message_count"] as? Int else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2535,7 +2535,7 @@ struct DiscoveredFeed: Hashable {
|
||||
skill = Skill.fromJSONDictionary(skillInfo)
|
||||
}
|
||||
|
||||
return DiscoveredFeed(id: id, allowComment: allowComment, createdUnixTime: createdUnixTime, updatedUnixTime: updatedUnixTime, creator: creator, body: body, attachments: attachments, distance: distance, skill: skill, groupID: groupID, messageCount: messageCount)
|
||||
return DiscoveredFeed(id: id, allowComment: allowComment, createdUnixTime: createdUnixTime, updatedUnixTime: updatedUnixTime, creator: creator, body: body, attachments: attachments, distance: distance, skill: skill, groupID: groupID, messagesCount: messagesCount)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ class FeedsViewController: BaseViewController {
|
||||
guard var updatedFeed = self?.feeds[safe: index] else {
|
||||
return
|
||||
}
|
||||
updatedFeed.messageCount += newMessagesCount
|
||||
updatedFeed.messagesCount += newMessagesCount
|
||||
self?.feeds.removeAtIndex(index)
|
||||
self?.feeds.insert(updatedFeed, atIndex: index)
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ class FeedCell: UITableViewCell {
|
||||
}
|
||||
|
||||
timeLabel.text = "\(NSDate(timeIntervalSince1970: feed.createdUnixTime).timeAgo)"
|
||||
messageCountLabel.text = "\(feed.messageCount)"
|
||||
messageCountLabel.text = "\(feed.messagesCount)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user