From 1947f378eb1a3f729054f8ac61dd2c9a186644cd Mon Sep 17 00:00:00 2001 From: Mike Mertsock Date: Fri, 1 Mar 2024 19:49:48 -0500 Subject: [PATCH 1/4] Target iOS 15 --- ORK1Kit/ORK1Kit.xcodeproj/project.pbxproj | 12 ++++++++---- .../xcshareddata/xcschemes/ORK1Kit.xcscheme | 2 +- .../xcshareddata/xcschemes/docs.xcscheme | 2 +- ResearchKit.xcodeproj/project.pbxproj | 10 +++++++--- .../xcshareddata/xcschemes/ResearchKit.xcscheme | 2 +- .../xcshareddata/xcschemes/docs.xcscheme | 2 +- .../xcshareddata/xcschemes/ORKTest.xcscheme | 2 +- ...rkinsonStudy WatchKit App (Complication).xcscheme | 2 +- ...rkinsonStudy WatchKit App (Notification).xcscheme | 2 +- .../ORKParkinsonStudy WatchKit App.xcscheme | 2 +- 10 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ORK1Kit/ORK1Kit.xcodeproj/project.pbxproj b/ORK1Kit/ORK1Kit.xcodeproj/project.pbxproj index 168f6c43e..89bfb922e 100644 --- a/ORK1Kit/ORK1Kit.xcodeproj/project.pbxproj +++ b/ORK1Kit/ORK1Kit.xcodeproj/project.pbxproj @@ -435,7 +435,7 @@ 9550E6741D58DBCF00C691B8 /* ORK1TouchAnywhereStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E6721D58DBCF00C691B8 /* ORK1TouchAnywhereStep.m */; }; 9550E67C1D58DD2000C691B8 /* ORK1TouchAnywhereStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E67A1D58DD2000C691B8 /* ORK1TouchAnywhereStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9550E67D1D58DD2000C691B8 /* ORK1TouchAnywhereStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E67B1D58DD2000C691B8 /* ORK1TouchAnywhereStepViewController.m */; }; - 959A2BFC1D68B98700841B04 /* ORK1RangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORK1RangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 959A2BFC1D68B98700841B04 /* ORK1RangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORK1RangeOfMotionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 959A2BFD1D68B98700841B04 /* ORK1RangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFB1D68B98700841B04 /* ORK1RangeOfMotionStep.m */; }; 959A2C001D68B9DA00841B04 /* ORK1RangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFE1D68B9DA00841B04 /* ORK1RangeOfMotionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 959A2C011D68B9DA00841B04 /* ORK1RangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFF1D68B9DA00841B04 /* ORK1RangeOfMotionStepViewController.m */; }; @@ -3019,7 +3019,7 @@ BuildIndependentTargetsInParallel = YES; CLASSPREFIX = ORK1; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1520; ORGANIZATIONNAME = researchkit.org; TargetAttributes = { 86CC8E991AC09332001CCD89 = { @@ -3539,6 +3539,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -3553,7 +3554,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.7; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_VERSION = 4.0; @@ -3593,6 +3594,7 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3601,7 +3603,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.7; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -3679,6 +3681,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3721,6 +3724,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/ORK1Kit/ORK1Kit.xcodeproj/xcshareddata/xcschemes/ORK1Kit.xcscheme b/ORK1Kit/ORK1Kit.xcodeproj/xcshareddata/xcschemes/ORK1Kit.xcscheme index 6cf637f68..4a5162876 100644 --- a/ORK1Kit/ORK1Kit.xcodeproj/xcshareddata/xcschemes/ORK1Kit.xcscheme +++ b/ORK1Kit/ORK1Kit.xcodeproj/xcshareddata/xcschemes/ORK1Kit.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 1 Mar 2024 19:51:58 -0500 Subject: [PATCH 2/4] setContentEdgeInsetsIgnoringDeprecation --- ORK1Kit/ORK1Kit/Common/ORK1ContinueButton.m | 3 ++- ORK1Kit/ORK1Kit/Common/ORK1Helpers.m | 11 +++++++++++ ORK1Kit/ORK1Kit/Common/ORK1Helpers_Internal.h | 4 ++++ ORK1Kit/ORK1Kit/Common/ORK1NavigationContainerView.m | 2 +- .../ORK1Kit/Common/ORK1PasscodeStepViewController.m | 2 +- .../ORK1Kit/Common/ORK1SignatureStepViewController.m | 3 ++- ORK1Kit/ORK1Kit/Common/ORK1StepHeaderView.m | 2 +- .../ActiveTasks/ORKSpatialSpanMemoryContentView.m | 2 +- ResearchKit/Common/ORKContinueButton.m | 3 ++- ResearchKit/Common/ORKHelpers.m | 11 +++++++++++ ResearchKit/Common/ORKHelpers_Internal.h | 4 ++++ ResearchKit/Common/ORKPDFViewerStepView.m | 4 ++-- ResearchKit/Common/ORKPasscodeStepViewController.m | 2 +- ResearchKit/Common/ORKSignatureStepViewController.m | 2 +- ResearchKit/Common/ORKStepHeaderView.m | 2 +- 15 files changed, 45 insertions(+), 12 deletions(-) diff --git a/ORK1Kit/ORK1Kit/Common/ORK1ContinueButton.m b/ORK1Kit/ORK1Kit/Common/ORK1ContinueButton.m index b920e51ed..f9116dc6b 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1ContinueButton.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1ContinueButton.m @@ -34,6 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORK1Skin.h" #import "CEVRK1Theme.h" +#import "ORK1Helpers_Internal.h" static const CGFloat ContinueButtonTouchMargin = 10; @@ -48,7 +49,7 @@ - (instancetype)initWithTitle:(NSString *)title isDoneButton:(BOOL)isDoneButton if (self) { [self setTitle:title forState:UIControlStateNormal]; self.isDoneButton = isDoneButton; - self.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; + [self setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){.left = 6, .right = 6}]; [self setUpConstraints]; } diff --git a/ORK1Kit/ORK1Kit/Common/ORK1Helpers.m b/ORK1Kit/ORK1Kit/Common/ORK1Helpers.m index 3c062ba71..991c0370d 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1Helpers.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1Helpers.m @@ -559,3 +559,14 @@ void ORK1DisablePasswordAutofill(id input) { [superview insertSubview:textField atIndex:0]; } } + +@implementation UIButton (Deprecations) + +- (void)setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets)value { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" + self.contentEdgeInsets = value; +#pragma clang diagnostic pop +} + +@end diff --git a/ORK1Kit/ORK1Kit/Common/ORK1Helpers_Internal.h b/ORK1Kit/ORK1Kit/Common/ORK1Helpers_Internal.h index bc053e8e3..ec1102ad4 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1Helpers_Internal.h +++ b/ORK1Kit/ORK1Kit/Common/ORK1Helpers_Internal.h @@ -381,4 +381,8 @@ ORK1_EXTERN NSBundle *ORK1DefaultLocaleBundle(void); #define ORK1LocalizedStringFromNumber(number) \ [NSNumberFormatter localizedStringFromNumber:number numberStyle:NSNumberFormatterNoStyle] +@interface UIButton (Deprecations) +- (void)setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets)value; +@end + NS_ASSUME_NONNULL_END diff --git a/ORK1Kit/ORK1Kit/Common/ORK1NavigationContainerView.m b/ORK1Kit/ORK1Kit/Common/ORK1NavigationContainerView.m index 474971d09..ffa91477f 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1NavigationContainerView.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1NavigationContainerView.m @@ -50,7 +50,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self) { { _skipButton = [ORK1TextButton new]; - _skipButton.contentEdgeInsets = (UIEdgeInsets){12,10,8,10}; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin + [_skipButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){12,10,8,10}]; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin _skipButton.exclusiveTouch = YES; [_skipButton setTitle:nil forState:UIControlStateNormal]; [_skipButton addTarget:self action:@selector(skipButtonAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/ORK1Kit/ORK1Kit/Common/ORK1PasscodeStepViewController.m b/ORK1Kit/ORK1Kit/Common/ORK1PasscodeStepViewController.m index a39a072a9..7f38d82c0 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1PasscodeStepViewController.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1PasscodeStepViewController.m @@ -117,7 +117,7 @@ - (void)stepDidChange { CGFloat width = self.view.bounds.size.width - 2 * kForgotPasscodeHorizontalPadding; UIButton *forgotPasscodeButton = [ORK1TextButton new]; - forgotPasscodeButton.contentEdgeInsets = (UIEdgeInsets){12, 10, 8, 10}; + [forgotPasscodeButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){12, 10, 8, 10}]; forgotPasscodeButton.frame = CGRectMake(x, _originalForgotPasscodeY, width, kForgotPasscodeHeight); NSString *buttonTitle = [self forgotPasscodeButtonText]; diff --git a/ORK1Kit/ORK1Kit/Common/ORK1SignatureStepViewController.m b/ORK1Kit/ORK1Kit/Common/ORK1SignatureStepViewController.m index 653d9e3e6..e715739b8 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1SignatureStepViewController.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1SignatureStepViewController.m @@ -68,7 +68,8 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self) { { _clearButton = [ORK1TextButton new]; - _clearButton.contentEdgeInsets = (UIEdgeInsets){12,10,8,10}; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin + // insets adjusted to get correct vertical height from bottom of screen when aligned to margin + [_clearButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){12,10,8,10}]; _clearButton.exclusiveTouch = YES; [_clearButton setTitle:ORK1LocalizedString(@"BUTTON_CLEAR", nil) forState:UIControlStateNormal]; _clearButton.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/ORK1Kit/ORK1Kit/Common/ORK1StepHeaderView.m b/ORK1Kit/ORK1Kit/Common/ORK1StepHeaderView.m index d61daa8ee..23b9e9d33 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1StepHeaderView.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1StepHeaderView.m @@ -99,7 +99,7 @@ - (instancetype)initWithFrame:(CGRect)frame { { _learnMoreButton = [ORK1TextButton new]; - _learnMoreButton.contentEdgeInsets = (UIEdgeInsets){10,10,10,10}; + [_learnMoreButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){10,10,10,10}]; [_learnMoreButton setTitle:nil forState:UIControlStateNormal]; [_learnMoreButton addTarget:self action:@selector(learnMoreAction:) forControlEvents:UIControlEventTouchUpInside]; _learnMoreButton.exclusiveTouch = YES; diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m b/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m index 68c811ae6..3a786f346 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m +++ b/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m @@ -260,7 +260,7 @@ - (void)setFooterHidden:(BOOL)footerHidden { - (void)setButtonItem:(ORKBorderedButton *)buttonItem { _buttonItem = buttonItem; if (buttonItem) { - buttonItem.contentEdgeInsets = (UIEdgeInsets){.top = 2, .bottom = 2, .left = 8, .right = 8}; + [buttonItem setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){.top = 2, .bottom = 2, .left = 8, .right = 8}]; buttonItem.translatesAutoresizingMaskIntoConstraints = NO; [_continueView addSubview:buttonItem]; [[NSLayoutConstraint constraintWithItem:_buttonItem diff --git a/ResearchKit/Common/ORKContinueButton.m b/ResearchKit/Common/ORKContinueButton.m index 0dd87c56f..a65207bd7 100644 --- a/ResearchKit/Common/ORKContinueButton.m +++ b/ResearchKit/Common/ORKContinueButton.m @@ -33,6 +33,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSkin.h" +#import "ORKHelpers_Internal.h" static const CGFloat ContinueButtonTouchMargin = 10; @@ -46,7 +47,7 @@ - (instancetype)initWithTitle:(NSString *)title isDoneButton:(BOOL)isDoneButton if (self) { [self setTitle:title forState:UIControlStateNormal]; self.isDoneButton = isDoneButton; - self.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; + [self setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){.left = 6, .right = 6}]; [self setUpConstraints]; } diff --git a/ResearchKit/Common/ORKHelpers.m b/ResearchKit/Common/ORKHelpers.m index 0309002b2..04bde99d1 100644 --- a/ResearchKit/Common/ORKHelpers.m +++ b/ResearchKit/Common/ORKHelpers.m @@ -563,3 +563,14 @@ void ORKDisablePasswordAutofill(id input) { [superview insertSubview:textField atIndex:0]; } } + +@implementation UIButton (Deprecations) + +- (void)setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets)value { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" + self.contentEdgeInsets = value; +#pragma clang diagnostic pop +} + +@end diff --git a/ResearchKit/Common/ORKHelpers_Internal.h b/ResearchKit/Common/ORKHelpers_Internal.h index b4b9d9fdb..cb63b0c12 100644 --- a/ResearchKit/Common/ORKHelpers_Internal.h +++ b/ResearchKit/Common/ORKHelpers_Internal.h @@ -381,4 +381,8 @@ ORK_EXTERN NSBundle *ORKDefaultLocaleBundle(void); #define ORKLocalizedStringFromNumber(number) \ [NSNumberFormatter localizedStringFromNumber:number numberStyle:NSNumberFormatterNoStyle] +@interface UIButton (Deprecations) +- (void)setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets)value; +@end + NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKPDFViewerStepView.m b/ResearchKit/Common/ORKPDFViewerStepView.m index 4ce37244f..bfa0839b4 100644 --- a/ResearchKit/Common/ORKPDFViewerStepView.m +++ b/ResearchKit/Common/ORKPDFViewerStepView.m @@ -161,7 +161,7 @@ - (void)setupClearAnnotationsButton { if (!_clearAnnotationsButton) { _clearAnnotationsButton = [ORKBorderedButton new]; } - _clearAnnotationsButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; + [_clearAnnotationsButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){.left = 6, .right = 6}]; _clearAnnotationsButton.translatesAutoresizingMaskIntoConstraints = NO; _clearButtonView = [UIView new]; _clearButtonView.translatesAutoresizingMaskIntoConstraints = NO; @@ -197,7 +197,7 @@ - (void)setupApplyAnnotationsButton { if (!_applyAnnotationsButton) { _applyAnnotationsButton = [ORKBorderedButton new]; } - _applyAnnotationsButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; + [_applyAnnotationsButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){.left = 6, .right = 6}]; _applyAnnotationsButton.translatesAutoresizingMaskIntoConstraints = NO; _applyButtonView = [UIView new]; _applyButtonView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/ResearchKit/Common/ORKPasscodeStepViewController.m b/ResearchKit/Common/ORKPasscodeStepViewController.m index 98707d321..405bc50db 100644 --- a/ResearchKit/Common/ORKPasscodeStepViewController.m +++ b/ResearchKit/Common/ORKPasscodeStepViewController.m @@ -132,7 +132,7 @@ - (void)stepDidChange { CGFloat width = self.view.bounds.size.width - 2 * kForgotPasscodeHorizontalPadding; UIButton *forgotPasscodeButton = [ORKTextButton new]; - forgotPasscodeButton.contentEdgeInsets = (UIEdgeInsets){12, 10, 8, 10}; + [forgotPasscodeButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){12, 10, 8, 10}]; forgotPasscodeButton.frame = CGRectMake(x, _originalForgotPasscodeY, width, kForgotPasscodeHeight); NSString *buttonTitle = [self forgotPasscodeButtonText]; diff --git a/ResearchKit/Common/ORKSignatureStepViewController.m b/ResearchKit/Common/ORKSignatureStepViewController.m index e17c039b6..1c13157c5 100644 --- a/ResearchKit/Common/ORKSignatureStepViewController.m +++ b/ResearchKit/Common/ORKSignatureStepViewController.m @@ -70,7 +70,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self) { { _clearButton = [ORKTextButton new]; - _clearButton.contentEdgeInsets = (UIEdgeInsets){12,10,8,10}; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin + [_clearButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){12,10,8,10}]; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin _clearButton.exclusiveTouch = YES; [_clearButton setTitle:ORKLocalizedString(@"BUTTON_CLEAR", nil) forState:UIControlStateNormal]; _clearButton.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/ResearchKit/Common/ORKStepHeaderView.m b/ResearchKit/Common/ORKStepHeaderView.m index 47a05f594..48f0a3320 100644 --- a/ResearchKit/Common/ORKStepHeaderView.m +++ b/ResearchKit/Common/ORKStepHeaderView.m @@ -98,7 +98,7 @@ - (instancetype)initWithFrame:(CGRect)frame { { _learnMoreButton = [ORKTextButton new]; _learnMoreButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading; - _learnMoreButton.contentEdgeInsets = (UIEdgeInsets){10,0,10,10}; + [_learnMoreButton setContentEdgeInsetsIgnoringDeprecation:(UIEdgeInsets){10,0,10,10}]; [_learnMoreButton setTitle:nil forState:UIControlStateNormal]; [_learnMoreButton addTarget:self action:@selector(learnMoreAction:) forControlEvents:UIControlEventTouchUpInside]; _learnMoreButton.exclusiveTouch = YES; From f280f8613f1e6b40ef8467ed2f02c4b22b7faae6 Mon Sep 17 00:00:00 2001 From: Mike Mertsock Date: Fri, 1 Mar 2024 19:54:44 -0500 Subject: [PATCH 3/4] Address other warnings --- ORK1Kit/ORK1Kit/Common/ORK1ChoiceViewCell.m | 3 +++ .../Common/ORK1DocumentSelectionStepViewController.m | 3 ++- ORK1Kit/ORK1Kit/Common/ORK1TextButton.m | 3 +++ ORK1Kit/ORK1Kit/Consent/ORK1EAGLMoviePlayerView.m | 3 ++- ResearchKit.xcodeproj/project.pbxproj | 2 +- ResearchKit/Common/ORKChoiceViewCell.m | 3 +++ ResearchKit/Common/ORKTextButton.m | 5 ++++- ResearchKit/Consent/ORKEAGLMoviePlayerView.m | 3 ++- Testing/ORKTest/ORKTest/MainViewController.m | 8 ++++---- 9 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ORK1Kit/ORK1Kit/Common/ORK1ChoiceViewCell.m b/ORK1Kit/ORK1Kit/Common/ORK1ChoiceViewCell.m index d6825135e..eb3a25832 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1ChoiceViewCell.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1ChoiceViewCell.m @@ -167,7 +167,10 @@ - (UIButton *)detailTextIndicator { if (_detailTextIndicator == nil) { _detailTextIndicator = [UIButton buttonWithType:UIButtonTypeInfoDark]; CGFloat inset = (DetailTextIndicatorTouchTargetWidth - DetailTextIndicatorImageWidth) / 2; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" _detailTextIndicator.imageEdgeInsets = UIEdgeInsetsMake(inset, inset, inset, inset); +#pragma clang diagnostic pop [self.contentView addSubview:_detailTextIndicator]; [_detailTextIndicator addTarget:self action:@selector(toggleDetailText) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/ORK1Kit/ORK1Kit/Common/ORK1DocumentSelectionStepViewController.m b/ORK1Kit/ORK1Kit/Common/ORK1DocumentSelectionStepViewController.m index 98462a71c..572679328 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1DocumentSelectionStepViewController.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1DocumentSelectionStepViewController.m @@ -48,6 +48,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import MobileCoreServices; @import Photos; @import PhotosUI; +@import UniformTypeIdentifiers.UTCoreTypes; @interface ORK1DocumentSelectionStepViewController () @@ -220,7 +221,7 @@ - (void)presentAuthorizedPicker:(UIImagePickerControllerSourceType)sourceType { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = sourceType; - picker.mediaTypes = @[(NSString *)kUTTypeImage]; + picker.mediaTypes = @[UTTypeImage.identifier]; if (sourceType == UIImagePickerControllerSourceTypeCamera) { switch (self.documentSelectionStep.preferredCameraPosition) { diff --git a/ORK1Kit/ORK1Kit/Common/ORK1TextButton.m b/ORK1Kit/ORK1Kit/Common/ORK1TextButton.m index 6f7216274..f002e14d6 100644 --- a/ORK1Kit/ORK1Kit/Common/ORK1TextButton.m +++ b/ORK1Kit/ORK1Kit/Common/ORK1TextButton.m @@ -110,8 +110,11 @@ - (CGSize)intrinsicContentSize { if (label && label.preferredMaxLayoutWidth > 0 && self.currentTitle.length > 0) { CGSize labelSize = [self.titleLabel sizeThatFits:CGSizeMake(self.titleLabel.preferredMaxLayoutWidth, CGFLOAT_MAX)]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" CGFloat verticalPadding = MAX(self.contentEdgeInsets.top, self.titleEdgeInsets.top) + MAX(self.contentEdgeInsets.bottom, self.titleEdgeInsets.bottom); CGFloat horizontalPadding = MAX(self.contentEdgeInsets.left, self.titleEdgeInsets.left) + MAX(self.contentEdgeInsets.right, self.titleEdgeInsets.right); +#pragma clang diagnostic pop return CGSizeMake(labelSize.width+horizontalPadding, labelSize.height+verticalPadding); diff --git a/ORK1Kit/ORK1Kit/Consent/ORK1EAGLMoviePlayerView.m b/ORK1Kit/ORK1Kit/Consent/ORK1EAGLMoviePlayerView.m index a25cdf77c..e04ec09ba 100644 --- a/ORK1Kit/ORK1Kit/Consent/ORK1EAGLMoviePlayerView.m +++ b/ORK1Kit/ORK1Kit/Consent/ORK1EAGLMoviePlayerView.m @@ -369,13 +369,14 @@ - (BOOL)consumePixelBuffer:(CVPixelBufferRef)pixelBuffer { /* Use the color attachment of the pixel buffer to determine the appropriate color conversion matrix. */ - CFTypeRef colorAttachments = CVBufferGetAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); + CFTypeRef colorAttachments = CVBufferCopyAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); if (colorAttachments == kCVImageBufferYCbCrMatrix_ITU_R_601_4) { self.preferredConversion = ColorConversion601; } else { self.preferredConversion = ColorConversion709; } + CFRelease(colorAttachments); /* CVOpenGLESTextureCacheCreateTextureFromImage will create GLES texture optimally from CVPixelBufferRef. diff --git a/ResearchKit.xcodeproj/project.pbxproj b/ResearchKit.xcodeproj/project.pbxproj index f589276d6..e05f7cdaf 100644 --- a/ResearchKit.xcodeproj/project.pbxproj +++ b/ResearchKit.xcodeproj/project.pbxproj @@ -521,7 +521,7 @@ 9550E6741D58DBCF00C691B8 /* ORKTouchAnywhereStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E6721D58DBCF00C691B8 /* ORKTouchAnywhereStep.m */; }; 9550E67C1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E67A1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9550E67D1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E67B1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m */; }; - 959A2BFC1D68B98700841B04 /* ORKRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 959A2BFC1D68B98700841B04 /* ORKRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 959A2BFD1D68B98700841B04 /* ORKRangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFB1D68B98700841B04 /* ORKRangeOfMotionStep.m */; }; 959A2C001D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFE1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 959A2C011D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFF1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m */; }; diff --git a/ResearchKit/Common/ORKChoiceViewCell.m b/ResearchKit/Common/ORKChoiceViewCell.m index 17685e67d..393a21afd 100644 --- a/ResearchKit/Common/ORKChoiceViewCell.m +++ b/ResearchKit/Common/ORKChoiceViewCell.m @@ -292,7 +292,10 @@ - (UIButton *)detailTextIndicator { if (_detailTextIndicator == nil) { _detailTextIndicator = [UIButton buttonWithType:UIButtonTypeInfoDark]; CGFloat inset = (DetailTextIndicatorTouchTargetWidth - DetailTextIndicatorImageWidth) / 2; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" _detailTextIndicator.imageEdgeInsets = UIEdgeInsetsMake(inset, inset, inset, inset); +#pragma clang diagnostic pop [self.contentView addSubview:_detailTextIndicator]; [_detailTextIndicator addTarget:self action:@selector(toggleDetailText) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/ResearchKit/Common/ORKTextButton.m b/ResearchKit/Common/ORKTextButton.m index 4c34003fa..c84cd2f17 100644 --- a/ResearchKit/Common/ORKTextButton.m +++ b/ResearchKit/Common/ORKTextButton.m @@ -109,9 +109,12 @@ - (CGSize)intrinsicContentSize { // Calling self.titleLabel at here can cause weird layout error. if (label && label.preferredMaxLayoutWidth > 0 && self.currentTitle.length > 0) { CGSize labelSize = [self.titleLabel sizeThatFits:CGSizeMake(self.titleLabel.preferredMaxLayoutWidth, CGFLOAT_MAX)]; - + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated" CGFloat verticalPadding = MAX(self.contentEdgeInsets.top, self.titleEdgeInsets.top) + MAX(self.contentEdgeInsets.bottom, self.titleEdgeInsets.bottom); CGFloat horizontalPadding = MAX(self.contentEdgeInsets.left, self.titleEdgeInsets.left) + MAX(self.contentEdgeInsets.right, self.titleEdgeInsets.right); +#pragma clang diagnostic pop return CGSizeMake(labelSize.width+horizontalPadding, labelSize.height+verticalPadding); diff --git a/ResearchKit/Consent/ORKEAGLMoviePlayerView.m b/ResearchKit/Consent/ORKEAGLMoviePlayerView.m index 4e953f5f8..e72bbeae6 100644 --- a/ResearchKit/Consent/ORKEAGLMoviePlayerView.m +++ b/ResearchKit/Consent/ORKEAGLMoviePlayerView.m @@ -369,13 +369,14 @@ - (BOOL)consumePixelBuffer:(CVPixelBufferRef)pixelBuffer { /* Use the color attachment of the pixel buffer to determine the appropriate color conversion matrix. */ - CFTypeRef colorAttachments = CVBufferGetAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); + CFTypeRef colorAttachments = CVBufferCopyAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); if (colorAttachments == kCVImageBufferYCbCrMatrix_ITU_R_601_4) { self.preferredConversion = ColorConversion601; } else { self.preferredConversion = ColorConversion709; } + CFRelease(colorAttachments); /* CVOpenGLESTextureCacheCreateTextureFromImage will create GLES texture optimally from CVPixelBufferRef. diff --git a/Testing/ORKTest/ORKTest/MainViewController.m b/Testing/ORKTest/ORKTest/MainViewController.m index 0aca88288..708778dae 100644 --- a/Testing/ORKTest/ORKTest/MainViewController.m +++ b/Testing/ORKTest/ORKTest/MainViewController.m @@ -46,7 +46,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import AVFoundation; -NSArray *> *> *TestButtonTable() +NSArray *> *> *TestButtonTable(void) { return @[ @{ @"Active Tasks": @@ -168,7 +168,7 @@ - (instancetype)initWithFrame:(CGRect)frame { return self; } -static UIColor *HeaderColor() { +static UIColor *HeaderColor(void) { return [UIColor colorWithWhite:0.97 alpha:1.0]; } @@ -427,7 +427,7 @@ - (void)beginTaskWithIdentifier:(NSString *)identifier { if (_savedViewControllers[identifier]) { NSData *data = _savedViewControllers[identifier]; - _taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:data delegate:self]; + _taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:data delegate:self error:NULL]; } else { // No saved data, just create the task and the corresponding task view controller. _taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:[NSUUID UUID]]; @@ -436,7 +436,7 @@ - (void)beginTaskWithIdentifier:(NSString *)identifier { // If we have stored data then data will contain the stored data. // If we don't, data will be nil (and the task will be opened up as a 'new' task. NSData *data = _savedViewControllers[identifier]; - _taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:data delegate:self]; + _taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:data delegate:self error:NULL]; [self beginTask]; } From 70f0caefc9e054b6e23f576601273dd48001873b Mon Sep 17 00:00:00 2001 From: Mike Mertsock Date: Sat, 2 Mar 2024 08:45:51 -0500 Subject: [PATCH 4/4] Update CI for Xcode 15 --- .github/workflows/ci.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff084ab8b..2fd902400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,35 +4,28 @@ on: workflow_dispatch: jobs: build: - runs-on: macos-12 + runs-on: macos-14 env: - # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md - xcode: '/Applications/Xcode_14.0.1.app' - destination_ios16: 'platform=iOS Simulator,OS=16.0,name=iPhone 14' - destination_ios15: 'platform=iOS Simulator,OS=15.0,name=iPhone 13' + # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md + xcode: '/Applications/Xcode_15.2.app' + destination_ios17: 'platform=iOS Simulator,OS=17.2,name=iPhone 15' steps: - name: Checkout uses: actions/checkout@v2 with: token: ${{ secrets.CAREEVOLUTIONBUILD_TOKEN }} submodules: 'recursive' - - name: Link to Older Simulators - run: | - sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes - sudo ln -s /Applications/Xcode_13.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 15.0.simruntime - name: Build run: | set -o pipefail - xcodebuild build-for-testing -workspace 'RKWorkspace.xcworkspace' -scheme 'ORK1Kit' -destination '${{ env.destination_ios15 }}' -destination '${{ env.destination_ios16 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty - xcodebuild build-for-testing -workspace 'RKWorkspace.xcworkspace' -scheme 'ResearchKit' -destination '${{ env.destination_ios15 }}' -destination '${{ env.destination_ios16 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty + xcodebuild build-for-testing -workspace 'RKWorkspace.xcworkspace' -scheme 'ORK1Kit' -destination '${{ env.destination_ios17 }}' IS_TRAVIS_CI=true | xcpretty + xcodebuild build-for-testing -workspace 'RKWorkspace.xcworkspace' -scheme 'ResearchKit' -destination '${{ env.destination_ios17 }}' IS_TRAVIS_CI=true | xcpretty env: DEVELOPER_DIR: ${{ env.xcode }}/Contents/Developer - name: Test run: | set -o pipefail - xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ORK1Kit' -destination '${{ env.destination_ios16 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty - xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ORK1Kit' -destination '${{ env.destination_ios15 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty - xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ResearchKit' -destination '${{ env.destination_ios16 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty - xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ResearchKit' -destination '${{ env.destination_ios15 }}' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO IS_TRAVIS_CI=true | xcpretty + xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ORK1Kit' -destination '${{ env.destination_ios17 }}' IS_TRAVIS_CI=true | xcpretty + xcodebuild test-without-building -workspace 'RKWorkspace.xcworkspace' -scheme 'ResearchKit' -destination '${{ env.destination_ios17 }}' IS_TRAVIS_CI=true | xcpretty env: DEVELOPER_DIR: ${{ env.xcode }}/Contents/Developer