Class
ActionableInsightsViewController
public final class ActionableInsightsViewController: UIViewController
A view controller that displays a list actionable insights.
Use the ActionableInsightListViewController
to display an interface with actionable insights.
This view controller is designed to be used in a UINavigationController
but can be used standalone also.
let actionableInsightsViewController = ActionableInsightListViewController(tink: <#Tink#>, delegate: <#delegateInstance#>)
show(actionableInsightsViewController, sender: <#Any#>)
Responding to User Actions
Implement the methods of the ActionableInsightsViewControllerDelegate
to respond to user actions related to insights.
For methods that has a completionHandler
parameter you have to call that handler when the task related to the requested action has completed or been cancelled.
If you don't call the handler the insight will remain in the list and not be archived.
extension <#Class#>: ActionableInsightsViewControllerDelegate {
func actionableInsightsViewController(_ viewController: ActionableInsightListViewController, showBudget id: Budget.ID, budgetPeriodStart: Date) {
<#code#>
}
func actionableInsightsViewController(_ viewController: ActionableInsightListViewController, initiateTransferFromAccount source: URL?, to destination: URL?, amount: Double?, currencyCode: String?, completionHandler: @escaping (Result<Void, Error>) -> Void) {
<#code#>
}
func actionableInsightsViewController(_ viewController: ActionableInsightListViewController, showTransactionWithID id: Transaction.ID) {
<#code#>
}
}
Relationships
Nested Types
ActionableInsightsViewController.EmptyState
Conforms To
CategorizeTransactionViewControllerDelegate
A set of methods that your delegate object can implement to track when the user picks a category and what transactions to categorize, or to track when the categorization fails.
UIAdaptivePresentationControllerDelegate
UICollectionViewDataSource
UIViewController
Initializers
init(tink:delegate:shouldShowArchive:)
public convenience init(tink: Tink = .shared, delegate: ActionableInsightsViewControllerDelegate, shouldShowArchive: Bool = true)
Initializes a new view controller.
Parameters
Name | Type | Description |
---|---|---|
tink | Tink |
A configured |
delegate | ActionableInsightsViewControllerDelegate |
An object that conforms to the |
shouldShowArchive | Bool |
Determines if a button to show archived insights should be displayed. |
Properties
emptyState
var emptyState: EmptyState = .default
Methods
viewDidLoad()
override public func viewDidLoad()
viewDidAppear(_:)
override public func viewDidAppear(_ animated: Bool)
collectionView(_:numberOfItemsInSection:)
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
collectionView(_:cellForItemAt:)
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
categorizeTransactionViewController(_:willCategorizeAs:)
public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, willCategorizeAs category: TinkCore.Category)
categorizeTransactionViewController(_:didCategorize:category:)
public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, didCategorize transactions: [Transaction.ID], category: TinkCore.Category)
categorizeTransactionViewController(_:didFailWithError:)
public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, didFailWithError error: Error)
presentationControllerWillDismiss(_:)
public func presentationControllerWillDismiss(_ presentationController: UIPresentationController)