                 }
             }
 
-            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) {
+            dispatch_async(self.cacheQueue) {
 
                 if !fileName.isEmpty {
                     if

                        } else {
                            // 或放个默认的图片
                            let defaultImage = tailDirection == .Left ? UIImage(named: "left_tail_image_bubble")! : UIImage(named: "right_tail_image_bubble")!
                            dispatch_async(dispatch_get_main_queue()) {
                                completion(loadingProgress: preloadingPropgress, image: defaultImage)
                            }

import MapKit

class ImageCache {

    static let sharedInstance = ImageCache()

    let cache = NSCache()
    let cacheQueue = dispatch_queue_create("ImageCacheQueue", DISPATCH_QUEUE_CONCURRENT)

    func imageOfMessage(message: Message, withSize size: CGSize, tailDirection: MessageImageTailDirection, completion: (loadingProgress: Double, image: UIImage?) -> Void) {

