Enables the iOS app to add Feedly accounts.
This commit is contained in:
parent
a4bcbf5c36
commit
4976537a40
|
@ -38,6 +38,11 @@ class AddAccountViewController: UITableViewController, AddAccountDismissDelegate
|
||||||
let addViewController = navController.topViewController as! FeedbinAccountViewController
|
let addViewController = navController.topViewController as! FeedbinAccountViewController
|
||||||
addViewController.delegate = self
|
addViewController.delegate = self
|
||||||
present(navController, animated: true)
|
present(navController, animated: true)
|
||||||
|
case 2:
|
||||||
|
let addAccount = OAuthAccountAuthorizationOperation(accountType: .feedly)
|
||||||
|
addAccount.delegate = self
|
||||||
|
addAccount.presentationAnchor = self.view.window!
|
||||||
|
OperationQueue.main.addOperation(addAccount)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -48,3 +53,28 @@ class AddAccountViewController: UITableViewController, AddAccountDismissDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension AddAccountViewController: OAuthAccountAuthorizationOperationDelegate {
|
||||||
|
|
||||||
|
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didCreate account: Account) {
|
||||||
|
let rootViewController = view.window?.rootViewController
|
||||||
|
|
||||||
|
account.refreshAll { result in
|
||||||
|
switch result {
|
||||||
|
case .success:
|
||||||
|
break
|
||||||
|
case .failure(let error):
|
||||||
|
guard let viewController = rootViewController else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
viewController.presentError(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didFailWith error: Error) {
|
||||||
|
presentError(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -424,6 +424,39 @@
|
||||||
</constraints>
|
</constraints>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="56" id="zcM-qz-glk" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||||
|
<rect key="frame" x="20" y="129" width="374" height="56"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="zcM-qz-glk" id="3VG-Ax-7gi">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="374" height="56"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<subviews>
|
||||||
|
<stackView opaque="NO" contentMode="scaleToFill" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="cXZ-17-bhe">
|
||||||
|
<rect key="frame" x="20" y="12" width="128" height="32"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="accountFeedly" translatesAutoresizingMaskIntoConstraints="NO" id="fAO-P0-gtD">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
|
||||||
|
<color key="tintColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="width" constant="32" id="581-u2-SxX"/>
|
||||||
|
<constraint firstAttribute="height" constant="32" id="onv-oj-10a"/>
|
||||||
|
</constraints>
|
||||||
|
</imageView>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Feedly" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u2M-c5-ujy">
|
||||||
|
<rect key="frame" x="48" y="0.0" width="80" height="32"/>
|
||||||
|
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
</subviews>
|
||||||
|
</stackView>
|
||||||
|
</subviews>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="cXZ-17-bhe" firstAttribute="leading" secondItem="3VG-Ax-7gi" secondAttribute="leading" constant="20" symbolic="YES" id="BYO-oH-a6T"/>
|
||||||
|
<constraint firstItem="cXZ-17-bhe" firstAttribute="centerY" secondItem="3VG-Ax-7gi" secondAttribute="centerY" id="r36-pZ-Siw"/>
|
||||||
|
</constraints>
|
||||||
|
</tableViewCellContentView>
|
||||||
|
</tableViewCell>
|
||||||
</cells>
|
</cells>
|
||||||
</tableViewSection>
|
</tableViewSection>
|
||||||
</sections>
|
</sections>
|
||||||
|
@ -811,6 +844,7 @@
|
||||||
</scenes>
|
</scenes>
|
||||||
<resources>
|
<resources>
|
||||||
<image name="accountFeedbin" width="120" height="102"/>
|
<image name="accountFeedbin" width="120" height="102"/>
|
||||||
|
<image name="accountFeedly" width="138" height="123"/>
|
||||||
<image name="accountLocal" width="99" height="77"/>
|
<image name="accountLocal" width="99" height="77"/>
|
||||||
<namedColor name="primaryAccentColor">
|
<namedColor name="primaryAccentColor">
|
||||||
<color red="0.031372549019607843" green="0.41568627450980394" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color red="0.031372549019607843" green="0.41568627450980394" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
|
Loading…
Reference in New Issue