Skip to content

Commit

Permalink
Improve iOS 16 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 12, 2022
1 parent 113ac89 commit ded67bc
Show file tree
Hide file tree
Showing 38 changed files with 168 additions and 336 deletions.
4 changes: 2 additions & 2 deletions Action Extension/MainScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct MainScreen: View {

var body: some View {
ZStack {
if let image = image {
if let image {
EditorScreen(
image: .constant(image),
blurAmount: $blurAmount
Expand Down Expand Up @@ -102,7 +102,7 @@ struct MainScreen: View {

// TODO: Force the following to execute in a background thread.
do {
return try await itemProvider.getImage(maxSize: Constants.maxImageSize)
return try await itemProvider.getImage(maxPixelSize: Constants.maxImagePixelSize)
} catch {
SSApp.reportError(
error,
Expand Down
106 changes: 2 additions & 104 deletions Action Extension/Media.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,111 +1,9 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "Icon-Notification.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-Small.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-Small-40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "icon.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 12 additions & 18 deletions Blear.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
E3DFE28B25422D4500B3F299 /* AboutScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3DFE28A25422D4500B3F299 /* AboutScreen.swift */; };
E3DFE29C254390AB00B3F299 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E3DFE29B254390AB00B3F299 /* Media.xcassets */; };
E3DFE29E254390AB00B3F299 /* ActionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3DFE29D254390AB00B3F299 /* ActionViewController.swift */; };
E3DFE2A5254390AB00B3F299 /* Action Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = E3DFE299254390AB00B3F299 /* Action Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
E3DFE2A5254390AB00B3F299 /* Action Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = E3DFE299254390AB00B3F299 /* Action Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
E3DFE2AD254390D000B3F299 /* MainScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3DFE2AC254390D000B3F299 /* MainScreen.swift */; };
E3DFE2B22543923B00B3F299 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3A0368E17E6214500892B76 /* Utilities.swift */; };
E3DFE2B52543923E00B3F299 /* EditorScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E35850572541D24200F9D5BD /* EditorScreen.swift */; };
Expand All @@ -42,15 +42,15 @@
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
E3DFE2A6254390AB00B3F299 /* Embed App Extensions */ = {
E3DFE2A6254390AB00B3F299 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
E3DFE2A5254390AB00B3F299 /* Action Extension.appex in Embed App Extensions */,
E3DFE2A5254390AB00B3F299 /* Action Extension.appex in Embed Foundation Extensions */,
);
name = "Embed App Extensions";
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -108,7 +108,6 @@
E3DFE29A254390AB00B3F299 /* Action Extension */,
E3B0ED1522CCE084001D4F9E /* Vendor */,
E3A0364717E5E7AE00892B76 /* Products */,
E3C3BAE3255D83DD008FF129 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -164,13 +163,6 @@
path = UIImageEffects;
sourceTree = "<group>";
};
E3C3BAE3255D83DD008FF129 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
E3DFE29A254390AB00B3F299 /* Action Extension */ = {
isa = PBXGroup;
children = (
Expand All @@ -193,7 +185,7 @@
E3A0364217E5E7AE00892B76 /* Sources */,
E3A0364317E5E7AE00892B76 /* Frameworks */,
E3A0364417E5E7AE00892B76 /* Resources */,
E3DFE2A6254390AB00B3F299 /* Embed App Extensions */,
E3DFE2A6254390AB00B3F299 /* Embed Foundation Extensions */,
);
buildRules = (
);
Expand Down Expand Up @@ -238,7 +230,7 @@
attributes = {
CLASSPREFIX = "";
LastSwiftUpdateCheck = 1210;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1400;
ORGANIZATIONNAME = "Sindre Sorhus";
TargetAttributes = {
E3A0364517E5E7AE00892B76 = {
Expand Down Expand Up @@ -295,6 +287,7 @@
/* Begin PBXShellScriptBuildPhase section */
E36313F31F2D725D00D12229 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -306,6 +299,7 @@
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "swiftlint\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -398,7 +392,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -448,7 +442,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
Expand Down Expand Up @@ -609,15 +603,15 @@
repositoryURL = "https://github.com/sindresorhus/Defaults";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.2.1;
minimumVersion = 6.3.0;
};
};
E31C26B1282D301B0047A564 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/getsentry/sentry-cocoa";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 7.15.0;
minimumVersion = 7.25.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
12 changes: 8 additions & 4 deletions Blear/AboutScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ struct AboutScreen: View {

var body: some View {
NavigationView {
// NavigationStack {
Form {
Section(
header: Text("\(SSApp.name) \(SSApp.version)"),
footer: Text("\n\(SSApp.name) was made with ♥ by Sindre Sorhus, an indie app developer from Norway.\n\nIf you enjoy using this app, please consider leaving a review on the App Store. It helps more than you can imagine.")
) {
Section {} // For padding
Section {
SendFeedbackButton()
Link("Website", destination: "https://sindresorhus.com/blear")
RateOnAppStoreButton(appStoreID: "994182280")
MoreAppsButton()
} footer: {
Text(markdown: "\n\n**\(SSApp.name) \(SSApp.version)**\n\nMade with ♥ by Sindre Sorhus\nan indie app developer from Norway\n\n.·:*¨༺ ༻¨*:·.\n\nIf you enjoy using this app, please consider leaving a review on the App Store. It helps more than you can imagine.")
.multilineTextAlignment(.center)
.frame(maxWidth: 370) // Make it look good on iPad.
.fillFrame(.horizontal)
}
}
.navigationTitle("About")
Expand Down
5 changes: 5 additions & 0 deletions Blear/App.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import SwiftUI

/**
TODO:
- Use vector icon for the action extension icon.
*/

@main
struct AppMain: App {
@StateObject private var appState = AppState()
Expand Down
Loading

0 comments on commit ded67bc

Please sign in to comment.