Add select URL Builder dialog

This commit is contained in:
Maurice Parker 2020-04-23 04:44:26 -05:00
parent e11cf2ccf5
commit 4461cf83cb
6 changed files with 178 additions and 3 deletions

View File

@ -16,6 +16,8 @@
3B826DCE2385C89600FC1ADB /* AccountsFeedWranglerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */; };
49F40DF82335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; };
49F40DF92335B71000552BF4 /* newsfoot.js in Resources */ = {isa = PBXBuildFile; fileRef = 49F40DEF2335B71000552BF4 /* newsfoot.js */; };
510289AA2451967500426DDF /* SelectURLBuilderTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510289A92451967500426DDF /* SelectURLBuilderTableViewController.swift */; };
510289CD24519A1D00426DDF /* SelectComboTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510289CC24519A1D00426DDF /* SelectComboTableViewCell.swift */; };
5102FD83244009F000534F17 /* Secrets.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5102FD7B244008A700534F17 /* Secrets.framework */; };
5102FD84244009F000534F17 /* Secrets.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5102FD7B244008A700534F17 /* Secrets.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5102FD9B244009FA00534F17 /* Secrets.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5102FD7B244008A700534F17 /* Secrets.framework */; };
@ -1382,6 +1384,8 @@
3B826DB02385C84800FC1ADB /* AccountsFeedWrangler.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AccountsFeedWrangler.xib; sourceTree = "<group>"; };
3B826DCA2385C84800FC1ADB /* AccountsFeedWranglerWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountsFeedWranglerWindowController.swift; sourceTree = "<group>"; };
49F40DEF2335B71000552BF4 /* newsfoot.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = newsfoot.js; sourceTree = "<group>"; };
510289A92451967500426DDF /* SelectURLBuilderTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectURLBuilderTableViewController.swift; sourceTree = "<group>"; };
510289CC24519A1D00426DDF /* SelectComboTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectComboTableViewCell.swift; sourceTree = "<group>"; };
5102FD72244008A700534F17 /* Secrets.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Secrets.xcodeproj; path = Frameworks/Secrets/Secrets.xcodeproj; sourceTree = SOURCE_ROOT; };
5103A9972421643300410853 /* blank.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = blank.html; sourceTree = "<group>"; };
5103A9B324216A4200410853 /* blank.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = blank.html; sourceTree = "<group>"; };
@ -2269,6 +2273,8 @@
51E36E70239D6610006F47A5 /* AddWebFeedSelectFolderTableViewCell.swift */,
51E36E8B239D6765006F47A5 /* AddWebFeedSelectFolderTableViewCell.xib */,
51C452842265093600C03939 /* AddWebFeedViewController.swift */,
510289A92451967500426DDF /* SelectURLBuilderTableViewController.swift */,
510289CC24519A1D00426DDF /* SelectComboTableViewCell.swift */,
);
path = Add;
sourceTree = "<group>";
@ -4262,6 +4268,7 @@
51D5948722668EFA00DFC836 /* MarkStatusCommand.swift in Sources */,
51A1699C235E10D700EB091F /* AddAccountViewController.swift in Sources */,
51A16999235E10D700EB091F /* LocalAccountViewController.swift in Sources */,
510289CD24519A1D00426DDF /* SelectComboTableViewCell.swift in Sources */,
514B7C8323205EFB00BAC947 /* RootSplitViewController.swift in Sources */,
51FA73A52332BE110090D516 /* ArticleExtractor.swift in Sources */,
51314704235C41FC00387FDC /* Intents.intentdefinition in Sources */,
@ -4293,6 +4300,7 @@
51B5C87B23F2317700032075 /* ExtensionFeedAddRequest.swift in Sources */,
51627A93238A3836007B3B4B /* CroppingPreviewParameters.swift in Sources */,
512AF9DD236F05230066F8BE /* InteractiveLabel.swift in Sources */,
510289AA2451967500426DDF /* SelectURLBuilderTableViewController.swift in Sources */,
51E3EB3D229AB08300645299 /* ErrorHandler.swift in Sources */,
5183CCE5226F4DFA0010922C /* RefreshInterval.swift in Sources */,
51C4529D22650A1000C03939 /* FaviconURLFinder.swift in Sources */,

View File

