Merge pull request #4721 from stuartbreckenridge/experimental/modern-sidebars

Addressing Liquid Glass Tweaks
This commit is contained in:
Brent Simmons authored and GitHub committed 2025-08-16 11:38:06 -07:00
commit 0980e413da
42 files changed
+535 -2633

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
{
"permissions": {
"allow": [
"Bash(find:*)",
"Bash(grep:*)",
"Bash(ls:*)"
],
"deny": []
}
}
+12
View File
@@ -6,6 +6,18 @@
<description>Most recent NetNewsWire changes with links to updates.</description>
<language>en</language>
<item>
<title>NetNewsWire 6.1.10b3</title>
<description><![CDATA[
<ul>
<li>Fixed bug, introduced in previous test build, that prevented choosing an OPML file to import</li>
</ul>
]]></description>
<pubDate>Tue, 12 Aug 2025 10:10:00 -0700</pubDate>
<enclosure url="https://github.com/Ranchero-Software/NetNewsWire/releases/download/mac-6.1.10b3/NetNewsWire6.1.10b3.zip" sparkle:version="6138" sparkle:shortVersionString="6.1.10b3" length="9383040" type="application/zip" />
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
</item>
<item>
<title>NetNewsWire 6.1.10b2</title>
<description><![CDATA[
+63
View File
@@ -0,0 +1,63 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Build and Development Commands
### Building and Testing
- **Full build and test**: `./buildscripts/build_and_test.sh` - Builds both macOS and iOS targets and runs all tests
- **Quiet build and test**: `./buildscripts/quiet_build_and_test.sh` - Same as above with less verbose output
- **Manual Xcode builds**:
- macOS: `xcodebuild -project NetNewsWire.xcodeproj -scheme NetNewsWire -destination "platform=macOS,arch=arm64" build`
- iOS: `xcodebuild -project NetNewsWire.xcodeproj -scheme NetNewsWire-iOS -destination "platform=iOS Simulator,name=iPhone 16" build`
### Testing
- Run all tests: Use the `NetNewsWire.xctestplan` which includes tests from all modules
- Individual test runs follow same xcodebuild pattern with `test` action instead of `build`
### Setup
- First-time setup: Run `./setup.sh` to configure development environment and code signing
- Manual setup: Create `SharedXcodeSettings/DeveloperSettings.xcconfig` in parent directory
## Project Architecture
### High-Level Structure
NetNewsWire is a multi-platform RSS reader with separate targets for macOS and iOS, organized as a modular architecture with shared business logic.
### Key Modules (in /Modules)
- **RSCore**: Core utilities, extensions, and shared infrastructure
- **RSParser**: Feed parsing (RSS, Atom, JSON Feed, RSS-in-JSON)
- **RSWeb**: HTTP networking, downloading, caching, and web services
- **RSDatabase**: SQLite database abstraction layer using FMDB
- **Account**: Account management (Local, Feedbin, Feedly, NewsBlur, Reader API, CloudKit)
- **Articles**: Article and author data models
- **ArticlesDatabase**: Article storage and search functionality
- **SyncDatabase**: Cross-device synchronization state management
- **Secrets**: Secure credential and API key management
### Platform-Specific Code
- **Mac/**: macOS-specific UI (AppKit), preferences, main window management
- **iOS/**: iOS-specific UI (UIKit), settings, navigation
- **Shared/**: Cross-platform business logic, article rendering, smart feeds
### Key Architectural Patterns
- **Account System**: Pluggable account delegates for different sync services
- **Feed Management**: Hierarchical folder/feed organization with OPML import/export
- **Article Rendering**: Template-based HTML rendering with custom CSS themes
- **Smart Feeds**: Virtual feeds (Today, All Unread, Starred) implemented as PseudoFeed protocol
- **Timeline/Detail**: Classic three-pane interface (sidebar, timeline, detail)
### Extension Points
- Share extensions for both platforms
- Safari extension for feed subscription
- Widget support for iOS
- AppleScript support on macOS
- Intent extensions for Siri shortcuts
### Development Notes
- Uses Xcode project with Swift Package Manager for module dependencies
- Requires `xcbeautify` for formatted build output in scripts
- API keys are managed through buildscripts/updateSecrets.sh (runs during builds)
- Some features disabled in development builds due to private API keys
- Code signing configured through SharedXcodeSettings for development
- Documentation and technical notes are located in the `Technotes/` folder
-5
View File
@@ -639,11 +639,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
Browser.open("https://netnewswire.com/slack", inBackground: false)
}
@IBAction func openTechnotes(_ sender: Any?) {
Browser.open("https://github.com/brentsimmons/NetNewsWire/tree/main/Technotes", inBackground: false)
}
@IBAction func showHelp(_ sender: Any?) {
Browser.open("https://netnewswire.com/help/mac/6.1/en/", inBackground: false)
-6
View File
@@ -638,12 +638,6 @@
<action selector="openBugTracker:" target="Ady-hI-5gd" id="fZQ-ng-gIm"/>
</connections>
</menuItem>
<menuItem title="Technotes" id="Ou5-Cc-iCb">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openTechnotes:" target="Ady-hI-5gd" id="M7A-Qg-mH8"/>
</connections>
</menuItem>
<menuItem title="Slack Group" id="4eb-qF-n9S">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
+17
View File
@@ -100,6 +100,23 @@
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>OPML</string>
<key>UTTypeIdentifier</key>
<string>org.opml.opml</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>opml</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
+5 -3
View File
@@ -277,6 +277,7 @@
513C5CE6232571C2003D4054 /* NetNewsWire iOS Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "NetNewsWire iOS Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
518B2ED22351B3DD00400001 /* NetNewsWire-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "NetNewsWire-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
6581C73320CED60000F4AD34 /* Subscribe to Feed.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Subscribe to Feed.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
840A1F0A2E4133F400CFCCFC /* CLAUDE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CLAUDE.md; sourceTree = "<group>"; };
840D617C2029031C009BC708 /* NetNewsWire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NetNewsWire.app; sourceTree = BUILT_PRODUCTS_DIR; };
845B14A51FC2299E0013CF92 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
848CEF1E2DB74B56002B35B5 /* NetNewsWire-iOS.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "NetNewsWire-iOS.xctestplan"; sourceTree = "<group>"; };
@@ -292,7 +293,6 @@
membershipExceptions = (
/Localized/SafariExtension/SafariExtensionViewController.xib,
/Localized/ShareExtension/ShareViewController.xib,
"ReleaseNotes-Mac.markdown",
Resources/Info.plist,
Resources/NetNewsWire.provisionprofile,
"Resources/org.sparkle-project.Downloader.xpc",
@@ -367,7 +367,6 @@
/Localized/ShareExtension/MainInterface.storyboard,
IntentsExtension/Info.plist,
IntentsExtension/IntentHandler.swift,
"ReleaseNotes-iOS.markdown",
Resources/Info.plist,
ShareExtension/Info.plist,
ShareExtension/ShareFolderPickerAccountCell.xib,
@@ -504,6 +503,7 @@
/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
840A1F092E41337800CFCCFC /* Technotes */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Technotes; sourceTree = "<group>"; };
842E249F2DB9F9B800FF7DD8 /* Mac */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (842E25332DB9F9B800FF7DD8 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, 842E25342DB9F9B800FF7DD8 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, 842E25352DB9F9B800FF7DD8 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, 842E25362DB9F9B800FF7DD8 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Mac; sourceTree = "<group>"; };
8448F1F62D1E36BF0048BA50 /* Widget */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (8448F2052D1E36BF0048BA50 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Widget; sourceTree = "<group>"; };
84719F0E2DB9C52B00EEF332 /* Tests */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (84719F272DB9C52B00EEF332 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, 84719F282DB9C52B00EEF332 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Tests; sourceTree = "<group>"; };
@@ -630,8 +630,10 @@
children = (
845B14A51FC2299E0013CF92 /* README.md */,
84D2200922B0BC4B0019E085 /* CONTRIBUTING.md */,
840A1F0A2E4133F400CFCCFC /* CLAUDE.md */,
848E84CA2DB743FF0023F3BA /* NetNewsWire.xctestplan */,
848CEF1E2DB74B56002B35B5 /* NetNewsWire-iOS.xctestplan */,
840A1F092E41337800CFCCFC /* Technotes */,
842E249F2DB9F9B800FF7DD8 /* Mac */,
84A6CFB52D1B4EC500F23315 /* iOS */,
513145F9235A55A700387FDC /* Intents */,
@@ -1238,7 +1240,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "xcrun -sdk macosx swift buildscripts/VerifyNoBS.swift --xcode ${PROJECT_DIR}/${PROJECT_NAME}.xcodeproj/project.pbxproj\n";
shellScript = "xcrun -sdk macosx swift buildscripts/VerifyNoBS.swift --xcode \"${PROJECT_DIR}/${PROJECT_NAME}.xcodeproj/project.pbxproj\"\n";
};
/* End PBXShellScriptBuildPhase section */
+1 -1
View File
@@ -4,7 +4,6 @@
<title>Default Feeds</title>
</head>
<body>
<outline text="BBC News - World" title="BBC News - World" type="rss" version="RSS" htmlUrl="https://www.bbc.com/news" xmlUrl="https://feeds.bbci.co.uk/news/world/rss.xml"/>
<outline text="Allen Pike" title="Allen Pike" type="rss" version="RSS" htmlUrl="https://www.allenpike.com/" xmlUrl="https://feeds.allenpike.com/feed/"/>
<outline text="Colossal" title="Colossal" type="rss" version="RSS" htmlUrl="https://www.thisiscolossal.com/" xmlUrl="https://www.thisiscolossal.com/feed/"/>
<outline text="Craig Hockenberry" title="Craig Hockenberry" type="rss" version="RSS" htmlUrl="https://furbo.org/" xmlUrl="https://furbo.org/feed/json"/>
@@ -17,6 +16,7 @@
<outline text="Michael Tsai" title="Michael Tsai" type="rss" version="RSS" htmlUrl="https://mjtsai.com/blog/" xmlUrl="https://mjtsai.com/blog/feed/"/>
<outline text="NetNewsWire Blog" title="NetNewsWire Blog" type="rss" version="RSS" htmlUrl="https://netnewswire.blog/" xmlUrl="https://netnewswire.blog/feed.json"/>
<outline text="One Foot Tsunami" title="One Foot Tsunami" type="rss" version="RSS" htmlUrl="https://onefoottsunami.com/" xmlUrl="https://onefoottsunami.com/feed/json/"/>
<outline text="Scripting News" title="Scripting News" type="rss" version="RSS" htmlUrl="http://scripting.com/" xmlUrl="http://scripting.com/rss.xml"/>
<outline text="Six Colors" title="Six Colors" type="rss" version="RSS" htmlUrl="https://sixcolors.com/" xmlUrl="https://feedpress.me/sixcolors?type=xml"/>
</body>
</opml>
+1 -1
View File
@@ -10,5 +10,5 @@ import UniformTypeIdentifiers
extension UTType {
static let opml = UTType(filenameExtension: "opml", conformingTo: UTType.xml)!
static let opml = UTType("org.opml.opml")!
}
+1 -1
View File
@@ -20,7 +20,7 @@ This way the app can store those statuses without having to have their correspon
## Strange Behavior
The articles database periodically deletes old articles that have been read. (In theory. This code has still to be written at this date (28 April 2019).)
The articles database periodically deletes old articles that have been read.
However, it retains old statuses for a considerably longer period of time.
+59
View File
@@ -0,0 +1,59 @@
# Mac State Restoration
https://github.com/Ranchero-Software/NetNewsWire/issues/4589
https://github.com/Ranchero-Software/NetNewsWire/issues/4631
## State to restore
Hide Read Articles
Hide Read Feeds
Windows positions, including split view positions
## Warnings
WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
## How state restoration works according to Apple
Info.plist: NSApplicationSupportsRestorableState - true
NSUserInterfaceItemIdentification
NSWindowRestoration Protocol
window.restorationClass = …
encodeRestorableStateWithCoder:
restoreStateWithCoder:
self.restorationIdentifier = "MainWindowController"
AppDelegate — application:shouldRestoreApplicationState: and application:shouldSaveApplicationState: for complex cases
Can be turned on and off via system pref
## Tests
Window 1
Restore position — yes
Restore split view position — sometimes
Restore timeline position — no
Restore Hide Read Feeds — yes
Restore Hide Read Articles for inessential — yes
Window 2
Restore position
Restore split view position
Restore Hide Read Feeds
Restore Hide Read Articles for The Verge
Restores second window but not first
With state restoration enabled, all three windows appear, but with not everything restored
---
Close windows tests
1 window
detail scroll not restored
@@ -0,0 +1,57 @@
# How To Do Mac Sparkle Release
NetNewsWire_mac_target_common.xcconfig
update MARKETING_VERSION and CURRENT_PROJECT_VERSION
ReleaseNotes-Mac.markdown
main branch
Write change notes in notes
Include branch and tag
Run buildscripts/quiet_build_and_test.sh
Make sure there are no outstanding changes
Archive build
Developer ID distribution - notarize
Wait while processing
Export
Smoke test
On main: update Technotes/Status.md
commit
Tag the app:
git tag mac-6.1.5b4
Push:
git push origin mac-6.1.5b4
Find tag in GitHub - https://github.com/Ranchero-Software/NetNewsWire/tags
Turn into release — NetNewsWire 6.1.5b4 for Mac
Add change notes
Zip app - NetNewsWire6.1.5b4.zip
Upload binary to release
Publish release
Copy file to releases archive — iCloud Drive/Archive/Releases/
Update Appcast on main branch
Add changes
Update title
Update pubDate
Update enclosure URL
Update version
Update file size - length
Run xmllint on appcast
xmllint --noout netnewswire-beta.xml
Upload appcast
Commit and push git change
Test updating via appcast
Optionally:
Announce on Slack
Announce on blog
@@ -0,0 +1,29 @@
# How To Do App Store Release
Write release notes in ReleaseNotes-iOS.markdown on main
Commit release notes
Tag the app if needed:
git tag iOS-6.1.9
git push origin iOS-6.1.9
Click + near iOS App
Type in new version name
Scroll way down to Build section and choose the build (latest TestFlight build, presumably)
Fill in What’s New text
Click Save at top of screen
Click Add for Review next to Save
On next screen, click Submit to App Review
Make new release from tag
https://github.com/Ranchero-Software/NetNewsWire/tags
Example title:
NetNewsWire 6.1.6 (6140) for iOS - AppStore
Announce on Slack
Announce on NetNewsWire blog
Optionally announce on inessential
@@ -0,0 +1,74 @@
# How To Do iOS TestFlight Release
Be sure to have updated code and be *on correct branch*
## Edit Build Version
NetNewsWire_ios_target_common.xcconfig
Possibly bump MARKETING_VERSION
Increment CURRENT_PROJECT_VERSION by 1 (usually)
Commit change.
## Test
Run buildscripts/quiet_build_and_test.sh to be sure all platforms build and tests pass.
Build and run app on device
Smoke test
If it fails, bail.
Check in and push changes.
## Create Release Notes
On main:
ReleaseNotes-iOS.markdown
Go to milestone and find closed bugs since last release notes
Add to iOS Release Notes note
Write release notes
Commit change.
## Archive and Upload
Archive
Distribute to TestFlight
## Status
Update NetNewsWire Status doc in Technotes
Commit
## Tag
On branch (or on main, if working on main):
Use SemVer with tags
Tag the app: git tag iOS-6.1.5-6124
Push: git push origin iOS-6.1.5-6124
## Release the app
In AppStoreConnect add groups and release the app
Paste in the release notes
Announce in Slack
Optionally blog about it
## GitHub release
Make new release from tag
https://github.com/Ranchero-Software/NetNewsWire/tags
Example title:
NetNewsWire 6.1.6 (6140) for iOS - TestFlight
## Notes
Public TestFlight link:
https://testflight.apple.com/join/wpedPMRR
@@ -1,5 +1,9 @@
# Mac Release Notes
### 6.1.10b3 build 6138 11 Aug 2025 - branch main tag: mac-6.1.10b3
Fixed bug, introduced in previous test build, that prevented choosing an OPML file to import
### 6.1.10b2 build 6137 13 May 2025 - branch main tag: mac-6.1.10b2
Fixed bug, introduced in previous test build, that prevented adding a Feedly account
@@ -1,5 +1,9 @@
# iOS Release Notes
### 6.1.10 TestFlight build 6198 11 Aug 2025 - branch: main tag iOS-6.1.10-6198
Replaced BBC in default feeds (for new users) because its feeds have gone wonky. Replaced with Scripting News.
### 6.1.9 AppStore build 6197 13 May 2025 - branch: main tag iOS-6.1.9 (Same build as 6197 TestFlight)
Fixed bug where links in footnotes — in light mode, using the default theme — would be invisible
+21
View File
@@ -0,0 +1,21 @@
# NetNewsWire Status
Current milestone: NetNewsWire 6.1.10
https://github.com/Ranchero-Software/NetNewsWire/milestone/60
Current bug: Mac restoration issues
https://github.com/Ranchero-Software/NetNewsWire/issues/4589
## iOS
iOS shipping: 6.1.9 (6197)
TestFlight: 6.1.10 (6198)
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/iOS-6.1.10-6198
## Mac
Mac shipping: 6.1.9
Beta: 6.1.10b3
https://github.com/Ranchero-Software/NetNewsWire/releases/tag/mac-6.1.10b3
+15 -12
View File
@@ -1,13 +1,15 @@
# NetNewsWire Privacy Policy
This policy describes the information Ranchero Software and Brent Simmons may receive from NetNewsWire users and how that information is handled.
This policy describes the information Brent Simmons may receive from NetNewsWire users and how that information is handled.
There are two things we do:
* We gather crash logs from NetNewsWire users who opt in.
* We log traffic to our website, which we view in aggregate.
In other words, we don’t want any private information — except that we want to be able to identify and fix crashing bugs, and we like to know things like how many times the app has been downloaded.
In other words, we don’t want any private information. We really, really don’t — it’s of zero use to us and it would be a burden to have to store it securely.
But we do want to do two things: 1) identify and fix crashing bugs, and 2) find out how many people are visiting our website and see which pages are more or less popular.
Details on these, and other privacy topics, are below.
@@ -16,13 +18,15 @@ Details on these, and other privacy topics, are below.
If you opt in to sending crash logs, we will have a copy of your crash logs.
* If you’re using an App Store version of the app, and you opt in with Apple, then Apple has a copy and we have a copy.
* If you’re using a version downloaded directly from us, and you opt in, then it’s just us.
* If you’re using a Mac version downloaded directly from us, and you opt in, then it’s just us.
When NetNewsWire sends a crash log directly to us, it sends only the text of the crash log. No additional information, such as email address, is sent (though our website logging system — see below — will record some information, including time and IP address).
When NetNewsWire for Mac sends a crash log directly to us, it sends only the text of the crash log. No additional information, such as email address, is sent (though our website logging system — see below — will record some information, including time and IP address).
Crash logs are stored privately and are kept confidential.
However, we may make significant parts of a crash log available publicly when there‘s no personal identification in that part of the crash log. For example, we might share something like this:
However, we may make all or significant parts of a crash log available publicly when there‘s no personal identification in that part of the crash log.
We might make all of a crash log available (again, if there’s no personal identification), or just part — something like this:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_secinit.dylib 0x00007fff6c06689f _libsecinit_setup_secinitd_client + 1393
@@ -44,15 +48,15 @@ We look at the logs in aggregate — for instance, to find how many times NetNew
## Other topics
### Cookies, JavaScript, Ads
### No Cookies, JavaScript, Trackers, Ads
Neither ranchero.com nor inessential.com use any cookies or JavaScript, and they do not display any ads.
Neither netnewswire.com nor inessential.com (Brent’s blog) use any cookies, JavaScript, or trackers, and they do not display any ads.
### Related sites
The [NetNewsWire GitHub repository](https://github.com/brentsimmons/NetNewsWire) does use cookies and JavaScript, because that’s how GitHub works. The repository, including the issue tracker and anything you post there, is public. See [GitHub’s privacy policy](https://help.github.com/en/github/site-policy/github-privacy-statement) for more information.
The [NetNewsWire GitHub repository](https://github.com/Ranchero-Software/NetNewsWire) does use cookies and JavaScript, because that’s how GitHub works. The repository, including the issue tracker and anything you post there, is public. See [GitHub’s privacy policy](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement) for more information.
The NetNewsWire Slack group also uses cookies and JavaScript, because that’s how Slack works. The group is public: anyone may join. See [Slack’s privacy policy](https://slack.com/privacy-policy) for more info.
The [NetNewsWire Slack group](https://netnewswire.com/slack) also uses cookies and JavaScript, because that’s how Slack works. The group is public: anyone may join. See [Slack’s privacy policy](https://slack.com/trust/privacy/privacy-policy) for more info.
Posting to the GitHub repository and joining the Slack group are optional, opt-in activities.
@@ -62,7 +66,6 @@ NetNewsWire displays HTML that comes from feeds from other sites. Some of these
## Questions or comments
If you have questions or comments about this privacy policy, please contact <a href="mailto:brent@ranchero.com">brent@ranchero.com</a>.
This [policy](https://github.com/brentsimmons/NetNewsWire/blob/main/Technotes/privacypolicy.markdown) is stored in the NetNewsWire GitHub repository, where you can track any changes we might make.
If you have questions or comments about this privacy policy, please contact Brent Simmons on the [Slack group](https://netnewswire.com/slack) or on [Mastodon](https://indieweb.social/@brentsimmons).
This [policy](https://github.com/brentsimmons/NetNewsWire/blob/master/Technotes/privacypolicy.markdown) is stored in the NetNewsWire GitHub repository, where you can track any changes we might make.
+18 -35
View File
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24118.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24059"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -104,31 +103,15 @@
<action selector="cancel:" destination="7aE-6a-iP7" id="g4H-Mc-Jnh"/>
</connections>
</barButtonItem>
<rightBarButtonItems>
<barButtonItem enabled="NO" title="Add" style="done" id="F8z-me-Hnx">
<connections>
<action selector="add:" destination="7aE-6a-iP7" id="66n-Ea-YXO"/>
</connections>
</barButtonItem>
<barButtonItem id="qP4-8x-XbO">
<view key="customView" contentMode="scaleToFill" id="9ct-kH-nAp">
<rect key="frame" x="300.33333333333331" y="12" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="3ph-Td-s1Z">
<rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</barButtonItem>
</rightBarButtonItems>
<barButtonItem key="rightBarButtonItem" enabled="NO" title="Add" style="done" id="F8z-me-Hnx">
<connections>
<action selector="add:" destination="7aE-6a-iP7" id="66n-Ea-YXO"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="activityIndicator" destination="3ph-Td-s1Z" id="ouh-78-smj"/>
<outlet property="addButton" destination="F8z-me-Hnx" id="l1b-UL-238"/>
<outlet property="nameTextField" destination="u7n-VL-Ho9" id="YQV-Xq-f9q"/>
<outlet property="urlTextField" destination="eRp-AP-WFq" id="FG3-pH-2Fh"/>
@@ -144,7 +127,7 @@
<objects>
<navigationController storyboardIdentifier="AddWebFeedFolderNavViewController" id="WDg-F7-gfk" customClass="ModalNavigationController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="akM-T1-shZ">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
@@ -164,14 +147,14 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AccountCell" id="bp5-2u-4S4" customClass="AddComboTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="43.666667938232422"/>
<rect key="frame" x="0.0" y="50" width="375" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="bp5-2u-4S4" id="9HE-eR-YIp">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666667938232422"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="CIM-Ah-2kX">
<rect key="frame" x="20" y="11" width="22" height="22"/>
<rect key="frame" x="20" y="14.666666666666664" width="22" height="22"/>
<color key="tintColor" name="secondaryAccentColor"/>
<constraints>
<constraint firstAttribute="width" constant="22" id="NwD-N9-OGB"/>
@@ -179,7 +162,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Account" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZQp-94-vJz">
<rect key="frame" x="50" y="11.333333333333336" width="64" height="21"/>
<rect key="frame" x="50" y="15" width="64" height="21"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@@ -199,14 +182,14 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="FolderCell" id="S24-c1-0Ir" customClass="AddComboTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="71.666667938232422" width="375" height="43.666667938232422"/>
<rect key="frame" x="0.0" y="101" width="375" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="S24-c1-0Ir" id="bA3-AB-H1n">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666667938232422"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yKC-at-6Jx">
<rect key="frame" x="50" y="11" width="22" height="22"/>
<rect key="frame" x="50" y="14.666666666666664" width="22" height="22"/>
<color key="tintColor" name="secondaryAccentColor"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="1B1-qh-G3r"/>
@@ -214,7 +197,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Folder" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Tp-A7-7rS">
<rect key="frame" x="80" y="11.333333333333336" width="49" height="21"/>
<rect key="frame" x="80" y="15" width="49" height="21"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@@ -256,7 +239,7 @@
<objects>
<navigationController storyboardIdentifier="AddWebFeedViewControllerNav" id="4Ej-aI-tUP" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Fot-QF-7Rn">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
@@ -388,7 +371,7 @@
<objects>
<navigationController storyboardIdentifier="AddFolderViewControllerNav" id="edk-IE-nce" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Pi1-Bc-YXQ">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
+5 -6
View File
@@ -14,7 +14,6 @@ import RSParser
class AddFeedViewController: UITableViewController {
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBOutlet weak var addButton: UIBarButtonItem!
@IBOutlet weak var urlTextField: UITextField!
@IBOutlet weak var urlTextFieldToSuperViewConstraint: NSLayoutConstraint!
@@ -24,6 +23,8 @@ class AddFeedViewController: UITableViewController {
private var folderLabel = ""
private var userCancelled = false
private let activityIndicator = UIActivityIndicatorView(style: .medium)
var initialFeed: String?
var initialFeedName: String?
@@ -33,9 +34,6 @@ class AddFeedViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
activityIndicator.isHidden = true
activityIndicator.color = .label
if initialFeed == nil, let urlString = UIPasteboard.general.string {
if urlString.mayBeURL {
initialFeed = urlString.normalizedURL
@@ -100,7 +98,8 @@ class AddFeedViewController: UITableViewController {
}
addButton.isEnabled = false
activityIndicator.isHidden = false
addButton.customView = activityIndicator
addButton.customView?.isHidden = false
activityIndicator.startAnimating()
let feedName = (nameTextField.text?.isEmpty ?? true) ? nil : nameTextField.text
@@ -117,8 +116,8 @@ class AddFeedViewController: UITableViewController {
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed])
case .failure(let error):
self.addButton.isEnabled = true
self.activityIndicator.isHidden = true
self.activityIndicator.stopAnimating()
self.addButton.customView = nil
self.presentError(error)
}
+17 -16
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24112" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="AJQ-jq-uMa">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24118.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="AJQ-jq-uMa">
<device id="retina6_7" orientation="portrait" appearance="light"/>
<accessibilityOverrides dynamicTypePreference="6"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24057"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24059"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
@@ -139,7 +139,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Article Title" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wWh-bJ-tNe">
<rect key="frame" x="88" y="11.000000000000002" width="322" height="19.666666666666671"/>
<rect key="frame" x="88" y="15" width="322" height="15.666666666666664"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@@ -188,7 +188,7 @@
<constraint firstItem="ESv-eQ-b8X" firstAttribute="leading" secondItem="wWh-bJ-tNe" secondAttribute="leading" id="Ifb-Wc-i1h"/>
<constraint firstItem="VIg-VB-r3d" firstAttribute="leading" secondItem="baQ-HK-mjy" secondAttribute="trailing" constant="8" symbolic="YES" id="NY7-Kg-7tF"/>
<constraint firstItem="baQ-HK-mjy" firstAttribute="leading" secondItem="Adg-d9-egJ" secondAttribute="leading" constant="20" id="SuA-f2-vgv"/>
<constraint firstItem="wWh-bJ-tNe" firstAttribute="top" secondItem="Adg-d9-egJ" secondAttribute="top" constant="10.999999999999998" id="VEu-g8-hf0"/>
<constraint firstItem="wWh-bJ-tNe" firstAttribute="top" secondItem="Adg-d9-egJ" secondAttribute="top" constant="15" id="VEu-g8-hf0"/>
<constraint firstItem="Adg-d9-egJ" firstAttribute="trailing" secondItem="ESv-eQ-b8X" secondAttribute="trailing" constant="20" id="WOi-Ux-1J5"/>
<constraint firstItem="Adg-d9-egJ" firstAttribute="bottom" secondItem="ESv-eQ-b8X" secondAttribute="bottom" constant="8" id="arj-Vg-UZ3"/>
<constraint firstItem="VIg-VB-r3d" firstAttribute="top" secondItem="Adg-d9-egJ" secondAttribute="top" constant="15" id="fX5-pf-fYx"/>
@@ -223,7 +223,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Article Title" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xIH-Bj-Hfb">
<rect key="frame" x="39" y="10.999999999999998" width="371" height="20.333333333333329"/>
<rect key="frame" x="39" y="15" width="371" height="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@@ -254,7 +254,7 @@
<constraint firstItem="T0c-9w-8Vx" firstAttribute="trailing" secondItem="xIH-Bj-Hfb" secondAttribute="trailing" constant="20" id="CJm-OT-agU"/>
<constraint firstItem="xIH-Bj-Hfb" firstAttribute="leading" secondItem="qJ6-XG-BBa" secondAttribute="trailing" constant="8" symbolic="YES" id="LBB-sr-Af3"/>
<constraint firstItem="POG-WQ-rYn" firstAttribute="leading" secondItem="xIH-Bj-Hfb" secondAttribute="leading" id="NyL-bo-xK3"/>
<constraint firstItem="xIH-Bj-Hfb" firstAttribute="top" secondItem="T0c-9w-8Vx" secondAttribute="top" constant="11" id="TCh-kO-fj1"/>
<constraint firstItem="xIH-Bj-Hfb" firstAttribute="top" secondItem="T0c-9w-8Vx" secondAttribute="top" constant="15" id="TCh-kO-fj1"/>
<constraint firstItem="qJ6-XG-BBa" firstAttribute="top" secondItem="T0c-9w-8Vx" secondAttribute="top" constant="15" id="gwo-Xi-4nq"/>
<constraint firstItem="T0c-9w-8Vx" firstAttribute="bottom" secondItem="POG-WQ-rYn" secondAttribute="bottom" constant="7.6666666666666217" id="nQe-AM-26Q"/>
<constraint firstItem="T0c-9w-8Vx" firstAttribute="trailing" secondItem="POG-WQ-rYn" secondAttribute="trailing" constant="20" id="nrE-3J-lDa"/>
@@ -405,7 +405,7 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="right" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oRt-Cv-vvU">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oRt-Cv-vvU">
<rect key="frame" x="372" y="12" width="42" height="37"/>
<constraints>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="80" id="gcN-eE-3m0"/>
@@ -471,7 +471,8 @@
<constraint firstAttribute="height" constant="39" id="oUY-3E-b1N"/>
</constraints>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" image="chevron.down" catalog="system">
<buttonConfiguration key="configuration" style="plain">
<imageReference key="image" image="chevron.down" catalog="system" symbolScale="medium"/>
<preferredSymbolConfiguration key="preferredSymbolConfigurationForImage" scale="small"/>
<color key="baseForegroundColor" systemColor="labelColor"/>
</buttonConfiguration>
@@ -479,7 +480,7 @@
<action selector="toggleDisclosure" destination="wZG-XA-czw" eventType="touchUpInside" id="WG7-tr-rY6"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="right" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LVW-Zu-z90">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LVW-Zu-z90">
<rect key="frame" x="346" y="19.333333333333336" width="42" height="20.333333333333336"/>
<constraints>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="80" id="bbK-t6-3yU"/>
@@ -518,13 +519,13 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Edf-Sz-AqQ">
<rect key="frame" x="388" y="17" width="39" height="27.333333333333343"/>
<rect key="frame" x="388" y="16" width="39" height="29"/>
<color key="tintColor" systemColor="labelColor"/>
<constraints>
<constraint firstAttribute="height" constant="39" id="X7y-qK-C7p"/>
<constraint firstAttribute="width" constant="39" id="uwr-KC-J0b"/>
</constraints>
<imageReference key="image" image="chevron.down" catalog="system" symbolScale="small"/>
<imageReference key="image" image="chevron.down" catalog="system" symbolScale="medium"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="small" weight="regular"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="ContainerTitle" lineBreakMode="wordWrap" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p16-Uj-CBX">
@@ -533,7 +534,7 @@
<color key="textColor" systemColor="tertiaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="right" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" preferredMaxLayoutWidth="42" translatesAutoresizingMaskIntoConstraints="NO" id="TBA-io-5jo">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="8888" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" preferredMaxLayoutWidth="42" translatesAutoresizingMaskIntoConstraints="NO" id="TBA-io-5jo">
<rect key="frame" x="338" y="20" width="42" height="20.333333333333329"/>
<constraints>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="80" id="ICt-N6-dsh"/>
@@ -546,8 +547,8 @@
<constraints>
<constraint firstItem="Edf-Sz-AqQ" firstAttribute="leading" secondItem="TBA-io-5jo" secondAttribute="trailing" constant="8" symbolic="YES" id="0kf-5h-6cE"/>
<constraint firstItem="TBA-io-5jo" firstAttribute="leading" secondItem="p16-Uj-CBX" secondAttribute="trailing" constant="8" symbolic="YES" id="5AQ-Ya-Uda"/>
<constraint firstItem="TBA-io-5jo" firstAttribute="centerY" secondItem="Edf-Sz-AqQ" secondAttribute="centerY" id="73s-rj-8xJ"/>
<constraint firstAttribute="trailing" secondItem="Edf-Sz-AqQ" secondAttribute="trailing" constant="3" id="E5L-eG-OZk"/>
<constraint firstItem="TBA-io-5jo" firstAttribute="centerY" secondItem="Edf-Sz-AqQ" secondAttribute="centerY" id="Ftr-fa-6Vy"/>
<constraint firstItem="Edf-Sz-AqQ" firstAttribute="centerY" secondItem="p16-Uj-CBX" secondAttribute="centerY" id="Qbl-KG-5MX"/>
<constraint firstItem="p16-Uj-CBX" firstAttribute="top" secondItem="Rza-3g-Ty5" secondAttribute="top" constant="8" id="kiC-3Z-Jev"/>
<constraint firstAttribute="bottom" secondItem="p16-Uj-CBX" secondAttribute="bottom" constant="8" id="pB6-RK-FNH"/>
@@ -804,19 +805,19 @@
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="secondarySystemGroupedBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="separatorColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.28999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="tertiaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.29803921568627451" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29803921570000003" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
@@ -1,232 +0,0 @@
//
// MainFeedTableViewCell.swift
// NetNewsWire
//
// Created by Brent Simmons on 8/1/15.
// Copyright © 2015 Ranchero Software, LLC. All rights reserved.
//
import UIKit
import RSCore
import Account
import RSTree
protocol MainFeedTableViewCellDelegate: AnyObject {
func mainFeedTableViewCellDisclosureDidToggle(_ sender: MainFeedTableViewCell, expanding: Bool)
}
class MainFeedTableViewCell : VibrantTableViewCell {
weak var delegate: MainFeedTableViewCellDelegate?
override var accessibilityLabel: String? {
set {}
get {
if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
return "\(name) \(unreadCount) \(unreadLabel)"
} else {
return name
}
}
}
var iconImage: IconImage? {
didSet {
iconView.iconImage = iconImage
}
}
var isDisclosureAvailable = false {
didSet {
if isDisclosureAvailable != oldValue {
setNeedsLayout()
}
}
}
var isSeparatorShown = true {
didSet {
if isSeparatorShown != oldValue {
if isSeparatorShown {
showView(bottomSeparatorView)
} else {
hideView(bottomSeparatorView)
}
}
}
}
var unreadCount: Int {
get {
return unreadCountView.unreadCount
}
set {
if unreadCountView.unreadCount != newValue {
unreadCountView.unreadCount = newValue
unreadCountView.isHidden = (newValue < 1)
setNeedsLayout()
}
}
}
var name: String {
get {
return titleView.text ?? ""
}
set {
if titleView.text != newValue {
titleView.text = newValue
setNeedsLayout()
}
}
}
private let titleView: UILabel = {
let label = NonIntrinsicLabel()
label.numberOfLines = 0
label.allowsDefaultTighteningForTruncation = false
label.adjustsFontForContentSizeCategory = true
label.lineBreakMode = .byTruncatingTail
label.font = .preferredFont(forTextStyle: .body)
return label
}()
private let iconView = IconView()
private let bottomSeparatorView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.separator
view.alpha = 0.5
return view
}()
private var isDisclosureExpanded = false
private var disclosureButton: UIButton?
private var unreadCountView = MainFeedUnreadCountView(frame: CGRect.zero)
private var isShowingEditControl = false
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
func setDisclosure(isExpanded: Bool, animated: Bool) {
isDisclosureExpanded = isExpanded
let duration = animated ? 0.3 : 0.0
UIView.animate(withDuration: duration) {
if self.isDisclosureExpanded {
self.disclosureButton?.accessibilityLabel = NSLocalizedString("Collapse Folder", comment: "Collapse Folder")
self.disclosureButton?.imageView?.transform = CGAffineTransform(rotationAngle: 1.570796)
} else {
self.disclosureButton?.accessibilityLabel = NSLocalizedString("Expand Folder", comment: "Expand Folder")
self.disclosureButton?.imageView?.transform = CGAffineTransform(rotationAngle: 0)
}
}
}
override func applyThemeProperties() {
super.applyThemeProperties()
}
override func willTransition(to state: UITableViewCell.StateMask) {
super.willTransition(to: state)
isShowingEditControl = state.contains(.showingEditControl)
}
override func sizeThatFits(_ size: CGSize) -> CGSize {
let layout = MainFeedTableViewCellLayout(cellWidth: bounds.size.width, insets: safeAreaInsets, label: titleView, unreadCountView: unreadCountView, showingEditingControl: isShowingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: isDisclosureAvailable)
return CGSize(width: bounds.width, height: layout.height)
}
override func layoutSubviews() {
super.layoutSubviews()
let layout = MainFeedTableViewCellLayout(cellWidth: bounds.size.width, insets: safeAreaInsets, label: titleView, unreadCountView: unreadCountView, showingEditingControl: isShowingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: isDisclosureAvailable)
layoutWith(layout)
}
@objc func buttonPressed(_ sender: UIButton) {
if isDisclosureAvailable {
setDisclosure(isExpanded: !isDisclosureExpanded, animated: true)
delegate?.mainFeedTableViewCellDisclosureDidToggle(self, expanding: isDisclosureExpanded)
}
}
override func updateVibrancy(animated: Bool) {
super.updateVibrancy(animated: animated)
let iconTintColor: UIColor
if isHighlighted || isSelected {
iconTintColor = AppAssets.vibrantTextColor
} else {
if let preferredColor = iconImage?.preferredColor {
iconTintColor = UIColor(cgColor: preferredColor)
} else {
iconTintColor = AppAssets.secondaryAccentColor
}
}
if animated {
UIView.animate(withDuration: Self.duration) {
self.iconView.tintColor = iconTintColor
}
} else {
self.iconView.tintColor = iconTintColor
}
updateLabelVibrancy(titleView, color: labelColor, animated: animated)
}
}
private extension MainFeedTableViewCell {
func commonInit() {
addSubviewAtInit(unreadCountView)
addSubviewAtInit(iconView)
addSubviewAtInit(titleView)
addDisclosureView()
addSubviewAtInit(bottomSeparatorView)
}
func addDisclosureView() {
disclosureButton = NonIntrinsicButton(type: .roundedRect)
disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside)
disclosureButton?.setImage(AppAssets.disclosureImage, for: .normal)
disclosureButton?.tintColor = AppAssets.controlBackgroundColor
disclosureButton?.imageView?.contentMode = .center
disclosureButton?.imageView?.clipsToBounds = false
if #available(iOS 13.4, *) {
disclosureButton?.addInteraction(UIPointerInteraction())
}
addSubviewAtInit(disclosureButton!)
}
func addSubviewAtInit(_ view: UIView) {
addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
}
func layoutWith(_ layout: MainFeedTableViewCellLayout) {
iconView.setFrameIfNotEqual(layout.faviconRect)
titleView.setFrameIfNotEqual(layout.titleRect)
unreadCountView.setFrameIfNotEqual(layout.unreadCountRect)
disclosureButton?.setFrameIfNotEqual(layout.disclosureButtonRect)
disclosureButton?.isHidden = !isDisclosureAvailable
bottomSeparatorView.setFrameIfNotEqual(layout.separatorRect)
}
func hideView(_ view: UIView) {
if !view.isHidden {
view.isHidden = true
}
}
func showView(_ view: UIView) {
if view.isHidden {
view.isHidden = false
}
}
}
@@ -1,148 +0,0 @@
//
// MainFeedTableViewCellLayout.swift
// NetNewsWire
//
// Created by Brent Simmons on 11/24/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import UIKit
import RSCore
struct MainFeedTableViewCellLayout {
private static let indentWidth = CGFloat(integerLiteral: 42)
private static let editingControlIndent = CGFloat(integerLiteral: 40)
private static let imageSize = CGSize(width: 24, height: 24)
private static let imageMarginRight = CGFloat(integerLiteral: 11)
private static let labelMarginRight = CGFloat(integerLiteral: 8)
private static let unreadCountMarginRight = CGFloat(integerLiteral: 16)
private static let disclosureButtonSize = CGSize(width: 44, height: 44)
private static let verticalPadding = CGFloat(integerLiteral: 11)
private static let minRowHeight = CGFloat(integerLiteral: 44)
static let faviconCornerRadius = CGFloat(integerLiteral: 2)
let faviconRect: CGRect
let titleRect: CGRect
let unreadCountRect: CGRect
let disclosureButtonRect: CGRect
let separatorRect: CGRect
let height: CGFloat
init(cellWidth: CGFloat, insets: UIEdgeInsets, label: UILabel, unreadCountView: MainFeedUnreadCountView, showingEditingControl: Bool, indent: Bool, shouldShowDisclosure: Bool) {
var initialIndent = insets.left
if indent {
initialIndent += MainFeedTableViewCellLayout.indentWidth
}
let bounds = CGRect(x: initialIndent, y: 0.0, width: floor(cellWidth - initialIndent - insets.right), height: 0.0)
// Disclosure Button
var rDisclosure = CGRect.zero
if shouldShowDisclosure {
rDisclosure.size = MainFeedTableViewCellLayout.disclosureButtonSize
rDisclosure.origin.x = bounds.origin.x
}
// Favicon
var rFavicon = CGRect.zero
if !shouldShowDisclosure {
let x = bounds.origin.x
let y = UIFontMetrics.default.scaledValue(for: MainFeedTableViewCellLayout.verticalPadding) +
label.font.lineHeight / 2.0 -
MainFeedTableViewCellLayout.imageSize.height / 2.0
rFavicon = CGRect(x: x, y: y, width: MainFeedTableViewCellLayout.imageSize.width, height: MainFeedTableViewCellLayout.imageSize.height)
}
// Unread Count
let unreadCountSize = unreadCountView.contentSize
let unreadCountIsHidden = unreadCountView.unreadCount < 1
var rUnread = CGRect.zero
if !unreadCountIsHidden {
rUnread.size = unreadCountSize
rUnread.origin.x = bounds.maxX - (MainFeedTableViewCellLayout.unreadCountMarginRight + unreadCountSize.width)
}
// Title
var rLabelx = insets.left + MainFeedTableViewCellLayout.disclosureButtonSize.width
if !shouldShowDisclosure {
rLabelx = rLabelx + MainFeedTableViewCellLayout.imageSize.width + MainFeedTableViewCellLayout.imageMarginRight
}
let rLabely = UIFontMetrics.default.scaledValue(for: MainFeedTableViewCellLayout.verticalPadding)
var labelWidth = CGFloat.zero
if !unreadCountIsHidden {
labelWidth = cellWidth - (rLabelx + MainFeedTableViewCellLayout.labelMarginRight + (cellWidth - rUnread.minX))
} else {
labelWidth = cellWidth - (rLabelx + MainFeedTableViewCellLayout.labelMarginRight)
}
let labelSizeInfo = MultilineUILabelSizer.size(for: label.text ?? "", font: label.font, numberOfLines: 0, width: Int(floor(labelWidth)))
// Now that we've got everything (especially the label) computed without the editing controls, update for them.
// We do this because we don't want the row height to change when the editing controls are brought out. We will
// handle the missing space, but removing it from the label and truncating.
if showingEditingControl {
rDisclosure.origin.x += MainFeedTableViewCellLayout.editingControlIndent
rFavicon.origin.x += MainFeedTableViewCellLayout.editingControlIndent
rLabelx += MainFeedTableViewCellLayout.editingControlIndent
if !unreadCountIsHidden {
rUnread.origin.x -= MainFeedTableViewCellLayout.editingControlIndent
labelWidth = cellWidth - (rLabelx + MainFeedTableViewCellLayout.labelMarginRight + (cellWidth - rUnread.minX))
} else {
labelWidth = cellWidth - (rLabelx + MainFeedTableViewCellLayout.labelMarginRight + MainFeedTableViewCellLayout.editingControlIndent)
}
}
var rLabel = CGRect(x: rLabelx, y: rLabely, width: labelWidth, height: labelSizeInfo.size.height)
// Determine cell height
let paddedLabelHeight = rLabel.maxY + UIFontMetrics.default.scaledValue(for: MainFeedTableViewCellLayout.verticalPadding)
let maxGraphicsHeight = [rFavicon, rUnread, rDisclosure].maxY()
var cellHeight = max(paddedLabelHeight, maxGraphicsHeight)
if cellHeight < MainFeedTableViewCellLayout.minRowHeight {
cellHeight = MainFeedTableViewCellLayout.minRowHeight
}
// Center in Cell
let newBounds = CGRect(x: bounds.origin.x, y: bounds.origin.y, width: bounds.width, height: cellHeight)
if !unreadCountIsHidden {
rUnread = MainFeedTableViewCellLayout.centerVertically(rUnread, newBounds)
}
if shouldShowDisclosure {
rDisclosure = MainFeedTableViewCellLayout.centerVertically(rDisclosure, newBounds)
}
// Small fonts and the Favicon need centered if we hit the minimum row height
if cellHeight == MainFeedTableViewCellLayout.minRowHeight {
rLabel = MainFeedTableViewCellLayout.centerVertically(rLabel, newBounds)
rFavicon = MainFeedTableViewCellLayout.centerVertically(rFavicon, newBounds)
}
// Separator Insets
let separatorInset = MainFeedTableViewCellLayout.disclosureButtonSize.width
separatorRect = CGRect(x: separatorInset, y: cellHeight - 0.5, width: cellWidth - separatorInset, height: 0.5)
// Assign the properties
self.height = cellHeight
self.faviconRect = rFavicon
self.unreadCountRect = rUnread
self.disclosureButtonRect = rDisclosure
self.titleRect = rLabel
}
// Ideally this will be implemented in RSCore (see RSGeometry)
static func centerVertically(_ originalRect: CGRect, _ containerRect: CGRect) -> CGRect {
var result = originalRect
result.origin.y = containerRect.midY - (result.height / 2.0)
result = result.integral
result.size = originalRect.size
return result
}
}
@@ -1,213 +0,0 @@
//
// MainTableViewSectionHeader.swift
// NetNewsWire
//
// Created by Maurice Parker on 4/18/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
protocol MainFeedTableViewSectionHeaderDelegate {
func mainFeedTableViewSectionHeaderDisclosureDidToggle(_ sender: MainFeedTableViewSectionHeader)
}
class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView {
var delegate: MainFeedTableViewSectionHeaderDelegate?
override var accessibilityLabel: String? {
set {}
get {
if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
return "\(name) \(unreadCount) \(unreadLabel) \(expandedStateMessage) "
} else {
return "\(name) \(expandedStateMessage) "
}
}
}
private var expandedStateMessage: String {
set {}
get {
if disclosureExpanded {
return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility")
}
return NSLocalizedString("Collapsed", comment: "Disclosure button collapsed state for accessibility")
}
}
var unreadCount: Int {
get {
return unreadCountView.unreadCount
}
set {
if unreadCountView.unreadCount != newValue {
unreadCountView.unreadCount = newValue
updateUnreadCountView()
setNeedsLayout()
}
}
}
var name: String {
get {
return titleView.text ?? ""
}
set {
if titleView.text != newValue {
titleView.text = newValue
setNeedsLayout()
}
}
}
var disclosureExpanded = false {
didSet {
updateExpandedState(animate: true)
updateUnreadCountView()
}
}
var isLastSection = false
private let titleView: UILabel = {
let label = NonIntrinsicLabel()
label.numberOfLines = 0
label.allowsDefaultTighteningForTruncation = false
label.adjustsFontForContentSizeCategory = true
label.font = .preferredFont(forTextStyle: .body)
return label
}()
private let unreadCountView = MainFeedUnreadCountView(frame: CGRect.zero)
private lazy var disclosureButton: UIButton = {
let button = NonIntrinsicButton()
button.tintColor = UIColor.tertiaryLabel
button.setImage(AppAssets.disclosureImage, for: .normal)
button.contentMode = .center
if #available(iOS 13.4, *) {
button.addInteraction(UIPointerInteraction())
}
button.addTarget(self, action: #selector(toggleDisclosure), for: .touchUpInside)
return button
}()
private let topSeparatorView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.separator
return view
}()
private let bottomSeparatorView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.separator
return view
}()
override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
override func sizeThatFits(_ size: CGSize) -> CGSize {
let layout = MainFeedTableViewSectionHeaderLayout(cellWidth: size.width, insets: safeAreaInsets, label: titleView, unreadCountView: unreadCountView)
return CGSize(width: bounds.width, height: layout.height)
}
override func layoutSubviews() {
super.layoutSubviews()
let layout = MainFeedTableViewSectionHeaderLayout(cellWidth: contentView.bounds.size.width,
insets: contentView.safeAreaInsets,
label: titleView,
unreadCountView: unreadCountView)
layoutWith(layout)
}
}
private extension MainFeedTableViewSectionHeader {
@objc func toggleDisclosure() {
delegate?.mainFeedTableViewSectionHeaderDisclosureDidToggle(self)
}
func commonInit() {
addSubviewAtInit(unreadCountView)
addSubviewAtInit(titleView)
addSubviewAtInit(disclosureButton)
updateExpandedState(animate: false)
addBackgroundView()
addSubviewAtInit(topSeparatorView)
addSubviewAtInit(bottomSeparatorView)
}
func updateExpandedState(animate: Bool) {
if !isLastSection && self.disclosureExpanded {
self.bottomSeparatorView.isHidden = false
}
let duration = animate ? 0.3 : 0.0
UIView.animate(
withDuration: duration,
animations: {
if self.disclosureExpanded {
self.disclosureButton.transform = CGAffineTransform(rotationAngle: 1.570796)
} else {
self.disclosureButton.transform = CGAffineTransform(rotationAngle: 0)
}
}, completion: { _ in
if !self.isLastSection && !self.disclosureExpanded {
self.bottomSeparatorView.isHidden = true
}
})
}
func updateUnreadCountView() {
if !disclosureExpanded && unreadCount > 0 {
UIView.animate(withDuration: 0.3) {
self.unreadCountView.alpha = 1
}
} else {
UIView.animate(withDuration: 0.3) {
self.unreadCountView.alpha = 0
}
}
}
func addSubviewAtInit(_ view: UIView) {
contentView.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
}
func layoutWith(_ layout: MainFeedTableViewSectionHeaderLayout) {
titleView.setFrameIfNotEqual(layout.titleRect)
unreadCountView.setFrameIfNotEqual(layout.unreadCountRect)
disclosureButton.setFrameIfNotEqual(layout.disclosureButtonRect)
let x = -safeAreaInsets.left
let width = safeAreaInsets.left + safeAreaInsets.right + frame.width
let height = 0.33
let top = CGRect(x: x, y: 0, width: width, height: height)
topSeparatorView.setFrameIfNotEqual(top)
let bottom = CGRect(x: x, y: frame.height - height, width: width, height: height)
bottomSeparatorView.setFrameIfNotEqual(bottom)
}
func addBackgroundView() {
self.backgroundView = UIView(frame: self.bounds)
self.backgroundView?.backgroundColor = AppAssets.sectionHeaderColor
}
}
@@ -1,90 +0,0 @@
//
// MainFeedTableViewSectionHeaderLayout.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 11/5/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
import RSCore
struct MainFeedTableViewSectionHeaderLayout {
private static let labelMarginRight = CGFloat(integerLiteral: 8)
private static let unreadCountMarginRight = CGFloat(integerLiteral: 16)
private static let disclosureButtonSize = CGSize(width: 44, height: 44)
private static let verticalPadding = CGFloat(integerLiteral: 11)
private static let minRowHeight = CGFloat(integerLiteral: 44)
let titleRect: CGRect
let unreadCountRect: CGRect
let disclosureButtonRect: CGRect
let height: CGFloat
init(cellWidth: CGFloat, insets: UIEdgeInsets, label: UILabel, unreadCountView: MainFeedUnreadCountView) {
let bounds = CGRect(x: insets.left, y: 0.0, width: floor(cellWidth - insets.right), height: 0.0)
// Disclosure Button
var rDisclosure = CGRect.zero
rDisclosure.size = MainFeedTableViewSectionHeaderLayout.disclosureButtonSize
rDisclosure.origin.x = bounds.origin.x
// Unread Count
let unreadCountSize = unreadCountView.contentSize
let unreadCountIsHidden = unreadCountView.unreadCount < 1
var rUnread = CGRect.zero
if !unreadCountIsHidden {
rUnread.size = unreadCountSize
rUnread.origin.x = bounds.maxX - (MainFeedTableViewSectionHeaderLayout.unreadCountMarginRight + unreadCountSize.width)
}
// Max Unread Count
// We can't reload Section Headers so we don't let the title extend into the (probably) worse case Unread Count area.
let maxUnreadCountView = MainFeedUnreadCountView(frame: CGRect.zero)
maxUnreadCountView.unreadCount = 888
let maxUnreadCountSize = maxUnreadCountView.contentSize
// Title
let rLabelx = insets.left + MainFeedTableViewSectionHeaderLayout.disclosureButtonSize.width
let rLabely = UIFontMetrics.default.scaledValue(for: MainFeedTableViewSectionHeaderLayout.verticalPadding)
var labelWidth = CGFloat.zero
labelWidth = cellWidth - (rLabelx + MainFeedTableViewSectionHeaderLayout.labelMarginRight + maxUnreadCountSize.width + MainFeedTableViewSectionHeaderLayout.unreadCountMarginRight)
let labelSizeInfo = MultilineUILabelSizer.size(for: label.text ?? "", font: label.font, numberOfLines: 0, width: Int(floor(labelWidth)))
var rLabel = CGRect(x: rLabelx, y: rLabely, width: labelWidth, height: labelSizeInfo.size.height)
// Determine cell height
let paddedLabelHeight = rLabel.maxY + UIFontMetrics.default.scaledValue(for: MainFeedTableViewSectionHeaderLayout.verticalPadding)
let maxGraphicsHeight = [rUnread, rDisclosure].maxY()
var cellHeight = max(paddedLabelHeight, maxGraphicsHeight)
if cellHeight < MainFeedTableViewSectionHeaderLayout.minRowHeight {
cellHeight = MainFeedTableViewSectionHeaderLayout.minRowHeight
}
// Center in Cell
let newBounds = CGRect(x: bounds.origin.x, y: bounds.origin.y, width: bounds.width, height: cellHeight)
if !unreadCountIsHidden {
rUnread = MainFeedTableViewCellLayout.centerVertically(rUnread, newBounds)
}
rDisclosure = MainFeedTableViewCellLayout.centerVertically(rDisclosure, newBounds)
// Small fonts need centered if we hit the minimum row height
if cellHeight == MainFeedTableViewSectionHeaderLayout.minRowHeight {
rLabel = MainFeedTableViewCellLayout.centerVertically(rLabel, newBounds)
}
// Assign the properties
self.height = cellHeight
self.unreadCountRect = rUnread
self.disclosureButtonRect = rDisclosure
self.titleRect = rLabel
}
}
@@ -1,123 +0,0 @@
//
// MainFeedUnreadCountView.swift
// NetNewsWire
//
// Created by Brent Simmons on 11/22/15.
// Copyright © 2015 Ranchero Software, LLC. All rights reserved.
//
import UIKit
class MainFeedUnreadCountView : UIView {
var padding: UIEdgeInsets {
return UIEdgeInsets(top: 1.0, left: 9.0, bottom: 1.0, right: 9.0)
}
let cornerRadius = 8.0
let bgColor = AppAssets.controlBackgroundColor
var textColor: UIColor {
return UIColor.white
}
var textAttributes: [NSAttributedString.Key: AnyObject] {
let textFont = UIFont.preferredFont(forTextStyle: .caption1).bold()
return [NSAttributedString.Key.foregroundColor: textColor, NSAttributedString.Key.font: textFont, NSAttributedString.Key.kern: NSNull()]
}
var textSizeCache = [Int: CGSize]()
var unreadCount = 0 {
didSet {
contentSizeIsValid = false
invalidateIntrinsicContentSize()
setNeedsDisplay()
}
}
var unreadCountString: String {
return unreadCount < 1 ? "" : "\(unreadCount)"
}
private var contentSizeIsValid = false
private var _contentSize = CGSize.zero
override init(frame: CGRect) {
super.init(frame: frame)
self.isOpaque = false
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.isOpaque = false
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
textSizeCache = [Int: CGSize]()
contentSizeIsValid = false
setNeedsDisplay()
}
var contentSize: CGSize {
if !contentSizeIsValid {
var size = CGSize.zero
if unreadCount > 0 {
size = textSize()
size.width += (padding.left + padding.right)
size.height += (padding.top + padding.bottom)
}
_contentSize = size
contentSizeIsValid = true
}
return _contentSize
}
// Prevent autolayout from messing around with our frame settings
override var intrinsicContentSize: CGSize {
return CGSize(width: UIView.noIntrinsicMetric, height: UIView.noIntrinsicMetric)
}
func textSize() -> CGSize {
if unreadCount < 1 {
return CGSize.zero
}
if let cachedSize = textSizeCache[unreadCount] {
return cachedSize
}
var size = unreadCountString.size(withAttributes: textAttributes)
size.height = ceil(size.height)
size.width = ceil(size.width)
textSizeCache[unreadCount] = size
return size
}
func textRect() -> CGRect {
let size = textSize()
var r = CGRect.zero
r.size = size
r.origin.x = (bounds.maxX - padding.right) - r.size.width
r.origin.y = padding.top
return r
}
override func draw(_ dirtyRect: CGRect) {
let cornerRadii = CGSize(width: cornerRadius, height: cornerRadius)
let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: .allCorners, cornerRadii: cornerRadii)
bgColor.setFill()
path.fill()
if unreadCount > 0 {
unreadCountString.draw(at: textRect().origin, withAttributes: textAttributes)
}
}
}
@@ -87,7 +87,9 @@ class MainFeedCollectionViewCell: UICollectionViewCell {
case (true, .pad):
backgroundConfig.backgroundColor = .tertiarySystemFill
feedTitle.textColor = AppAssets.primaryAccentColor
feedTitle.font = feedTitle.font.bold()
feedTitle.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize,
weight: .semibold)
unreadCountLabel.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
case (true, .phone):
backgroundConfig.backgroundColor = AppAssets.primaryAccentColor
feedTitle.textColor = .white
@@ -98,6 +100,7 @@ class MainFeedCollectionViewCell: UICollectionViewCell {
default:
feedTitle.textColor = .label
feedTitle.font = UIFont.preferredFont(forTextStyle: .body)
unreadCountLabel.font = UIFont.preferredFont(forTextStyle: .body)
unreadCountLabel.textColor = .secondaryLabel
if traitCollection.userInterfaceIdiom == .phone {
if feedTitle.text == "All Unread" {
@@ -32,6 +32,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
unreadCountLabel.isHidden = true
} else {
unreadCountLabel.isHidden = false
updateUnreadCount()
}
unreadCountLabel.text = newValue.formatted()
}
@@ -74,7 +75,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
}
func updateUnreadCount() {
if !disclosureExpanded && unreadCount > 0 {
if !disclosureExpanded && unreadCount > 0 && unreadCountLabel.alpha != 1 {
UIView.animate(withDuration: 0.3) {
self.unreadCountLabel.alpha = 1
}
@@ -115,7 +116,8 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
case (true, .pad):
backgroundConfig.backgroundColor = .tertiarySystemFill
folderTitle.textColor = AppAssets.primaryAccentColor
folderTitle.font = folderTitle.font.bold()
folderTitle.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
unreadCountLabel.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
case (true, .phone):
backgroundConfig.backgroundColor = AppAssets.primaryAccentColor
folderTitle.textColor = .white
@@ -125,6 +127,7 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
folderTitle.textColor = .label
faviconView.tintColor = AppAssets.primaryAccentColor
folderTitle.font = UIFont.preferredFont(forTextStyle: .body)
unreadCountLabel.font = UIFont.preferredFont(forTextStyle: .body)
}
if state.cellDropState == .targeted {
@@ -28,7 +28,7 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
if #available(iOS 14, *) {
addNewItemButton.primaryAction = nil
} else {
addNewItemButton.action = #selector(MainFeedViewController.add(_:))
addNewItemButton.action = #selector(MainFeedCollectionViewController.add(_:))
}
}
}
@@ -713,6 +713,33 @@ class MainFeedCollectionViewController: UICollectionViewController, UndoableComm
}
}
@IBAction func add(_ sender: UIBarButtonItem) {
let title = NSLocalizedString("Add Item", comment: "Add Item")
let alertController = UIAlertController(title: title, message: nil, preferredStyle: .actionSheet)
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel")
let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel)
let addWebFeedActionTitle = NSLocalizedString("Add Web Feed", comment: "Add Web Feed")
let addWebFeedAction = UIAlertAction(title: addWebFeedActionTitle, style: .default) { _ in
self.coordinator.showAddWebFeed()
}
let addWebFolderdActionTitle = NSLocalizedString("Add Folder", comment: "Add Folder")
let addWebFolderAction = UIAlertAction(title: addWebFolderdActionTitle, style: .default) { _ in
self.coordinator.showAddFolder()
}
alertController.addAction(addWebFeedAction)
alertController.addAction(addWebFolderAction)
alertController.addAction(cancelAction)
alertController.popoverPresentationController?.barButtonItem = sender
present(alertController, animated: true)
}
@IBAction func toggleFilter(_ sender: Any) {
coordinator.toggleReadFeedsFilter()
@@ -1,34 +0,0 @@
//
// MainFeedViewController+Drag.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 11/20/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
import MobileCoreServices
import Account
import UniformTypeIdentifiers
extension MainFeedViewController: UITableViewDragDelegate {
func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
guard let node = coordinator.nodeFor(indexPath), let webFeed = node.representedObject as? WebFeed else {
return [UIDragItem]()
}
let data = webFeed.url.data(using: .utf8)
let itemProvider = NSItemProvider()
itemProvider.registerDataRepresentation(forTypeIdentifier: UTType.url.identifier, visibility: .ownProcess) { completion in
completion(data, nil)
return nil
}
let dragItem = UIDragItem(itemProvider: itemProvider)
dragItem.localObject = node
return [dragItem]
}
}
@@ -1,166 +0,0 @@
//
// MainFeedViewController+Drop.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 11/20/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
import RSCore
import Account
import RSTree
extension MainFeedViewController: UITableViewDropDelegate {
func tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool {
return session.localDragSession != nil
}
func tableView(_ tableView: UITableView, dropSessionDidUpdate session: UIDropSession, withDestinationIndexPath destinationIndexPath: IndexPath?) -> UITableViewDropProposal {
guard let destIndexPath = destinationIndexPath, destIndexPath.section > 0, tableView.hasActiveDrag else {
return UITableViewDropProposal(operation: .forbidden)
}
guard let destFeed = coordinator.nodeFor(destIndexPath)?.representedObject as? Feed,
let destAccount = destFeed.account,
let destCell = tableView.cellForRow(at: destIndexPath) else {
return UITableViewDropProposal(operation: .forbidden)
}
// Validate account specific behaviors...
if destAccount.behaviors.contains(.disallowFeedInMultipleFolders),
let sourceNode = session.localDragSession?.items.first?.localObject as? Node,
let sourceWebFeed = sourceNode.representedObject as? WebFeed,
sourceWebFeed.account?.accountID != destAccount.accountID && destAccount.hasWebFeed(withURL: sourceWebFeed.url) {
return UITableViewDropProposal(operation: .forbidden)
}
// Determine the correct drop proposal
if destFeed is Folder {
if session.location(in: destCell).y >= 0 {
return UITableViewDropProposal(operation: .move, intent: .insertIntoDestinationIndexPath)
} else {
return UITableViewDropProposal(operation: .move, intent: .unspecified)
}
} else {
return UITableViewDropProposal(operation: .move, intent: .insertAtDestinationIndexPath)
}
}
func tableView(_ tableView: UITableView, performDropWith dropCoordinator: UITableViewDropCoordinator) {
guard let dragItem = dropCoordinator.items.first?.dragItem,
let dragNode = dragItem.localObject as? Node,
let source = dragNode.parent?.representedObject as? Container,
let destIndexPath = dropCoordinator.destinationIndexPath else {
return
}
let isFolderDrop: Bool = {
if coordinator.nodeFor(destIndexPath)?.representedObject is Folder, let propCell = tableView.cellForRow(at: destIndexPath) {
return dropCoordinator.session.location(in: propCell).y >= 0
}
return false
}()
// Based on the drop we have to determine a node to start looking for a parent container.
let destNode: Node? = {
if isFolderDrop {
return coordinator.nodeFor(destIndexPath)
} else {
if destIndexPath.row == 0 {
return coordinator.nodeFor(IndexPath(row: 0, section: destIndexPath.section))
} else if destIndexPath.row > 0 {
return coordinator.nodeFor(IndexPath(row: destIndexPath.row - 1, section: destIndexPath.section))
} else {
return nil
}
}
}()
// Now we start looking for the parent container
let destinationContainer: Container? = {
if let container = (destNode?.representedObject as? Container) ?? (destNode?.parent?.representedObject as? Container) {
return container
} else {
// If we got here, we are trying to drop on an empty section header. Go and find the Account for this section
return coordinator.rootNode.childAtIndex(destIndexPath.section)?.representedObject as? Account
}
}()
guard let destination = destinationContainer, let webFeed = dragNode.representedObject as? WebFeed else { return }
if source.account == destination.account {
moveWebFeedInAccount(feed: webFeed, sourceContainer: source, destinationContainer: destination)
} else {
moveWebFeedBetweenAccounts(feed: webFeed, sourceContainer: source, destinationContainer: destination)
}
}
func moveWebFeedInAccount(feed: WebFeed, sourceContainer: Container, destinationContainer: Container) {
guard sourceContainer !== destinationContainer else { return }
BatchUpdate.shared.start()
sourceContainer.account?.moveWebFeed(feed, from: sourceContainer, to: destinationContainer) { result in
BatchUpdate.shared.end()
switch result {
case .success:
break
case .failure(let error):
self.presentError(error)
}
}
}
func moveWebFeedBetweenAccounts(feed: WebFeed, sourceContainer: Container, destinationContainer: Container) {
if let existingFeed = destinationContainer.account?.existingWebFeed(withURL: feed.url) {
BatchUpdate.shared.start()
destinationContainer.account?.addWebFeed(existingFeed, to: destinationContainer) { result in
switch result {
case .success:
sourceContainer.account?.removeWebFeed(feed, from: sourceContainer) { result in
BatchUpdate.shared.end()
switch result {
case .success:
break
case .failure(let error):
self.presentError(error)
}
}
case .failure(let error):
BatchUpdate.shared.end()
self.presentError(error)
}
}
} else {
BatchUpdate.shared.start()
destinationContainer.account?.createWebFeed(url: feed.url, name: feed.editedName, container: destinationContainer, validateFeed: false) { result in
switch result {
case .success:
sourceContainer.account?.removeWebFeed(feed, from: sourceContainer) { result in
BatchUpdate.shared.end()
switch result {
case .success:
break
case .failure(let error):
self.presentError(error)
}
}
case .failure(let error):
BatchUpdate.shared.end()
self.presentError(error)
}
}
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1,64 +0,0 @@
//
// MainTimelineTitleView.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 9/21/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class MainTimelineTitleView: UIView {
@IBOutlet var iconView: IconView?
@IBOutlet var label: UILabel?
@IBOutlet var unreadCountView: MainTimelineUnreadCountView?
@available(iOS 13.4, *)
private lazy var pointerInteraction: UIPointerInteraction = {
UIPointerInteraction(delegate: self)
}()
override var accessibilityLabel: String? {
set { }
get {
if let name = label?.text {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
return "\(name) \(unreadCountView?.unreadCount ?? 0) \(unreadLabel)"
}
else {
return nil
}
}
}
func buttonize() {
heightAnchor.constraint(equalToConstant: 25.0).isActive = true
accessibilityTraits = .button
if #available(iOS 13.4, *) {
addInteraction(pointerInteraction)
}
}
func debuttonize() {
heightAnchor.constraint(equalToConstant: 25.0).isActive = true
accessibilityTraits.remove(.button)
if #available(iOS 13.4, *) {
removeInteraction(pointerInteraction)
}
}
}
extension MainTimelineTitleView: UIPointerInteractionDelegate {
@available(iOS 13.4, *)
func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
var rect = self.frame
rect.origin.x = rect.origin.x - 10
rect.size.width = rect.width + 20
return UIPointerStyle(effect: .automatic(UITargetedPreview(view: self)), shape: .roundedRect(rect))
}
}
@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24093.9" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24057"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MainTimelineTitleView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="190" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bqn-VJ-KYE" userLabel="Container">
<rect key="frame" x="60" y="0.0" width="70" height="20"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5gI-Wl-lnK" customClass="IconView" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="TgA-1l-WQJ"/>
<constraint firstAttribute="height" constant="20" id="VUB-ip-zXU"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5F6-2v-qSS">
<rect key="frame" x="26" y="0.0" width="44" height="20"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="5gI-Wl-lnK" firstAttribute="leading" secondItem="Bqn-VJ-KYE" secondAttribute="leading" id="Fbv-uD-N4j"/>
<constraint firstAttribute="height" constant="20" id="dvT-BP-jgf"/>
<constraint firstItem="5F6-2v-qSS" firstAttribute="leading" secondItem="5gI-Wl-lnK" secondAttribute="trailing" constant="6" id="gbZ-1B-eSF"/>
<constraint firstAttribute="trailing" secondItem="5F6-2v-qSS" secondAttribute="trailing" id="uqP-m4-XH1"/>
<constraint firstItem="5gI-Wl-lnK" firstAttribute="centerY" secondItem="Bqn-VJ-KYE" secondAttribute="centerY" id="vEb-sE-d97"/>
<constraint firstItem="5F6-2v-qSS" firstAttribute="centerY" secondItem="Bqn-VJ-KYE" secondAttribute="centerY" id="wgn-WM-XGW"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Bqn-VJ-KYE" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="DUz-23-RoJ"/>
<constraint firstItem="Bqn-VJ-KYE" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="OCN-Ec-TgC"/>
</constraints>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="iconView" destination="5gI-Wl-lnK" id="IiR-qS-d22"/>
<outlet property="label" destination="5F6-2v-qSS" id="ec7-8Y-PRv"/>
</connections>
<point key="canvasLocation" x="14.492753623188406" y="-224.33035714285714"/>
</view>
</objects>
</document>
@@ -1,39 +0,0 @@
//
// MainTimelineUnreadCountView.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 9/30/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class MainTimelineUnreadCountView: MainFeedUnreadCountView {
override var padding: UIEdgeInsets {
return UIEdgeInsets(top: 2.0, left: 9.0, bottom: 2.0, right: 9.0)
}
override var textColor: UIColor {
return UIColor.systemBackground
}
override var intrinsicContentSize: CGSize {
return contentSize
}
override func draw(_ dirtyRect: CGRect) {
let cornerRadii = CGSize(width: cornerRadius, height: cornerRadius)
let rect = CGRect(x: 1, y: 1, width: bounds.width - 2, height: bounds.height - 2)
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: .allCorners, cornerRadii: cornerRadii)
AppAssets.primaryAccentColor.setFill()
path.fill()
if unreadCount > 0 {
unreadCountString.draw(at: textRect().origin, withAttributes: textAttributes)
}
}
}
@@ -106,6 +106,30 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
return keyboardManager.keyCommands
}
private var navigationBarTitleLabel: UILabel {
let label = UILabel()
label.font = UIFont.preferredFont(forTextStyle: .subheadline).bold()
label.isUserInteractionEnabled = true
label.numberOfLines = 1
label.textAlignment = .center
let tap = UITapGestureRecognizer(target: self, action: #selector(showFeedInspector(_:)))
label.addGestureRecognizer(tap)
let pointerInteraction = UIPointerInteraction(delegate: nil)
label.addInteraction(pointerInteraction)
return label
}
private var navigationBarSubtitleTitleLabel: UILabel {
let label = UILabel()
label.font = UIFont.preferredFont(forTextStyle: .footnote)
label.textColor = .systemGray
label.textAlignment = .center
label.isUserInteractionEnabled = true
let tap = UITapGestureRecognizer(target: self, action: #selector(showFeedInspector(_:)))
label.addGestureRecognizer(tap)
return label
}
override var canBecomeFirstResponder: Bool {
return true
}
@@ -157,7 +181,6 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
numberOfTextLines = AppDefaults.shared.timelineNumberOfLines
iconSize = AppDefaults.shared.timelineIconSize
resetEstimatedRowHeight()
refreshControl = UIRefreshControl()
refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged)
@@ -178,6 +201,8 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
gesture.allowedScrollTypesMask = []
navigationItem.titleView = navigationBarTitleLabel
navigationItem.subtitleView = navigationBarSubtitleTitleLabel
}
override func viewWillAppear(_ animated: Bool) {
@@ -188,7 +213,9 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
if navigationController?.navigationBar.isHidden ?? false {
navigationController?.navigationBar.alpha = 0
}
navigationItem.subtitle = "" // don't inherit feeds subtitle on push
//navigationItem.subtitle = "" // don't inherit feeds subtitle on push
updateNavigationBarTitle(coordinator?.timelineFeed?.nameForDisplay ?? "")
updateNavigationBarSubtitle("")
}
override func viewDidAppear(_ animated: Bool) {
@@ -304,6 +331,22 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
}
}
func updateNavigationBarTitle(_ text: String) {
if let label = navigationItem.titleView as? UILabel {
label.text = text
label.isUserInteractionEnabled = ((coordinator?.timelineFeed as? PseudoFeed) == nil)
label.sizeToFit()
}
}
func updateNavigationBarSubtitle(_ text: String) {
if let label = navigationItem.subtitleView as? UILabel {
label.text = text
label.isUserInteractionEnabled = ((coordinator?.timelineFeed as? PseudoFeed) == nil)
label.sizeToFit()
}
}
func reinitializeArticles(resetScroll: Bool) {
resetUI(resetScroll: resetScroll)
@@ -327,7 +370,6 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
func updateUI() {
refreshProgressView?.update()
updateTitleUnreadCount()
updateToolbar()
}
@@ -549,11 +591,7 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
@objc func webFeedIconDidBecomeAvailable(_ note: Notification) {
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
titleView.iconView?.iconImage = timelineIconImage
}
guard let feed = note.userInfo?[UserInfoKey.webFeed] as? WebFeed else {
return
}
@@ -578,7 +616,7 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
return
}
for author in authors {
if author.avatarURL == avatarURL, let cell = tableView.cellForRow(at: indexPath) as? MainTimelineTableViewCell, let image = iconImageFor(article) {
if author.avatarURL == avatarURL, let cell = tableView.cellForRow(at: indexPath) as? MainTimelineIconFeedCell, let image = iconImageFor(article) {
cell.setIconImage(image)
}
}
@@ -586,9 +624,6 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
@objc func faviconDidBecomeAvailable(_ note: Notification) {
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
titleView.iconView?.iconImage = timelineIconImage
}
if showIcons {
queueReloadAvailableCells()
}
@@ -599,7 +634,6 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
if self.numberOfTextLines != AppDefaults.shared.timelineNumberOfLines || self.iconSize != AppDefaults.shared.timelineIconSize {
self.numberOfTextLines = AppDefaults.shared.timelineNumberOfLines
self.iconSize = AppDefaults.shared.timelineIconSize
self.resetEstimatedRowHeight()
self.reloadAllVisibleCells()
}
self.updateToolbar()
@@ -611,9 +645,7 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
@objc func displayNameDidChange(_ note: Notification) {
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
titleView.label?.text = timelineFeed?.nameForDisplay
}
updateNavigationBarTitle(timelineFeed?.nameForDisplay ?? "")
}
@objc func willEnterForeground(_ note: Notification) {
@@ -643,28 +675,6 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
}
}
// MARK: Cell Configuring
private func resetEstimatedRowHeight() {
let longTitle = "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
let prototypeID = "prototype"
let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date())
let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, webFeedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status)
let prototypeCellData = MainTimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false, numberOfLines: numberOfTextLines, iconSize: iconSize)
if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory {
let layout = MainTimelineAccessibilityCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
tableView.estimatedRowHeight = layout.height
} else {
let layout = MainTimelineDefaultCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
tableView.estimatedRowHeight = layout.height
}
}
}
// MARK: Searching
@@ -764,12 +774,6 @@ private extension MainTimelineViewController {
}
}
func updateTitleUnreadCount() {
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
titleView.unreadCountView?.unreadCount = coordinator?.timelineUnreadCount ?? 0
}
}
func applyChanges(animated: Bool, completion: (() -> Void)? = nil) {
if (articles?.count ?? 0) == 0 {
tableView.rowHeight = tableView.estimatedRowHeight
@@ -89,17 +89,27 @@ class MainTimelineFeedCell: UITableViewCell {
let attributedCellText = NSMutableAttributedString()
let isSelected = state.isSelected || state.isHighlighted || state.isFocused || state.isSwiped
if cellData.title != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let titleAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .headline),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let titleWithNewline = cellData.title + "\n"
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
attributedCellText.append(titleAttributed)
}
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: cellData.summary, attributes: summaryAttributes)
@@ -113,19 +113,32 @@ class MainTimelineIconFeedCell: UITableViewCell {
private func applyTitleTextWithAttributes(_ state: UICellConfigurationState) {
let attributedCellText = NSMutableAttributedString()
let isSelected = state.isSelected || state.isHighlighted || state.isFocused || state.isSwiped
if cellData.title != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let titleAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .headline),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let titleWithNewline = cellData.title + "\n"
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
attributedCellText.append(titleAttributed)
}
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: cellData.summary, attributes: summaryAttributes)
+8 -8
View File
@@ -161,7 +161,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
private var exceptionArticleFetcher: ArticleFetcher?
private(set) var timelineFeed: Feed? {
didSet {
mainTimelineViewController?.navigationItem.title = timelineFeed?.nameForDisplay
mainTimelineViewController?.updateNavigationBarTitle(timelineFeed?.nameForDisplay ?? "")
updateNavigationBarSubtitles(nil)
}
}
@@ -599,13 +599,13 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
if let _ = timelineFeed, timelineUnreadCount > 0 {
let localizedUnreadCount = NSLocalizedString("%i Unread", comment: "14 Unread")
let unreadCount = NSString.localizedStringWithFormat(localizedUnreadCount as NSString, timelineUnreadCount) as String
self.mainTimelineViewController?.navigationItem.subtitle = unreadCount
self.mainTimelineViewController?.updateNavigationBarSubtitle(unreadCount)
} else {
// When unread count == 0, iPhone timeline displays Updated Just Now; iPad is blank
if UIDevice.current.userInterfaceIdiom == .phone {
self.mainTimelineViewController?.navigationItem.subtitle = refreshText
self.mainTimelineViewController?.updateNavigationBarSubtitle(refreshText)
} else {
self.mainTimelineViewController?.navigationItem.subtitle = ""
self.mainTimelineViewController?.updateNavigationBarSubtitle("")
}
}
} else {
@@ -616,19 +616,19 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
if let _ = timelineFeed, timelineUnreadCount > 0 {
let localizedUnreadCount = NSLocalizedString("%i Unread", comment: "14 Unread")
let refreshTextWithUnreadCount = NSString.localizedStringWithFormat(localizedUnreadCount as NSString, timelineUnreadCount) as String
self.mainTimelineViewController?.navigationItem.subtitle = refreshTextWithUnreadCount
self.mainTimelineViewController?.updateNavigationBarSubtitle(refreshTextWithUnreadCount)
} else {
// When unread count == 0, iPhone timeline displays Updated Just Now; iPad is blank
if UIDevice.current.userInterfaceIdiom == .phone {
self.mainTimelineViewController?.navigationItem.subtitle = NSLocalizedString("Updated Just Now", comment: "Updated Just Now")
self.mainTimelineViewController?.updateNavigationBarSubtitle(NSLocalizedString("Updated Just Now", comment: "Updated Just Now"))
} else {
self.mainTimelineViewController?.navigationItem.subtitle = ""
self.mainTimelineViewController?.updateNavigationBarSubtitle("")
}
}
}
} else {
self.mainFeedCollectionViewController?.navigationItem.subtitle = ""
self.mainTimelineViewController?.navigationItem.subtitle = ""
self.mainTimelineViewController?.updateNavigationBarSubtitle("")
}
} else {
// Updating in progress, apply to both iPhone and iPad Feeds.
@@ -1,7 +1,7 @@
// High Level Settings common to both the iOS application and any extensions we bundle with it
MARKETING_VERSION = 6.1.9
CURRENT_PROJECT_VERSION = 6197
MARKETING_VERSION = 6.1.10
CURRENT_PROJECT_VERSION = 6198
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -1,6 +1,6 @@
// High Level Settings common to both the Mac application and any extensions we bundle with it
MARKETING_VERSION = 6.1.10b2
CURRENT_PROJECT_VERSION = 6137
MARKETING_VERSION = 6.1.10b3
CURRENT_PROJECT_VERSION = 6138
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon