forked from gchiacchio/AlamoImage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommon.swift
More file actions
31 lines (22 loc) · 781 Bytes
/
Copy pathCommon.swift
File metadata and controls
31 lines (22 loc) · 781 Bytes
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
//
// ImageView.swift
// AlamoImage
//
// Created by Guillermo Chiacchio on 6/5/15.
//
//
import Foundation
import Alamofire
import AlamoImage
/**
Image cache used by some of the extensions, if present, to speed up the request. Default value is nil, so user should set an instance to start caching images.
AlamoImage.imageCache = NSCache()
*/
public var imageCache: NSCache? = nil
func setAssociatedObject(object: AnyObject!, key: UnsafePointer<Void>, value: AnyObject!) {
objc_setAssociatedObject(object, key, value, objc_AssociationPolicy(OBJC_ASSOCIATION_RETAIN))
}
func associatedObject(object: AnyObject!, key: UnsafePointer<Void>) -> AnyObject! {
return objc_getAssociatedObject(object, key)
}
var imageRequestPropertyKey = "AlamoImage.ImageView.Request"