#1734 (support for iOS and iPadOS 16, and Xcode 14)

- Updated project to Xcode 14.
- Updated Swift code to Swift 5.7.
- Tweaked the login view to avoid the logo behind the Dynamic Island on iPhone 14 Pro.
This commit is contained in:
David Sinclair 2022-09-25 20:35:46 -06:00
parent 6c012330b7
commit c671457fbe
11 changed files with 68 additions and 65 deletions

View file

@ -396,7 +396,7 @@ private extension DetailViewController {
appDelegate.updateSplitBehavior()
}
guard let storyPagesViewController = storyPagesViewController else {
guard let storyPagesViewController else {
return
}
@ -431,7 +431,7 @@ private extension DetailViewController {
}
func add(viewController: UIViewController?, to containerView: UIView) {
guard let viewController = viewController else {
guard let viewController else {
return
}
@ -449,7 +449,7 @@ private extension DetailViewController {
}
func remove(viewController: UIViewController?) {
guard let viewController = viewController else {
guard let viewController else {
return
}

View file

@ -105,7 +105,7 @@ class FeedsViewController: FeedsObjCViewController {
loadWorkItem?.cancel()
let workItem = DispatchWorkItem { [weak self] in
guard let self = self else {
guard let self else {
return
}
@ -122,7 +122,7 @@ class FeedsViewController: FeedsObjCViewController {
reloadWorkItem?.cancel()
let workItem = DispatchWorkItem { [weak self] in
guard let self = self else {
guard let self else {
return
}

View file

@ -17,7 +17,7 @@ class BarView: UIView {
var rightColor: UIColor?
override func draw(_ rect: CGRect) {
guard let leftColor = leftColor, let rightColor = rightColor, let context = UIGraphicsGetCurrentContext() else {
guard let leftColor, let rightColor = rightColor, let context = UIGraphicsGetCurrentContext() else {
return
}

View file

@ -164,7 +164,7 @@ class WidgetExtensionViewController: UITableViewController, NCWidgetProviding {
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
precondition(Thread.isMainThread, "Table access not on the main thread")
if let error = error {
if let error {
guard let cell = tableView.dequeueReusableCell(withIdentifier: WidgetErrorTableViewCell.reuseIdentifier, for: indexPath) as? WidgetErrorTableViewCell else {
preconditionFailure("Expected to dequeue a WidgetErrorTableViewCell")
}
@ -251,7 +251,7 @@ class WidgetExtensionViewController: UITableViewController, NCWidgetProviding {
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let error = error {
if let error {
if let appURL = URL(string: "newsblurwidget://?error=\(error.rawValue)") {
extensionContext?.open(appURL, completionHandler: nil)
}
@ -322,11 +322,11 @@ private extension WidgetExtensionViewController {
}
func hostURL(with path: String) -> URL? {
guard let host = host else {
guard let host else {
return nil
}
if let token = token {
if let token {
return URL(string: host + path + "&secret_token=\(token)")
} else {
return URL(string: host + path)
@ -478,7 +478,7 @@ private extension WidgetExtensionViewController {
}
func save(image: UIImage, to folderURL: URL?, for identifier: String) {
guard let folderURL = folderURL else {
guard let folderURL else {
return
}
@ -626,7 +626,7 @@ private extension WidgetExtensionViewController {
}
func loadCachedImage(folderURL: URL?, identifier: String) -> UIImage? {
guard let folderURL = folderURL else {
guard let folderURL else {
return nil
}

View file

@ -58,7 +58,7 @@ class Loader: NSObject, URLSessionDataDelegate {
}
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
if let error = error {
if let error {
completion(.failure(error))
} else {
completion(.success(receivedData))

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="WhitneySSm-Medium-Bas.otf">
@ -34,44 +36,40 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="Background.png" id="26">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" image="Background.png" translatesAutoresizingMaskIntoConstraints="NO" id="26">
<rect key="frame" x="0.0" y="85" width="320" height="415"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="logo_background.png" id="23">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" image="logo_background.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
<rect key="frame" x="0.0" y="-1" width="320" height="87"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" image="logo_newsblur_blur.png" id="22">
<rect key="frame" x="15" y="30" width="285" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" text="Authenticating..." textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" id="24">
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" fixedFrame="YES" text="Authenticating..." textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="24">
<rect key="frame" x="20" y="268" width="280" height="52"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" minimumFontSize="17" id="29">
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" fixedFrame="YES" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="29">
<rect key="frame" x="20" y="268" width="280" height="52"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
<color key="textColor" red="0.92408370969999998" green="0.35912829639999999" blue="0.23267127570000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.92408370969999998" green="0.35912829639999999" blue="0.23267127570000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" hidesWhenStopped="YES" style="white" id="25">
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" hidesWhenStopped="YES" style="white" translatesAutoresizingMaskIntoConstraints="NO" id="25">
<rect key="frame" x="71" y="284" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<scrollView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" indicatorStyle="black" id="31" userLabel="Scroll View">
<scrollView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" indicatorStyle="black" translatesAutoresizingMaskIntoConstraints="NO" id="31" userLabel="Scroll View">
<rect key="frame" x="0.0" y="86" width="320" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.89999997615814209" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="18" clearButtonMode="whileEditing" id="4">
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.89999997615814209" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="18" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="4">
<rect key="frame" x="20" y="67" width="280" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
@ -80,23 +78,23 @@
<outlet property="delegate" destination="-1" id="19"/>
</connections>
</textField>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" text="Username" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="5">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" text="Username" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="21" y="44" width="212" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Username or email" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="43">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" text="Username or email" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="43">
<rect key="frame" x="21" y="44" width="212" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.89999997615814209" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" clearsOnBeginEditing="YES" minimumFontSize="18" clearButtonMode="whileEditing" id="6">
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.89999997615814209" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" clearsOnBeginEditing="YES" minimumFontSize="18" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="6">
<rect key="frame" x="20" y="129" width="280" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
@ -105,54 +103,54 @@
<outlet property="delegate" destination="-1" id="20"/>
</connections>
</textField>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Password" lineBreakMode="tailTruncation" minimumFontSize="18" adjustsFontSizeToFit="NO" id="7">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" text="Password" lineBreakMode="tailTruncation" minimumFontSize="18" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="21" y="106" width="212" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="OPTIONAL" textAlignment="right" lineBreakMode="tailTruncation" minimumFontSize="7" adjustsFontSizeToFit="NO" id="34" userLabel="Label - OPTIONAL">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" text="OPTIONAL" textAlignment="right" lineBreakMode="tailTruncation" minimumFontSize="7" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="34" userLabel="Label - OPTIONAL">
<rect key="frame" x="199" y="112" width="101" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.69537210459999999" green="0.77874833349999995" blue="0.83360475300000003" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.69537210459999999" green="0.77874833349999995" blue="0.83360475300000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" text="Email" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="46" userLabel="Label - Email">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" text="Email" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="46" userLabel="Label - Email">
<rect key="frame" x="21" y="106" width="212" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
<segmentedControl contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" id="33">
<segmentedControl contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="33">
<rect key="frame" x="-4" y="0.0" width="329" height="30"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.91764712333679199" green="0.92156869173049927" blue="0.94117653369903564" alpha="1" colorSpace="deviceRGB"/>
<color key="backgroundColor" red="0.89736747741699219" green="0.90138375759124756" blue="0.92627149820327759" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<segments>
<segment title="LOGIN"/>
<segment title="SIGNUP"/>
</segments>
<color key="tintColor" white="0.94625342150000002" alpha="1" colorSpace="calibratedWhite"/>
<color key="tintColor" red="0.94625341892242432" green="0.94625341892242432" blue="0.94625341892242432" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="selectLoginSignup" destination="-1" eventType="valueChanged" id="42"/>
</connections>
</segmentedControl>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="ar5-A0-aF7" userLabel="OnePasswordButton">
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ar5-A0-aF7" userLabel="OnePasswordButton">
<rect key="frame" x="268" y="131" width="27" height="27"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<state key="normal" image="onepassword-button">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleColor" red="0.66666668653488159" green="0.66666668653488159" blue="0.66666668653488159" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="findLoginFrom1Password:" destination="-1" eventType="touchDown" id="AsK-1Q-ZHP"/>
</connections>
</button>
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.0" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" clearButtonMode="whileEditing" id="45">
<textField opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="45">
<rect key="frame" x="20" y="129" width="280" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="WhitneySSm-Medium" family="Whitney SSm" pointSize="17"/>
@ -166,7 +164,7 @@
<outlet property="delegate" destination="-1" id="32"/>
</connections>
</scrollView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="gZT-kz-374">
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gZT-kz-374">
<rect key="frame" x="96" y="328" width="123" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Forgot Password?"/>
@ -174,9 +172,14 @@
<action selector="forgotPassword:" destination="-1" eventType="touchUpInside" id="ZzX-Q3-ch5"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" fixedFrame="YES" image="logo_newsblur_blur.png" translatesAutoresizingMaskIntoConstraints="NO" id="22">
<rect key="frame" x="83" y="51" width="154" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.227029128" green="0.3621357764" blue="0.45652173909999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.227029128" green="0.3621357764" blue="0.45652173909999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="135.38461538461539" y="-1.4218009478672986"/>
</view>
</objects>
<resources>

View file

@ -364,7 +364,7 @@ extension ShareViewController: URLSessionTaskDelegate {
content.title = "NewsBlur"
if let error = error {
if let error {
print("task completed with error: \(error)")
NSLog("⚾️ share error: \(error)")
@ -399,7 +399,7 @@ extension ShareViewController: URLSessionTaskDelegate {
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.add(request) { (error) in
if let error = error {
if let error {
print("notification error: \(error)")
}
}

View file

@ -35,7 +35,7 @@ struct WidgetBarView: View {
}
// override func draw(_ rect: CGRect) {
// guard let leftColor = leftColor, let rightColor = rightColor, let context = UIGraphicsGetCurrentContext() else {
// guard let leftColor, let rightColor = rightColor, let context = UIGraphicsGetCurrentContext() else {
// return
// }
//

View file

@ -103,11 +103,11 @@ class WidgetCache {
}
func hostURL(with path: String) -> URL? {
guard let host = host else {
guard let host else {
return nil
}
if let token = token {
if let token {
return URL(string: host + path + "&secret_token=\(token)")
} else {
return URL(string: host + path)
@ -272,7 +272,7 @@ class WidgetCache {
}
func save(image: UIImage, to folderURL: URL?, for identifier: String) {
guard let folderURL = folderURL else {
guard let folderURL else {
return
}
@ -340,7 +340,7 @@ class WidgetCache {
}
func loadCachedImage(folderURL: URL?, identifier: String) -> UIImage? {
guard let folderURL = folderURL else {
guard let folderURL else {
return nil
}

View file

@ -72,7 +72,7 @@ class WidgetDebugTimer {
let totalDuration = date.timeIntervalSince(currentInfo.start)
guard let step = step else {
guard let step else {
NSLog("\(String(repeating: " ", count: currentInfo.level * 2))\(operation) took \(shared.formatter.string(from: NSNumber(value: totalDuration)) ?? "?") seconds")
return
}

View file

@ -58,7 +58,7 @@ class Loader: NSObject, URLSessionDataDelegate {
}
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
if let error = error {
if let error {
completion(.failure(error))
} else {
completion(.success(receivedData))