#817 (three column layout)

- Minimum requirements now iOS 14 and macOS 11.
This commit is contained in:
David Sinclair 2020-11-23 20:31:36 -08:00
parent e5fa0cdd64
commit 2abb52792c
4 changed files with 33 additions and 18 deletions

View file

@ -7,6 +7,7 @@
//
import UIKit
import UniformTypeIdentifiers
/// Singleton class to import or export the preferences.
class ImportExportPreferences: NSObject {
@ -30,14 +31,13 @@ class ImportExportPreferences: NSObject {
private extension ImportExportPreferences {
struct Constant {
static let fileType = "com.newsblur.preferences"
static let fileType = UTType(exportedAs: "com.newsblur.preferences")
static let fileName = "NewsBlur Preferences"
static let fileExtension = "newsblurprefs"
}
func importPreferences(from controller: UIViewController) {
let picker = UIDocumentPickerViewController(documentTypes: [Constant.fileType], in: .import)
let picker = UIDocumentPickerViewController(forOpeningContentTypes: [Constant.fileType], asCopy: false)
picker.delegate = self
@ -51,13 +51,7 @@ private extension ImportExportPreferences {
dictionary.write(to: prefsURL, atomically: true)
let picker: UIDocumentPickerViewController
if #available(iOS 11.0, *) {
picker = UIDocumentPickerViewController(urls: [prefsURL], in: .exportToService)
} else {
picker = UIDocumentPickerViewController(url: prefsURL, in: .exportToService)
}
let picker = UIDocumentPickerViewController(forExporting: [prefsURL])
controller.present(picker, animated: true, completion: nil)
}

View file

@ -2383,13 +2383,14 @@
// NSLog(@"changeWebViewWidth: %@ / %@ / %@", NSStringFromCGSize(self.view.bounds.size), NSStringFromCGSize(webView.scrollView.bounds.size), NSStringFromCGSize(webView.scrollView.contentSize));
NSInteger contentWidth = CGRectGetWidth(webView.scrollView.bounds);
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
NSString *contentWidthClass;
#if TARGET_OS_MACCATALYST
// CATALYST: probably will want to add custom CSS for Macs.
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide NB-width-768";
#else
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
if (UIInterfaceOrientationIsLandscape(orientation) && !self.isPhoneOrCompact) {
if (iPadPro12) {
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide";

View file

@ -65,7 +65,7 @@
1763E2A323B1CEB600BA080C /* WidgetBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1763E2A223B1CEB600BA080C /* WidgetBarView.swift */; };
176A5C7A24F8BD1B009E8DF9 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 176A5C7924F8BD1B009E8DF9 /* DetailViewController.swift */; };
17731A9D23DFAD3D00759A7D /* ImportExportPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17731A9C23DFAD3D00759A7D /* ImportExportPreferences.swift */; };
177551D5238E228A00E27818 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177551D4238E228A00E27818 /* NotificationCenter.framework */; };
177551D5238E228A00E27818 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177551D4238E228A00E27818 /* NotificationCenter.framework */; platformFilter = ios; };
177551DB238E228A00E27818 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 177551D9238E228A00E27818 /* MainInterface.storyboard */; };
177551DF238E228A00E27818 /* NewsBlur Latest.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 177551D3238E228A00E27818 /* NewsBlur Latest.appex */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
17813FB723AC6E450057FB16 /* WidgetErrorTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17CE3F0523AC529B003152EF /* WidgetErrorTableViewCell.xib */; };
@ -3674,7 +3674,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -3687,6 +3688,7 @@
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Debug;
};
@ -3722,7 +3724,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
INFOPLIST_FILE = "Share Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -3735,6 +3738,7 @@
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,6";
VALIDATE_PRODUCT = YES;
};
name = Release;
@ -3773,7 +3777,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Widget Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -3788,6 +3792,7 @@
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@ -3819,7 +3824,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Widget Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -3832,6 +3837,7 @@
PRODUCT_NAME = "NewsBlur Latest";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
@ -3861,6 +3867,8 @@
GCC_VERSION = "";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "NewsBlur-iPhone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@ -3881,6 +3889,7 @@
STRIP_INSTALLED_PRODUCT = NO;
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
TARGETED_DEVICE_FAMILY = "1,2,6";
"WARNING_CFLAGS[arch=*]" = "-Wall";
};
name = Debug;
@ -3909,6 +3918,8 @@
GCC_VERSION = "";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "NewsBlur-iPhone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@ -3927,6 +3938,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
TARGETED_DEVICE_FAMILY = "1,2,6";
VALIDATE_PRODUCT = YES;
};
name = Release;
@ -4065,7 +4077,8 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Story Notification Service Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.1;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -4078,6 +4091,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Debug;
};
@ -4104,7 +4118,8 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = "Story Notification Service Extension/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.1;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 14.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -4117,6 +4132,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,6";
VALIDATE_PRODUCT = YES;
};
name = Release;

View file

@ -2,9 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.newsblur.NewsBlur-Group</string>
</array>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>