You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: INSPhotoGallery/INSPhoto.swift
+10-7
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,11 @@
19
19
20
20
import Foundation
21
21
import UIKit
22
-
23
-
publicprotocolINSPhotoViewable:class{
22
+
/*
23
+
* This is marked as @objc because of Swift bug http://stackoverflow.com/questions/30100787/fatal-error-array-cannot-be-bridged-from-objective-c-why-are-you-even-trying when passing for example [INSPhoto] array
24
+
* to INSPhotosViewController
25
+
*/
26
+
@objcpublicprotocolINSPhotoViewable:class{
24
27
varimage:UIImage?{get}
25
28
varthumbnailImage:UIImage?{get}
26
29
@@ -31,13 +34,13 @@ public protocol INSPhotoViewable: class {
31
34
}
32
35
33
36
publicclassINSPhoto:INSPhotoViewable,Equatable{
34
-
publicvarimage:UIImage?
35
-
publicvarthumbnailImage:UIImage?
37
+
@objcpublicvarimage:UIImage?
38
+
@objcpublicvarthumbnailImage:UIImage?
36
39
37
40
varimageURL:NSURL?
38
41
varthumbnailImageURL:NSURL?
39
42
40
-
publicvarattributedTitle:NSAttributedString?
43
+
@objcpublicvarattributedTitle:NSAttributedString?
41
44
42
45
init(image:UIImage?, thumbnailImage:UIImage?){
43
46
self.image = image
@@ -54,14 +57,14 @@ public class INSPhoto: INSPhotoViewable, Equatable {
@@ -45,7 +45,7 @@ func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath i
45
45
You are able to create your custom photo model which can be use instead default `INSPhoto`. Default implementation don't cache images. If you would like to use some caching mechanism or use some library for downloading images for example `HanekeSwift` use must implement `INSPhotoViewable` protocol.
0 commit comments