Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 146146b

Browse files
author
Benjamin Scholtysik (Reimold)
authored
Merge pull request #460 from bitstadium/fix/some-cleanup
Fix/some cleanup
2 parents a16ddd3 + 3ba7117 commit 146146b

8 files changed

+44
-100
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ env:
88
- CONFIGURATION="DEBUG"
99

1010
matrix:
11-
- SCHEME="HockeySDK" DESTINATION="OS=8.1,name=iPad Air" RUN_TESTS="YES"
12-
- SCHEME="HockeySDK" DESTINATION="OS=8.2,name=iPhone 6 Plus" RUN_TESTS="YES"
1311
- SCHEME="HockeySDK" DESTINATION="OS=8.3,name=iPad 2" RUN_TESTS="YES"
14-
- SCHEME="HockeySDK" DESTINATION="OS=8.4,name=iPhone 4s" RUN_TESTS="YES"
15-
- SCHEME="HockeySDK" DESTINATION="OS=9.0,name=iPad Air" RUN_TESTS="YES"
1612
- SCHEME="HockeySDK" DESTINATION="OS=9.1,name=iPhone 6 Plus" RUN_TESTS="YES"
17-
- SCHEME="HockeySDK" DESTINATION="OS=10.2,name=iPad Pro (9.7-inch)" RUN_TESTS="YES"
1813
- SCHEME="HockeySDK" DESTINATION="OS=10.3.1,name=iPhone 6s" RUN_TESTS="YES"
19-
- SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 6" RUN_TESTS="YES"
14+
- SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,OS=10.3.3,name=iPhone 6" RUN_TESTS="YES"
2015
- SCHEME="HockeySDK Distribution" RUN_TESTS="NO" LINT="YES"
2116

2217
before_install:

Classes/BITAppStoreHeader.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
#import <UIKit/UIKit.h>
3333

34-
#ifndef __IPHONE_6_1
35-
#define __IPHONE_6_1 60100
36-
#endif
37-
3834
@interface BITAppStoreHeader : UIView
3935

4036
@property (nonatomic, copy) NSString *headerText;

Classes/BITFeedbackComposeViewController.m

Lines changed: 41 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,7 @@ - (void)keyboardWasShown:(NSNotification*)aNotification {
151151
NSDictionary* info = [aNotification userInfo];
152152
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
153153

154-
BOOL isPortraitOrientation = NO;
155-
156-
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
157-
isPortraitOrientation = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]);
158-
#else
159-
isPortraitOrientation = UIInterfaceOrientationIsPortrait(self.interfaceOrientation);
160-
#endif
154+
BOOL isPortraitOrientation = isPortraitOrientation = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]);
161155

162156
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
163157
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
@@ -238,7 +232,7 @@ - (void)viewDidLoad {
238232
if([BITHockeyHelper isPhotoAccessPossible]) {
239233
self.textAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 44)];
240234
self.textAccessoryView.backgroundColor = [UIColor colorWithRed:(CGFloat)0.9 green:(CGFloat)0.9 blue:(CGFloat)0.9 alpha:(CGFloat)1.0];
241-
235+
242236
self.addPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom];
243237
[self.addPhotoButton setTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentAddImage") forState:UIControlStateNormal];
244238
[self.addPhotoButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
@@ -546,64 +540,48 @@ - (void)imageButtonAction:(UIButton *)sender {
546540
NSInteger index = [self.attachmentScrollViewImageViews indexOfObject:sender];
547541

548542
self.selectedAttachmentIndex = (self.attachmentScrollViewImageViews.count - index - 1);
549-
/* We won't use this for now until we have a more robust solution for displaying UIAlertController
550-
// requires iOS 8
551-
id uialertcontrollerClass = NSClassFromString(@"UIAlertController");
552-
if (uialertcontrollerClass) {
553-
__weak typeof(self) weakSelf = self;
554-
555-
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
556-
message:nil
557-
preferredStyle:UIAlertControllerStyleActionSheet];
558-
559-
560-
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentCancel")
561-
style:UIAlertActionStyleCancel
562-
handler:^(UIAlertAction * action) {
563-
typeof(self) strongSelf = weakSelf;
564-
[strongSelf cancelAction];
565-
_actionSheetVisible = NO;
566-
}];
567-
568-
[alertController addAction:cancelAction];
569-
570-
UIAlertAction *editAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit")
571-
style:UIAlertActionStyleDefault
572-
handler:^(UIAlertAction * action) {
573-
typeof(self) strongSelf = weakSelf;
574-
[strongSelf editAction];
575-
_actionSheetVisible = NO;
576-
}];
577-
578-
[alertController addAction:editAction];
579-
580-
UIAlertAction *deleteAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentDelete")
581-
style:UIAlertActionStyleDestructive
582-
handler:^(UIAlertAction * action) {
583-
typeof(self) strongSelf = weakSelf;
584-
[strongSelf deleteAction];
585-
_actionSheetVisible = NO;
586-
}];
587-
588-
[alertController addAction:deleteAction];
589-
590-
[self presentViewController:alertController animated:YES completion:nil];
591-
} else {
592-
*/
593-
#pragma clang diagnostic push
594-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
595-
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle: nil
596-
delegate: self
597-
cancelButtonTitle: BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentCancel")
598-
destructiveButtonTitle: BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentDelete")
599-
otherButtonTitles: BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit"), nil];
600543

601-
[actionSheet showFromRect: sender.frame inView: self.attachmentScrollView animated: YES];
602-
#pragma clang diagnostic push
603-
/*}*/
544+
__weak typeof(self) weakSelf = self;
545+
546+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
547+
message:nil
548+
preferredStyle:UIAlertControllerStyleActionSheet];
549+
550+
551+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentCancel")
552+
style:UIAlertActionStyleCancel
553+
handler:^(UIAlertAction __unused *action) {
554+
typeof(self) strongSelf = weakSelf;
555+
[strongSelf cancelAction];
556+
strongSelf.actionSheetVisible = NO;
557+
}];
558+
559+
[alertController addAction:cancelAction];
560+
561+
UIAlertAction *editAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit")
562+
style:UIAlertActionStyleDefault
563+
handler:^(UIAlertAction __unused *action) {
564+
typeof(self) strongSelf = weakSelf;
565+
[strongSelf editAction];
566+
strongSelf.actionSheetVisible = NO;
567+
}];
568+
569+
[alertController addAction:editAction];
570+
571+
UIAlertAction *deleteAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentDelete")
572+
style:UIAlertActionStyleDestructive
573+
handler:^(UIAlertAction __unused *action) {
574+
typeof(self) strongSelf = weakSelf;
575+
[strongSelf deleteAction];
576+
strongSelf.actionSheetVisible = NO;
577+
}];
578+
579+
[alertController addAction:deleteAction];
580+
581+
[self presentViewController:alertController animated:YES completion:nil];
604582

