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

Fix build on Xcode 15 #1170

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions App/View Controllers/AnnouncementViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,8 @@ private struct RenderModel: CustomDebugStringConvertible, Equatable, StencilCont
return "ipad"
case .phone:
return "iphone"
case .carPlay, .tv, .unspecified:
case .carPlay, .mac, .tv, .unspecified, .vision:
fallthrough
#if swift(>=5.3)
case .mac:
fallthrough
#endif
@unknown default:
assertionFailure("handle unknown user interface idiom")
return "iphone"
Expand Down
9 changes: 8 additions & 1 deletion Awful.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,6 @@
TargetAttributes = {
1C3A143219DFC5D10022C44C = {
CreatedOnToolsVersion = 6.0.1;
DevelopmentTeam = 9RR6L9X39A;
};
1C56972024C3F1900077CA62 = {
CreatedOnToolsVersion = 12.0;
Expand Down Expand Up @@ -2129,6 +2128,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "";
INFOPLIST_FILE = "Smilies Extra/Extractor/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -2143,6 +2143,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "";
INFOPLIST_FILE = "Smilies Extra/Extractor/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -2477,6 +2478,7 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = App/Tests/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = ca.nolanw.Awful.Tests;
Expand All @@ -2495,6 +2497,7 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = App/Tests/Info.plist;
Expand All @@ -2514,9 +2517,11 @@
PRODUCT_BUNDLE_IDENTIFIER = com.awfulapp.Awful.debug;
PRODUCT_MODULE_NAME = Awful;
PRODUCT_NAME = AwfulDebug;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OBJC_BRIDGING_HEADER = "App/Main/Awful-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -2530,8 +2535,10 @@
PRODUCT_BUNDLE_IDENTIFIER = com.awfulapp.Awful;
PRODUCT_MODULE_NAME = Awful;
PRODUCT_NAME = Awful;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "App/Main/Awful-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ internal class AsynchronousOperation<T>: Foundation.Operation {

extension AsynchronousOperation {

/// Finds the first `AsynchronousOperation` among this operation's dependencies that resulted in a `T`. Throws an error if no such operation is found.
func firstDependencyValue<T>(ofType resultType: T.Type) throws -> T {
/// Finds the first `AsynchronousOperation` among this operation's dependencies that resulted in a `U`. Throws an error if no such operation is found.
func firstDependencyValue<U>(ofType resultType: U.Type) throws -> U {
let candidates = dependencies.lazy
.compactMap { $0 as? AsynchronousOperation<T> }
.compactMap { $0 as? AsynchronousOperation<U> }

for op in candidates.dropLast() {
if let value = op.result?.value {
Expand All @@ -105,7 +105,7 @@ extension AsynchronousOperation {
}

guard let lastResult = candidates.last?.result else {
throw MissingDependency(dependentResultValueType: T.self)
throw MissingDependency(dependentResultValueType: U.self)
}

return try lastResult.unwrap()
Expand Down
6 changes: 6 additions & 0 deletions Vendor/MRProgress/Sources/MRProgress/MRBlurView.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ - (void)didMoveToWindow {

- (void)registerForNotificationCenter {
NSNotificationCenter *center = NSNotificationCenter.defaultCenter;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[center addObserver:self
selector:@selector(statusBarOrientationDidChange:)
name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
#pragma clang diagnostic pop
}

- (void)unregisterFromNotificationCenter {
Expand Down Expand Up @@ -155,7 +158,10 @@ - (UIImage *)snapshot {

// Absolute origin of receiver
CGPoint origin = self.bounds.origin;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (UIInterfaceOrientationIsLandscape(UIApplication.sharedApplication.statusBarOrientation)) {
#pragma clang diagnostic pop
origin = CGPointMake(origin.y, origin.x);
}
origin = [self convertPoint:origin toView:window];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
static NSString *const MRCircularProgressViewProgressAnimationKey = @"MRCircularProgressViewProgressAnimationKey";


@interface MRCircularProgressView ()
@interface MRCircularProgressView () <CAAnimationDelegate>

@property (nonatomic, strong, readwrite) NSNumberFormatter *numberFormatter;
@property (nonatomic, strong, readwrite) NSTimer *valueLabelUpdateTimer;
Expand Down
3 changes: 2 additions & 1 deletion Vendor/MRProgress/Sources/MRProgress/MRProgressOverlayView.m
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ - (void)applyProgressAnimated:(BOOL)animated {
NSStringFromSelector(@selector(setProgress:animated:)));
#endif
}
[((id)self.modeView) setProgress:self.progress];
// `self.modeView` may not in fact be a `UIProgressView` but it's enough to tell the compiler that we want the `-setProgress:` that takes a `float` parameter.
[((UIProgressView *)self.modeView) setProgress:self.progress];
} else {
NSAssert(self.mode == MRProgressOverlayViewModeDeterminateCircular
|| self.mode == MRProgressOverlayViewModeDeterminateHorizontalBar,
Expand Down
3 changes: 3 additions & 0 deletions Vendor/PullToRefresh/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import PackageDescription

let package = Package(
name: "PullToRefresh",
platforms: [
.iOS(.v13),
],
products: [
.library(
name: "PullToRefresh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import UIKit
class DefaultRefreshView: UIView {

fileprivate(set) lazy var activityIndicator: UIActivityIndicatorView! = {
#if swift(>=4.2)
let activityIndicator = UIActivityIndicatorView(style: .gray)
#else
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
#endif
let activityIndicator = UIActivityIndicatorView(style: .medium)
self.addSubview(activityIndicator)
return activityIndicator
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ extension PullToRefresh {

fileprivate struct KVO {

static var context = "PullToRefreshKVOContext"
static var context = 0

enum ScrollViewPath {
static let contentOffset = #keyPath(UIScrollView.contentOffset)
Expand Down
Loading