@@ -33,7 +33,7 @@ class FlickrSearchImpl : NSObject, FlickrSearch, OFFlickrAPIRequestDelegate {
33
33
func flickrSearchSignal( searchString: String ) -> RACSignal {
34
34
35
35
func photosFromDictionary ( response: NSDictionary ) -> FlickrSearchResults {
36
- let photoArray = response. valueForKeyPath ( " photos.photo " ) as [ [ String : String ] ]
36
+ let photoArray = response. valueForKeyPath ( " photos.photo " ) as! [ [ String : String ] ]
37
37
let photos = photoArray. map {
38
38
( photoDict) -> FlickrPhoto in
39
39
let url = self . flickrContext. photoSourceURLFromDictionary ( photoDict, size: OFFlickrSmallSize)
@@ -55,13 +55,13 @@ class FlickrSearchImpl : NSObject, FlickrSearch, OFFlickrAPIRequestDelegate {
55
55
arguments: [ " photo_id " : photoId] ) {
56
56
// String is not AnyObject?
57
57
( response: NSDictionary ) -> NSString in
58
- return response. valueForKeyPath ( " photo.total " ) as NSString
58
+ return response. valueForKeyPath ( " photo.total " ) as! NSString
59
59
}
60
60
61
61
let commentsSignal = signalFromAPIMethod ( " flickr.photos.getInfo " ,
62
62
arguments: [ " photo_id " : photoId] ) {
63
63
( response: NSDictionary ) -> NSString in
64
- return response. valueForKeyPath ( " photo.comments._text " ) as NSString
64
+ return response. valueForKeyPath ( " photo.comments._text " ) as! NSString
65
65
}
66
66
67
67
return RACSignalEx . combineLatestAs ( [ favouritesSignal, commentsSignal] ) {
@@ -89,7 +89,7 @@ class FlickrSearchImpl : NSObject, FlickrSearch, OFFlickrAPIRequestDelegate {
89
89
90
90
sucessSignal
91
91
// filter to only include responses from this request
92
- . filterAs { ( tuple: RACTuple ) -> Bool in tuple. first as NSObject == flickrRequest }
92
+ . filterAs { ( tuple: RACTuple ) -> Bool in tuple. first as! NSObject == flickrRequest }
93
93
// extract the second tuple argument, which is the response dictionary
94
94
. mapAs { ( tuple: RACTuple ) -> AnyObject in tuple. second }
95
95
// transform with the given function
0 commit comments