605583
self.actionSheetVisible = YES;
606-
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || ([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}])) {
584+
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}])) {
607585
[self.textView resignFirstResponder];
608586
}
609587
}

Classes/BITFeedbackListViewCell.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,7 @@ - (UIColor *)backgroundColor {
170170
- (BOOL)isSameDayWithDate1:(NSDate*)date1 date2:(NSDate*)date2 {
171171
NSCalendar* calendar = [NSCalendar currentCalendar];
172172

173-
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
174173
unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
175-
#else
176-
unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
177-
#endif
178174

179175
NSDateComponents *dateComponent1 = [calendar components:unitFlags fromDate:date1];
180176
NSDateComponents *dateComponent2 = [calendar components:unitFlags fromDate:date2];

Classes/BITFeedbackManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ - (void)requestLatestImageWithCompletionHandler:(BITLatestImageFetchCompletionBl
12271227
[self fetchLatestImageUsingPhotoLibraryWithCompletionHandler:completionHandler];
12281228
}
12291229

1230-
- (void)fetchLatestImageUsingPhotoLibraryWithCompletionHandler:(BITLatestImageFetchCompletionBlock)completionHandler NS_AVAILABLE_IOS(8_0) {
1230+
- (void)fetchLatestImageUsingPhotoLibraryWithCompletionHandler:(BITLatestImageFetchCompletionBlock)completionHandler {
12311231
// Safeguard in case the dev hasn't set the NSPhotoLibraryUsageDescription in their Info.plist
12321232
if (![self isiOS10PhotoPolicySet]) {return;}
12331233

@@ -1248,7 +1248,7 @@ - (void)fetchLatestImageUsingPhotoLibraryWithCompletionHandler:(BITLatestImageFe
12481248
}];
12491249
}
12501250

1251-
- (void)loadLatestImageAssetWithCompletionHandler:(BITLatestImageFetchCompletionBlock)completionHandler NS_AVAILABLE_IOS(8_0) {
1251+
- (void)loadLatestImageAssetWithCompletionHandler:(BITLatestImageFetchCompletionBlock)completionHandler {
12521252

12531253
// Safeguard in case the dev hasn't set the NSPhotoLibraryUsageDescription in their Info.plist
12541254
if (![self isiOS10PhotoPolicySet]) {return;}

Classes/BITHockeyBaseManager.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
#import <mach-o/dyld.h>
4444
#import <mach-o/loader.h>
4545

46-
#ifndef __IPHONE_6_1
47-
#define __IPHONE_6_1 60100
48-
#endif
49-
5046
// We need BIT_UNUSED macro to make sure there aren't any warnings when building
5147
// HockeySDK Distribution scheme. Since several configurations are build in this scheme
5248
// and different features can be turned on and off we can't just use __unused attribute.

Classes/BITStoreButton.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
- (void)storeButtonFired:(BITStoreButton *)button;
4848
@end
4949

50-
51-
#ifndef __IPHONE_6_1
52-
#define __IPHONE_6_1 60100
53-
#endif
54-
5550
/**
5651
* Button style depending on the iOS version
5752
*/

Classes/HockeySDKPrivate.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ NSBundle *BITHockeyBundle(void);
7474
NSString *BITHockeyLocalizedString(NSString *stringToken);
7575
NSString *BITHockeyMD5(NSString *str);
7676

77-
#ifndef __IPHONE_8_0
78-
#define __IPHONE_8_0 80000
79-
#endif
80-
8177
#ifndef __IPHONE_11_0
8278
#define __IPHONE_11_0 110000
8379
#endif
@@ -96,14 +92,6 @@ NSString *BITHockeyMD5(NSString *str);
9692

9793
#endif /* TARGET_OS_SIMULATOR */
9894

99-
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_1
100-
10195
#define kBITButtonTypeSystem UIButtonTypeSystem
10296

103-
#else
104-
105-
#define kBITButtonTypeSystem UIButtonTypeRoundedRect
106-
107-
#endif
108-
10997
#endif /* HockeySDK_HockeySDKPrivate_h */

0 commit comments

Comments
 (0)