Skip to content

Commit 023b710

Browse files
author
Joey Lorich
committed
Fix a few small analysis issues
1 parent 2d60cc7 commit 023b710

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

EasyReader/Application/Controllers/Menu/EZRMenuSearchController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#import "EZRMenuSearchController.h"
1010
#import "EZRMenuSearchFeedDataSource.h"
1111
#import "EZRMenuUserFeedDataSource.h"
12+
#import "EZRGoogleAnalyticsService.h"
1213
#import "Feed.h"
14+
#import "TSMessage.h"
1315

1416

1517
NSString * const kEZRFeedSearchStateChangedNotification = @"kEZRFeedSearchStateChanged";
@@ -156,6 +158,17 @@ - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
156158
*/
157159
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
158160
{
161+
if ([self isURL:searchBar.text]) {
162+
UIViewController *rootVC = [[[UIApplication sharedApplication].delegate window] rootViewController];
163+
164+
[Feed createFeedWithUrl:searchBar.text success:^(id responseObject, NSInteger httpStatus) {
165+
[[EZRGoogleAnalyticsService shared] sendView:@"Feed Added"];
166+
[TSMessage showNotificationInViewController:rootVC title:@"Easy Reader" subtitle:@"The selected feed has been added to the menu. Please allow a few minutes for new items to populate." type:TSMessageNotificationTypeSuccess];
167+
} failure:^(id responseObject, NSInteger httpStatus, NSError *error) {
168+
[TSMessage showNotificationInViewController:rootVC title:@"Easy Reader" subtitle:@"There was an error adding that feed. Please try again later." type:TSMessageNotificationTypeError];
169+
}];
170+
}
171+
159172
[self cancelSearch];
160173
}
161174

EasyReader/Application/Services/EZRFeedImageService.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,13 @@ - (UIImage *)blurImage:(UIImage*)image
440440

441441
CIImage *result = [blurFilter valueForKey: kCIOutputImageKey];
442442

443-
UIImage *blurredImage = [UIImage imageWithCGImage:[context createCGImage:result fromRect:inputImage.extent] scale:1.0 orientation:UIImageOrientationDownMirrored];
443+
CGImageRef blurredImageRef = [context createCGImage:result fromRect:inputImage.extent];
444+
445+
UIImage *blurredImage = [UIImage imageWithCGImage:blurredImageRef
446+
scale:1.0
447+
orientation:UIImageOrientationDownMirrored];
448+
449+
CGImageRelease(blurredImageRef);
444450

445451
return blurredImage;
446452
}

EasyReader/Library/apikit/APIClient.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,12 @@ - (AFFailureBlock) translateAFFailureBlock:(APIFailureBlock)failure
185185
{
186186
httpStatus = [error.userInfo[AFNetworkingOperationFailingURLResponseErrorKey] statusCode];
187187
}
188+
else
189+
{
190+
httpStatus = operation.response.statusCode;
191+
}
188192

189-
failure(operation.responseObject, operation.response.statusCode, error);
193+
failure(operation.responseObject, httpStatus, error);
190194
}
191195
};
192196
}

EasyReader/Supporting Files/Staging-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</dict>
3737
</array>
3838
<key>CFBundleVersion</key>
39-
<string>2.0.42</string>
39+
<string>2.0.43</string>
4040
<key>LSApplicationCategoryType</key>
4141
<string></string>
4242
<key>LSRequiresIPhoneOS</key>

0 commit comments

Comments
 (0)