Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump deployment target to iOS 12 #92

Merged
merged 9 commits into from
Dec 9, 2020

Conversation

NickEntin
Copy link
Collaborator

@NickEntin NickEntin commented Nov 14, 2020

  • Bump deployment target to iOS 12.0 and watchOS 4.0
  • Bump minimum support Xcode version to 11.0
  • Bump Swift version to 5.0
  • Adopt recommended project settings
  • Migrate off of deprecated APIs

Some commits in here are cherry picked off of @JustinDSN's #82 and rebased on top of the Aardvark 4.0 development branch. Resolves #83.

@NickEntin NickEntin linked an issue Nov 14, 2020 that may be closed by this pull request
Copy link
Collaborator

@dfed dfed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

README.md Show resolved Hide resolved
@@ -47,13 +47,8 @@ extension UIApplication {
UIApplication.bugReporterToGestureRecognizerMap.setObject(bugReportingGestureRecognizer, forKey: bugReporter)

if !UIApplication.observingKeyWindowNotifications {
#if swift(>=4.2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

@@ -27,6 +27,12 @@
#import "ARKScreenshotViewController.h"
#import "UIActivityViewController+ARKAdditions.h"

typedef NS_ENUM(NSUInteger, ARKLogExportOption) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you help me understand why this change was needed? This code looks reasonable but I'm not following why this was required.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of @JustinDSN's commits, so he could explain the thinking behind the change better than I can. The short version is that UIActionSheet and UIPopoverController are deprecated in iOS 8.3 and iOS 9, respectively, so this replaces their usage with UIAlertControllers.

This specific change (the enum of export options) could be implemented as two separate methods fairly easily. This route adds a bit more structure in order to avoid repeating a bit of logic. I don't have strong feelings either way given it's not a ton of structure but also not a ton of repeated logic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You summarized the specific trade offs I was trying to balance here. It's really good feedback to see the feedback on repeated logic and that would have been acceptable. Thanks for representing the thought process as well as seeing both sides of the same coin.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining the why would be helpful for future maintainers 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here: #94


- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;
{
#if TARGET_IPHONE_SIMULATOR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this code block was moved down to _exportLogsWithOption with no meaningful changes


if (actionSheet == self.clearLogsConfirmationActionSheet) {
if (buttonIndex == actionSheet.destructiveButtonIndex) {
[self.logStore clearLogsWithCompletionHandler:NULL];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code moved down into an UIAlertAction handler with no changes

@@ -100,7 +100,7 @@ typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReport
/// Controls the number of recent error logs per log distributor to include in the email body of a bug report composed in a mail client that does not allow attachments. Defaults to 15.
@property (nonatomic) NSUInteger numberOfRecentErrorLogsToIncludeInEmailBodyWhenAttachmentsAreUnavailable;

/// The window level for the email composer on iOS 7 or later. Defaults to UIWindowLevelStatusBar + 3.0.
/// The window level for the email composer. Defaults to UIWindowLevelStatusBar + 3.0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the + 3 hack continues to give me joy. So many years later and it still works.

Sources/AardvarkMailUI/ARKEmailBugReporter.m Outdated Show resolved Hide resolved
NSError *error = nil;
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:NO error:&error];

ARKCheckCondition(error == nil, , @"Couldn't archive object %@", object);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice update

@@ -143,7 +139,10 @@ - (void)readObjectsFromArchiveWithCompletionHandler:(nonnull void (^)(NSArray *

id object = nil;
@try {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 file an issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as #93

NickEntin and others added 2 commits November 18, 2020 13:44
Co-authored-by: Dan Federman <dfed@me.com>
Co-authored-by: Dan Federman <dfed@me.com>
@NickEntin NickEntin merged commit 2199075 into develop/aardvark-4.0 Dec 9, 2020
@NickEntin NickEntin deleted the entin/ios-12-minimum branch December 9, 2020 00:27
@NickEntin NickEntin mentioned this pull request Dec 23, 2020
NickEntin added a commit that referenced this pull request Feb 22, 2021
* Bump deployment target to iOS 12 and watchOS 4
* Bump Swift version to 5.0
* Adopt recommended project setting
* Migrate to stringByAddingPercentEncodingWithAllowedCharacters
* Migrate to UIAlertController
* Add watchOS version requirement to README

Co-authored-by: Dan Federman <dfed@me.com>
Co-authored-by: Justin Steffen <jsteffen@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xcode 12 Support
3 participants