mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-12 06:16:09 +10:00
do cacheInAdvance with Navi
This commit is contained in:
@@ -12,6 +12,7 @@ import Crashlytics
|
||||
import AVFoundation
|
||||
import RealmSwift
|
||||
import MonkeyKing
|
||||
import Navi
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
@@ -365,6 +366,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) {
|
||||
|
||||
guard let realm = try? Realm() else {
|
||||
return
|
||||
}
|
||||
|
||||
let conversations = realm.objects(Conversation)
|
||||
|
||||
conversations.forEach { conversation in
|
||||
if let latestMessage = conversation.messages.last, user = latestMessage.fromFriend {
|
||||
let userAvatar = UserAvatar(userID: user.userID, avatarStyle: miniAvatarStyle)
|
||||
AvatarPod.wakeAvatar(userAvatar, completion: { _ ,_ in })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func customAppearce() {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import UIKit
|
||||
import RealmSwift
|
||||
import Navi
|
||||
|
||||
let YepNotificationCommentAction = "YepNotificationCommentAction"
|
||||
let YepNotificationOKAction = "YepNotificationOKAction"
|
||||
@@ -146,6 +147,12 @@ class ConversationsViewController: UIViewController {
|
||||
// })
|
||||
// }
|
||||
|
||||
for user in normalUsers() {
|
||||
|
||||
let userAvatar = UserAvatar(userID: user.userID, avatarStyle: nanoAvatarStyle)
|
||||
AvatarPod.wakeAvatar(userAvatar, completion: { _ ,_ in })
|
||||
}
|
||||
|
||||
// 每个对话的最近 10 条消息(image or thumbnail)
|
||||
|
||||
guard let realm = try? Realm() else {
|
||||
|
||||
Reference in New Issue
Block a user