@ -26,16 +26,25 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="URL" textAlignment="natural" adjustsFontForContentSizeCategory="YES" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="eRp-AP-WFq">
<rect key="frame" x="20" y="4" width="303" height="36"/>
<rect key="frame" x="20" y="4" width="269.66666666666669" height="36"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<textInputTraits key="textInputTraits" keyboardType="URL"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f0N-Iy-ZFD">
<rect key="frame" x="297.66666666666669" y="10.666666666666666" width="25.333333333333314" height="22.666666666666671"/>
<state key="normal" image="hammer" catalog="system"/>
<connections>
<action selector="showURLBuilder:" destination="7aE-6a-iP7" eventType="touchUpInside" id="wVv-BU-ND8"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="eRp-AP-WFq" firstAttribute="top" secondItem="eNS-Rp-w0A" secondAttribute="top" constant="4" id="80p-a2-3NC"/>
<constraint firstItem="f0N-Iy-ZFD" firstAttribute="centerY" secondItem="eRp-AP-WFq" secondAttribute="centerY" id="Ci9-Fe-KrJ"/>
<constraint firstItem="f0N-Iy-ZFD" firstAttribute="leading" secondItem="eRp-AP-WFq" secondAttribute="trailing" constant="8" id="ZNi-6o-A6w"/>
<constraint firstAttribute="trailing" secondItem="f0N-Iy-ZFD" secondAttribute="trailing" constant="20" symbolic="YES" id="aHH-ef-7dH"/>
<constraint firstItem="eRp-AP-WFq" firstAttribute="leading" secondItem="eNS-Rp-w0A" secondAttribute="leading" constant="20" symbolic="YES" id="bHJ-7l-Pl3"/>
<constraint firstAttribute="bottom" secondItem="eRp-AP-WFq" secondAttribute="bottom" constant="4" id="fs0-iw-zTo"/>
<constraint firstAttribute="trailing" secondItem="eRp-AP-WFq" secondAttribute="trailing" constant="20" symbolic="YES" id="xWD-54-Kdm"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
@ -436,8 +445,90 @@
</objects>
<point key="canvasLocation" x="-961" y="89"/>
</scene>
<!--Modal Navigation Controller-->
<scene sceneID="cdQ-dD-r6b">
<objects>
<navigationController storyboardIdentifier="SelectURLBuilderNavViewController" id="iBn-vt-JuI" customClass="ModalNavigationController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="5ft-mx-bH1">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="Wls-o6-7V8" kind="relationship" relationship="rootViewController" id="jlb-J3-50h"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tmd-jJ-oxP" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2452" y="1416"/>
</scene>
<!--Select URL Builder-->
<scene sceneID="uAc-pe-d1U">
<objects>
<tableViewController storyboardIdentifier="SelectURLBuilderViewController" title="Select URL Builder" id="Wls-o6-7V8" customClass="SelectURLBuilderTableViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="SBu-NT-kQA">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="URLBuilderCell" rowHeight="55" id="7Qf-cp-hyD" customClass="SelectComboTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="16" y="55.333332061767578" width="343" height="55"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7Qf-cp-hyD" id="Rsw-xP-7HT">
<rect key="frame" x="0.0" y="0.0" width="317" height="55"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="Jka-S1-56k">
<rect key="frame" x="20" y="15.666666666666664" width="130" height="24"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hammer" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="lQk-5J-fON">
<rect key="frame" x="0.0" y="-0.66666666666666785" width="24" height="26.333333333333336"/>
<color key="tintColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="u9L-D0-kgu"/>
<constraint firstAttribute="height" constant="24" id="wDw-bL-u3p"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="URL Builder" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ys7-kv-kLW">
<rect key="frame" x="40" y="0.0" width="90" height="24"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="Jka-S1-56k" firstAttribute="leading" secondItem="Rsw-xP-7HT" secondAttribute="leading" constant="20" symbolic="YES" id="2Sh-PL-a9u"/>
<constraint firstItem="Jka-S1-56k" firstAttribute="centerY" secondItem="Rsw-xP-7HT" secondAttribute="centerY" id="k1d-3l-LGF"/>
</constraints>
</tableViewCellContentView>
<inset key="separatorInset" minX="45" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<outlet property="icon" destination="lQk-5J-fON" id="uCm-OV-S80"/>
<outlet property="label" destination="Ys7-kv-kLW" id="v99-KU-U8q"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="Wls-o6-7V8" id="3V5-PC-jlM"/>
<outlet property="delegate" destination="Wls-o6-7V8" id="kWB-zE-rh5"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Select URL Builder" id="02z-m5-leN">
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="xeT-hn-DyW">
<connections>
<action selector="cancel:" destination="Wls-o6-7V8" id="9rX-tp-GwL"/>
</connections>
</barButtonItem>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qFt-gM-HqV" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1687" y="1416"/>
</scene>
</scenes>
<resources>
<image name="hammer" catalog="system" width="128" height="115"/>
<namedColor name="secondaryAccentColor">
<color red="0.031372549019607843" green="0.41568627450980394" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>

View File

@ -1,5 +1,5 @@
//
// AddWebFeedLocationViewController.swift
// AddWebFeedFolderViewController.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 11/16/19.

View File

@ -65,6 +65,12 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
}
@IBAction func showURLBuilder(_ sender: Any) {
let navController = UIStoryboard.add.instantiateViewController(withIdentifier: "SelectURLBuilderNavViewController") as! UINavigationController
navController.modalPresentationStyle = .currentContext
present(navController, animated: true)
}
func cancel() {
userCancelled = true
delegate?.processingDidCancel()

View File

@ -0,0 +1,26 @@
//
// SelectComboTableViewCell.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 4/23/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class SelectComboTableViewCell: VibrantTableViewCell {
@IBOutlet weak var icon: UIImageView!
@IBOutlet weak var label: UILabel!
override func updateVibrancy(animated: Bool) {
super.updateVibrancy(animated: animated)
let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label
UIView.animate(withDuration: duration(animated: animated)) {
self.icon.tintColor = iconTintColor
}
updateLabelVibrancy(label, color: labelColor, animated: animated)
}
}

View File

@ -0,0 +1,44 @@
//
// SelectURLBuilderTableViewController.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 4/23/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class SelectURLBuilderTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "URLBuilderCell", for: indexPath) as! SelectComboTableViewCell
cell.icon?.image = AppAssets.extensionPointTwitter
cell.label?.text = NSLocalizedString("Twitter", comment: "Twitter")
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
dismiss(animated: true)
}
// MARK: Actions
@IBAction func cancel(_ sender: Any) {
dismiss(animated: true)
}
}