TinkMoneyManagerUI Documentation Beta

Class Actionable​Insights​View​Controller

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#>
    }
}
ActionableInsightsViewController ActionableInsightsViewController CategorizeTransactionViewControllerDelegate CategorizeTransactionViewControllerDelegate ActionableInsightsViewController->CategorizeTransactionViewControllerDelegate UICollectionViewDataSource UICollectionViewDataSource ActionableInsightsViewController->UICollectionViewDataSource UIViewController UIViewController ActionableInsightsViewController->UIViewController UIAdaptivePresentationControllerDelegate UIAdaptivePresentationControllerDelegate ActionableInsightsViewController->UIAdaptivePresentationControllerDelegate

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:​should​Show​Archive:​)

public convenience init(tink: Tink = .shared, delegate: ActionableInsightsViewControllerDelegate, shouldShowArchive: Bool = true)

Initializes a new view controller.

Parameters

tink Tink

A configured Tink object.

delegate Actionable​Insights​View​Controller​Delegate

An object that conforms to the ActionableInsightsViewControllerDelegate protocol.

should​Show​Archive Bool

Determines if a button to show archived insights should be displayed.

Properties

empty​State

var emptyState: EmptyState = .default

Methods

view​Did​Load()

override public func viewDidLoad()

view​Did​Appear(_:​)

override public func viewDidAppear(_ animated: Bool)

collection​View(_:​number​OfItems​InSection:​)

public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int

collection​View(_:​cell​For​Item​At:​)

public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell

categorize​Transaction​View​Controller(_:​will​Categorize​As:​)

public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, willCategorizeAs category: TinkCore.Category)

categorize​Transaction​View​Controller(_:​did​Categorize:​category:​)

public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, didCategorize transactions: [Transaction.ID], category: TinkCore.Category)

categorize​Transaction​View​Controller(_:​did​Fail​With​Error:​)

public func categorizeTransactionViewController(_ controller: CategorizeTransactionViewController, didFailWithError error: Error)

presentation​Controller​Will​Dismiss(_:​)

public func presentationControllerWillDismiss(_ presentationController: UIPresentationController)