mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Change Add Web Feed folder selection to be a separate controlling instead of the picker wheel. Issue #1270
This commit is contained in:
@@ -7,26 +7,25 @@
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Add Feed-->
|
||||
<!--Add Web Feed-->
|
||||
<scene sceneID="2Tc-JN-edX">
|
||||
<objects>
|
||||
<tableViewController storyboardIdentifier="AddWebFeedViewController" id="7aE-6a-iP7" customClass="AddWebFeedViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="grouped" separatorStyle="default" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="1" sectionFooterHeight="5" id="D0S-TM-mtm">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="D0S-TM-mtm">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<sections>
|
||||
<tableViewSection id="3tl-Mb-Eno">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="44" id="lyJ-rf-8GA">
|
||||
<rect key="frame" x="0.0" y="1" width="375" height="44"/>
|
||||
<rect key="frame" x="16" y="18" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="lyJ-rf-8GA" id="eNS-Rp-w0A">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="44"/>
|
||||
<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="335" height="36"/>
|
||||
<rect key="frame" x="20" y="4" width="303" height="36"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="URL"/>
|
||||
</textField>
|
||||
@@ -40,14 +39,14 @@
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="44" id="Pxz-fv-QhQ">
|
||||
<rect key="frame" x="0.0" y="45" width="375" height="44"/>
|
||||
<rect key="frame" x="16" y="62" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Pxz-fv-QhQ" id="8aP-2A-8jc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Title (Optional)" textAlignment="natural" adjustsFontForContentSizeCategory="YES" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="u7n-VL-Ho9">
|
||||
<rect key="frame" x="20" y="4" width="335" height="36"/>
|
||||
<rect key="frame" x="20" y="4" width="303" height="36"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
@@ -60,56 +59,32 @@
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</cells>
|
||||
</tableViewSection>
|
||||
<tableViewSection id="qn9-7O-LoA">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="44" id="MGg-y2-M2D">
|
||||
<rect key="frame" x="0.0" y="95" width="375" height="44"/>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" rowHeight="44" id="rlc-34-flT" customClass="AddWebFeedTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="16" y="106" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="MGg-y2-M2D" id="sZh-wI-IW4">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="rlc-34-flT" id="ZbC-Z6-dtq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="317" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<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="grZ-g6-qfm">
|
||||
<rect key="frame" x="19.999999999999996" y="4" width="48.666666666666657" height="36"/>
|
||||
<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="RtT-rR-5LA">
|
||||
<rect key="frame" x="18.999999999999996" y="11.666666666666664" width="48.666666666666657" height="21"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vaV-kY-CaE">
|
||||
<rect key="frame" x="313" y="12" width="42" height="20"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="htg-Nn-3xi">
|
||||
<rect key="frame" x="267" y="11.666666666666664" width="42" height="21"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="vaV-kY-CaE" firstAttribute="centerY" secondItem="grZ-g6-qfm" secondAttribute="centerY" id="4I1-oT-KFl"/>
|
||||
<constraint firstItem="grZ-g6-qfm" firstAttribute="leading" secondItem="sZh-wI-IW4" secondAttribute="leading" constant="20" symbolic="YES" id="5tF-au-Zv8"/>
|
||||
<constraint firstAttribute="trailing" secondItem="vaV-kY-CaE" secondAttribute="trailing" constant="20" symbolic="YES" id="96f-HQ-Y0z"/>
|
||||
<constraint firstItem="vaV-kY-CaE" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="grZ-g6-qfm" secondAttribute="trailing" constant="8" id="Hzx-N0-6NB"/>
|
||||
<constraint firstItem="grZ-g6-qfm" firstAttribute="top" secondItem="sZh-wI-IW4" secondAttribute="top" constant="4" id="PSY-sG-VGF"/>
|
||||
<constraint firstAttribute="bottom" secondItem="grZ-g6-qfm" secondAttribute="bottom" constant="4" id="SwU-Ai-DiZ"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="140" id="PiN-2i-6Dj">
|
||||
<rect key="frame" x="0.0" y="139" width="375" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="PiN-2i-6Dj" id="sZ4-hj-gua">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v2n-nX-8jq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="140"/>
|
||||
</pickerView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="v2n-nX-8jq" secondAttribute="trailing" id="IBi-SI-10J"/>
|
||||
<constraint firstItem="v2n-nX-8jq" firstAttribute="top" secondItem="sZ4-hj-gua" secondAttribute="top" id="kmm-i3-6DB"/>
|
||||
<constraint firstItem="v2n-nX-8jq" firstAttribute="leading" secondItem="sZ4-hj-gua" secondAttribute="leading" id="ksr-vY-KdS"/>
|
||||
<constraint firstAttribute="bottom" secondItem="v2n-nX-8jq" secondAttribute="bottom" id="wf0-0Y-GNZ"/>
|
||||
<constraint firstItem="htg-Nn-3xi" firstAttribute="centerY" secondItem="ZbC-Z6-dtq" secondAttribute="centerY" id="Z4n-Wi-s5H"/>
|
||||
<constraint firstItem="htg-Nn-3xi" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="RtT-rR-5LA" secondAttribute="trailing" constant="8" id="grG-sv-OgE"/>
|
||||
<constraint firstItem="htg-Nn-3xi" firstAttribute="trailing" secondItem="ZbC-Z6-dtq" secondAttribute="trailingMargin" id="izx-09-DWe"/>
|
||||
<constraint firstItem="RtT-rR-5LA" firstAttribute="leading" secondItem="ZbC-Z6-dtq" secondAttribute="leadingMargin" constant="4" id="q2d-LR-YGh"/>
|
||||
<constraint firstItem="RtT-rR-5LA" firstAttribute="centerY" secondItem="ZbC-Z6-dtq" secondAttribute="centerY" id="wHc-B0-lLE"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
@@ -121,7 +96,7 @@
|
||||
<outlet property="delegate" destination="7aE-6a-iP7" id="zYS-q2-iEf"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Add Feed" id="i1W-2z-PAk">
|
||||
<navigationItem key="navigationItem" title="Add Web Feed" id="i1W-2z-PAk">
|
||||
<barButtonItem key="rightBarButtonItem" id="r7V-oB-aHz">
|
||||
<view key="customView" contentMode="scaleToFill" id="4in-Eb-Rxp">
|
||||
<rect key="frame" x="339" y="12" width="20" height="20"/>
|
||||
@@ -130,9 +105,9 @@
|
||||
</view>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<connections>
|
||||
<outlet property="folderLabel" destination="vaV-kY-CaE" id="xeO-Ks-LIy"/>
|
||||
<outlet property="folderPickerView" destination="v2n-nX-8jq" id="qwz-Gg-GdQ"/>
|
||||
<outlet property="folderLabel" destination="htg-Nn-3xi" id="IUG-O4-uw9"/>
|
||||
<outlet property="nameTextField" destination="u7n-VL-Ho9" id="YQV-Xq-f9q"/>
|
||||
<outlet property="urlTextField" destination="eRp-AP-WFq" id="FG3-pH-2Fh"/>
|
||||
</connections>
|
||||
@@ -141,6 +116,94 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1711.2" y="89.408866995073893"/>
|
||||
</scene>
|
||||
<!--Web Feed Folder-->
|
||||
<scene sceneID="wnD-aY-W32">
|
||||
<objects>
|
||||
<tableViewController storyboardIdentifier="AddWebFeedFolderViewController" title="Web Feed Folder" id="acA-n7-ohN" customClass="AddWebFeedFolderViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="new-nW-ba2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<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="AddWebFeedFolderTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="28" width="375" height="43.666667938232422"/>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="NwD-N9-OGB"/>
|
||||
<constraint firstAttribute="height" constant="22" id="wE0-VQ-qk9"/>
|
||||
</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"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ZQp-94-vJz" firstAttribute="centerY" secondItem="9HE-eR-YIp" secondAttribute="centerY" id="1Qs-JW-lzY"/>
|
||||
<constraint firstItem="CIM-Ah-2kX" firstAttribute="leading" secondItem="9HE-eR-YIp" secondAttribute="leading" constant="20" symbolic="YES" id="5tt-v2-b7C"/>
|
||||
<constraint firstItem="CIM-Ah-2kX" firstAttribute="centerY" secondItem="9HE-eR-YIp" secondAttribute="centerY" id="PYb-j8-jvd"/>
|
||||
<constraint firstItem="ZQp-94-vJz" firstAttribute="leading" secondItem="CIM-Ah-2kX" secondAttribute="trailing" constant="8" id="vUA-hy-nM5"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<inset key="separatorInset" minX="45" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<connections>
|
||||
<outlet property="icon" destination="CIM-Ah-2kX" id="th3-LO-z9R"/>
|
||||
<outlet property="label" destination="ZQp-94-vJz" id="Jm5-oU-BZR"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="FolderCell" id="S24-c1-0Ir" customClass="AddWebFeedFolderTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="71.666667938232422" width="375" height="43.666667938232422"/>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="1B1-qh-G3r"/>
|
||||
<constraint firstAttribute="width" constant="22" id="1nz-Dw-URx"/>
|
||||
</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"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="3Tp-A7-7rS" firstAttribute="leading" secondItem="yKC-at-6Jx" secondAttribute="trailing" constant="8" id="If3-mO-byK"/>
|
||||
<constraint firstItem="yKC-at-6Jx" firstAttribute="centerY" secondItem="bA3-AB-H1n" secondAttribute="centerY" id="W9P-Mv-kKk"/>
|
||||
<constraint firstItem="3Tp-A7-7rS" firstAttribute="centerY" secondItem="bA3-AB-H1n" secondAttribute="centerY" id="YVe-hB-Whm"/>
|
||||
<constraint firstItem="yKC-at-6Jx" firstAttribute="leading" secondItem="bA3-AB-H1n" secondAttribute="leading" constant="50" id="vGI-al-tZg"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<inset key="separatorInset" minX="80" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<connections>
|
||||
<outlet property="icon" destination="yKC-at-6Jx" id="xOi-y6-6BX"/>
|
||||
<outlet property="label" destination="3Tp-A7-7rS" id="zjf-mw-Tch"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="acA-n7-ohN" id="fTR-qI-ea7"/>
|
||||
<outlet property="delegate" destination="acA-n7-ohN" id="x4s-jR-1Aw"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="gE2-fq-mL5" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1058.4000000000001" y="88.669950738916256"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="9m0-Wv-Ipq">
|
||||
<objects>
|
||||
@@ -165,31 +228,43 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="1Ce-E7-rG2">
|
||||
<rect key="frame" x="97.666666666666686" y="108" width="180" height="32"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uZB-hh-ssC">
|
||||
<rect key="frame" x="16" y="108" width="343" height="44"/>
|
||||
<subviews>
|
||||
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="1Ce-E7-rG2">
|
||||
<rect key="frame" x="81.666666666666686" y="6.6666666666666714" width="180" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="180" id="IEO-pf-4PB"/>
|
||||
</constraints>
|
||||
<segments>
|
||||
<segment title="Web Feed"/>
|
||||
<segment title="Folder"/>
|
||||
</segments>
|
||||
<connections>
|
||||
<action selector="typeSelectorChanged:" destination="G8j-dh-7Ji" eventType="valueChanged" id="evz-dY-V8G"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="180" id="IEO-pf-4PB"/>
|
||||
<constraint firstAttribute="height" constant="44" id="GUX-dy-aVL"/>
|
||||
<constraint firstItem="1Ce-E7-rG2" firstAttribute="centerY" secondItem="uZB-hh-ssC" secondAttribute="centerY" id="Tb3-6c-IQ1"/>
|
||||
<constraint firstItem="1Ce-E7-rG2" firstAttribute="centerX" secondItem="uZB-hh-ssC" secondAttribute="centerX" id="rOR-X2-CpH"/>
|
||||
</constraints>
|
||||
<segments>
|
||||
<segment title="Web Feed"/>
|
||||
<segment title="Folder"/>
|
||||
</segments>
|
||||
<connections>
|
||||
<action selector="typeSelectorChanged:" destination="G8j-dh-7Ji" eventType="valueChanged" id="evz-dY-V8G"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
</view>
|
||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TUN-mZ-uLE">
|
||||
<rect key="frame" x="0.0" y="159" width="375" height="653"/>
|
||||
<rect key="frame" x="0.0" y="172" width="375" height="640"/>
|
||||
</containerView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<color key="backgroundColor" systemColor="systemGroupedBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="uZB-hh-ssC" firstAttribute="top" secondItem="pP4-52-FAl" secondAttribute="top" constant="20" id="9dr-mx-TgM"/>
|
||||
<constraint firstItem="uZB-hh-ssC" firstAttribute="leading" secondItem="pP4-52-FAl" secondAttribute="leading" constant="16" id="Gnt-hX-ubZ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="TUN-mZ-uLE" secondAttribute="bottom" id="GrY-qn-cjm"/>
|
||||
<constraint firstItem="TUN-mZ-uLE" firstAttribute="top" secondItem="uZB-hh-ssC" secondAttribute="bottom" constant="20" id="JMI-ia-iIJ"/>
|
||||
<constraint firstItem="TUN-mZ-uLE" firstAttribute="trailing" secondItem="pP4-52-FAl" secondAttribute="trailing" id="SJI-cb-6hr"/>
|
||||
<constraint firstItem="1Ce-E7-rG2" firstAttribute="top" secondItem="pP4-52-FAl" secondAttribute="top" constant="20" id="UfR-Fy-drx"/>
|
||||
<constraint firstItem="TUN-mZ-uLE" firstAttribute="top" secondItem="1Ce-E7-rG2" secondAttribute="bottom" constant="20" id="a7e-Vk-UVo"/>
|
||||
<constraint firstItem="TUN-mZ-uLE" firstAttribute="leading" secondItem="pP4-52-FAl" secondAttribute="leading" id="ab5-qk-Xmn"/>
|
||||
<constraint firstItem="1Ce-E7-rG2" firstAttribute="centerX" secondItem="cJo-ve-mLk" secondAttribute="centerX" id="uAg-Xx-OkN"/>
|
||||
<constraint firstItem="pP4-52-FAl" firstAttribute="trailing" secondItem="uZB-hh-ssC" secondAttribute="trailing" constant="16" id="t9m-rQ-Ijv"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="pP4-52-FAl"/>
|
||||
</view>
|
||||
@@ -225,6 +300,7 @@
|
||||
<outlet property="addButton" destination="tVq-rz-5pe" id="kNP-KC-naP"/>
|
||||
<outlet property="cancelButton" destination="Uz9-n0-t2M" id="dZu-nz-p4J"/>
|
||||
<outlet property="containerView" destination="TUN-mZ-uLE" id="8p5-N0-LRa"/>
|
||||
<outlet property="typeSelectorContainer" destination="uZB-hh-ssC" id="gg2-Za-eTy"/>
|
||||
<outlet property="typeSelectorSegmentedControl" destination="1Ce-E7-rG2" id="3JA-Su-PFn"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
@@ -236,22 +312,21 @@
|
||||
<scene sceneID="m7L-uI-ghq">
|
||||
<objects>
|
||||
<tableViewController storyboardIdentifier="AddFolderViewController" id="3dI-34-ljo" customClass="AddFolderViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="grouped" separatorStyle="default" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="1" sectionFooterHeight="5" id="7xa-gZ-zHA">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="insetGrouped" separatorStyle="default" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="7xa-gZ-zHA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<sections>
|
||||
<tableViewSection id="12M-tp-EeV">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="44" id="XJI-0M-cAh">
|
||||
<rect key="frame" x="0.0" y="1" width="375" height="44"/>
|
||||
<rect key="frame" x="16" y="18" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XJI-0M-cAh" id="tIS-Tx-i17">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Name" textAlignment="natural" adjustsFontForContentSizeCategory="YES" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="lZK-wx-jbo">
|
||||
<rect key="frame" x="20" y="4" width="335" height="36"/>
|
||||
<rect key="frame" x="20" y="4" width="303" height="36"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
@@ -269,10 +344,10 @@
|
||||
<tableViewSection id="bX9-Y2-S2D">
|
||||
<cells>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="44" id="uU0-Jh-goT">
|
||||
<rect key="frame" x="0.0" y="51" width="375" height="44"/>
|
||||
<rect key="frame" x="16" y="98" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="uU0-Jh-goT" id="y2g-dW-fPZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<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="YRf-I7-nkL">
|
||||
@@ -282,7 +357,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mxj-Bw-Jfx">
|
||||
<rect key="frame" x="313" y="12" width="42" height="20"/>
|
||||
<rect key="frame" x="289" y="12" width="42" height="20"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -291,7 +366,7 @@
|
||||
<constraints>
|
||||
<constraint firstItem="YRf-I7-nkL" firstAttribute="top" secondItem="y2g-dW-fPZ" secondAttribute="top" constant="4" id="7ey-y0-Aef"/>
|
||||
<constraint firstItem="mxj-Bw-Jfx" firstAttribute="centerY" secondItem="YRf-I7-nkL" secondAttribute="centerY" id="FDk-71-7yD"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mxj-Bw-Jfx" secondAttribute="trailing" constant="20" symbolic="YES" id="fIA-Rb-SEi"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mxj-Bw-Jfx" secondAttribute="trailing" constant="12" id="fIA-Rb-SEi"/>
|
||||
<constraint firstAttribute="bottom" secondItem="YRf-I7-nkL" secondAttribute="bottom" constant="4" id="fcs-rL-KrO"/>
|
||||
<constraint firstItem="mxj-Bw-Jfx" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="YRf-I7-nkL" secondAttribute="trailing" constant="8" id="rQ8-3l-2gz"/>
|
||||
<constraint firstItem="YRf-I7-nkL" firstAttribute="leading" secondItem="y2g-dW-fPZ" secondAttribute="leading" constant="20" symbolic="YES" id="xBK-tz-P2j"/>
|
||||
@@ -299,14 +374,14 @@
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="140" id="zRi-p6-4KU">
|
||||
<rect key="frame" x="0.0" y="95" width="375" height="140"/>
|
||||
<rect key="frame" x="16" y="142" width="343" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="zRi-p6-4KU" id="wek-Qh-OXr">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="140"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eGY-V8-gzJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="140"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="343" height="140"/>
|
||||
</pickerView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
@@ -326,6 +401,7 @@
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" title="Add Folder" id="LuA-AC-n99"/>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<connections>
|
||||
<outlet property="accountLabel" destination="mxj-Bw-Jfx" id="l4A-ta-dUi"/>
|
||||
<outlet property="accountPickerView" destination="eGY-V8-gzJ" id="zGk-k4-Jnd"/>
|
||||
@@ -334,7 +410,7 @@
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="yp4-mF-DZV" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-954.39999999999998" y="89.408866995073893"/>
|
||||
<point key="canvasLocation" x="-399" y="89"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
||||
@@ -28,6 +28,7 @@ class AddContainerViewController: UIViewController {
|
||||
@IBOutlet weak var cancelButton: UIBarButtonItem!
|
||||
@IBOutlet weak var activityIndicatorView: UIActivityIndicatorView!
|
||||
@IBOutlet weak var addButton: UIBarButtonItem!
|
||||
@IBOutlet weak var typeSelectorContainer: UIView!
|
||||
@IBOutlet weak var typeSelectorSegmentedControl: UISegmentedControl!
|
||||
@IBOutlet weak var containerView: UIView!
|
||||
|
||||
@@ -43,6 +44,7 @@ class AddContainerViewController: UIViewController {
|
||||
activityIndicatorView.color = UIColor.label
|
||||
activityIndicatorView.isHidden = true
|
||||
|
||||
typeSelectorContainer.layer.cornerRadius = 10
|
||||
typeSelectorSegmentedControl.selectedSegmentIndex = initialControllerType?.rawValue ?? 0
|
||||
switch initialControllerType {
|
||||
case .feed:
|
||||
|
||||
16
iOS/Add/AddWebFeedFolderTableViewCell.swift
Normal file
16
iOS/Add/AddWebFeedFolderTableViewCell.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// AddWebFeedFolderTableViewCell.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 11/16/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AddWebFeedFolderTableViewCell: UITableViewCell {
|
||||
|
||||
@IBOutlet weak var icon: UIImageView!
|
||||
@IBOutlet weak var label: UILabel!
|
||||
|
||||
}
|
||||
78
iOS/Add/AddWebFeedFolderViewController.swift
Normal file
78
iOS/Add/AddWebFeedFolderViewController.swift
Normal file
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// AddWebFeedLocationViewController.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/16/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import RSCore
|
||||
import Account
|
||||
|
||||
protocol AddWebFeedFolderViewControllerDelegate {
|
||||
func didSelect(container: Container)
|
||||
}
|
||||
|
||||
class AddWebFeedFolderViewController: UITableViewController {
|
||||
|
||||
var delegate: AddWebFeedFolderViewControllerDelegate?
|
||||
var initialContainer: Container?
|
||||
|
||||
var containers = [Container]()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
for account in AccountManager.shared.sortedActiveAccounts {
|
||||
containers.append(account)
|
||||
if let sortedFolders = account.sortedFolders {
|
||||
containers.append(contentsOf: sortedFolders)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Table view data source
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return containers.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let container = containers[indexPath.row]
|
||||
let cell: AddWebFeedFolderTableViewCell = {
|
||||
if container is Account {
|
||||
return tableView.dequeueReusableCell(withIdentifier: "AccountCell", for: indexPath) as! AddWebFeedFolderTableViewCell
|
||||
} else {
|
||||
return tableView.dequeueReusableCell(withIdentifier: "FolderCell", for: indexPath) as! AddWebFeedFolderTableViewCell
|
||||
}
|
||||
}()
|
||||
|
||||
if let smallIconProvider = container as? SmallIconProvider {
|
||||
cell.icon?.image = smallIconProvider.smallIcon?.image
|
||||
}
|
||||
|
||||
if let displayNameProvider = container as? DisplayNameProvider {
|
||||
cell.label?.text = displayNameProvider.nameForDisplay
|
||||
}
|
||||
|
||||
if let compContainer = initialContainer, container === compContainer {
|
||||
cell.accessoryType = .checkmark
|
||||
}
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
let cell = tableView.cellForRow(at: indexPath)
|
||||
cell?.accessoryType = .checkmark
|
||||
|
||||
delegate?.didSelect(container: containers[indexPath.row])
|
||||
navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,20 +16,16 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
||||
|
||||
@IBOutlet private weak var urlTextField: UITextField!
|
||||
@IBOutlet private weak var nameTextField: UITextField!
|
||||
@IBOutlet private weak var folderPickerView: UIPickerView!
|
||||
@IBOutlet private weak var folderLabel: UILabel!
|
||||
|
||||
private lazy var pickerData: FlattenedAccountFolderPickerData = FlattenedAccountFolderPickerData()
|
||||
private var shouldDisplayPicker: Bool {
|
||||
return pickerData.containerNames.count > 1
|
||||
}
|
||||
|
||||
private var userCancelled = false
|
||||
|
||||
weak var delegate: AddContainerViewControllerChildDelegate?
|
||||
var initialFeed: String?
|
||||
var initialFeedName: String?
|
||||
|
||||
var container: Container?
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
super.viewDidLoad()
|
||||
@@ -51,15 +47,17 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
||||
|
||||
nameTextField.text = initialFeedName
|
||||
nameTextField.delegate = self
|
||||
folderLabel.text = pickerData.containerNames.first
|
||||
|
||||
if shouldDisplayPicker {
|
||||
folderPickerView.dataSource = self
|
||||
folderPickerView.delegate = self
|
||||
if let accountID = AppDefaults.addWebFeedAccountID, let account = AccountManager.shared.activeAccounts.first(where: { $0.accountID == accountID }) {
|
||||
container = account
|
||||
} else if let account = AccountManager.shared.sortedActiveAccounts.first {
|
||||
container = account
|
||||
} else {
|
||||
folderPickerView.isHidden = true
|
||||
delegate?.readyToAdd(state: false)
|
||||
}
|
||||
|
||||
updateFolderLabel()
|
||||
|
||||
// I couldn't figure out the gap at the top of the UITableView, so I took a hammer to it.
|
||||
tableView.contentInset = UIEdgeInsets(top: -28, left: 0, bottom: 0, right: 0)
|
||||
|
||||
@@ -82,7 +80,7 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
||||
return
|
||||
}
|
||||
|
||||
let container = pickerData.containers[folderPickerView.selectedRow(inComponent: 0)]
|
||||
guard let container = container else { return }
|
||||
|
||||
var account: Account?
|
||||
if let containerAccount = container as? Account {
|
||||
@@ -123,38 +121,29 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
||||
delegate?.readyToAdd(state: urlTextField.text?.rs_stringMayBeURL() ?? false)
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: section)
|
||||
if section == 1 && !shouldDisplayPicker {
|
||||
return defaultNumberOfRows - 1
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
if indexPath.row == 2 {
|
||||
let folderViewController = UIStoryboard.add.instantiateController(ofType: AddWebFeedFolderViewController.self)
|
||||
folderViewController.delegate = self
|
||||
folderViewController.initialContainer = container
|
||||
navigationController?.pushViewController(folderViewController, animated: true)
|
||||
}
|
||||
|
||||
return defaultNumberOfRows
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
extension AddWebFeedViewController: UIPickerViewDataSource, UIPickerViewDelegate {
|
||||
|
||||
func numberOfComponents(in pickerView: UIPickerView) ->Int {
|
||||
return 1
|
||||
// MARK: AddWebFeedFolderViewControllerDelegate
|
||||
|
||||
extension AddWebFeedViewController: AddWebFeedFolderViewControllerDelegate {
|
||||
func didSelect(container: Container) {
|
||||
self.container = container
|
||||
updateFolderLabel()
|
||||
AppDefaults.addWebFeedAccountID = container.account?.accountID
|
||||
}
|
||||
|
||||
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
|
||||
return pickerData.containerNames.count
|
||||
}
|
||||
|
||||
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
|
||||
return pickerData.containerNames[row]
|
||||
}
|
||||
|
||||
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
|
||||
folderLabel.text = pickerData.containerNames[row]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: UITextFieldDelegate
|
||||
|
||||
extension AddWebFeedViewController: UITextFieldDelegate {
|
||||
|
||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
@@ -163,3 +152,17 @@ extension AddWebFeedViewController: UITextFieldDelegate {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private extension AddWebFeedViewController {
|
||||
func updateFolderLabel() {
|
||||
if let containerName = (container as? DisplayNameProvider)?.nameForDisplay {
|
||||
if container is Folder {
|
||||
folderLabel.text = "\(container?.account?.nameForDisplay ?? "") / \(containerName)"
|
||||
} else {
|
||||
folderLabel.text = containerName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user