TinkMoneyManagerUI Documentation Beta

Class Transactions​View​Controller

public final class TransactionsViewController: UIViewController

A view controller that displays a list of transactions. Required scopes: transactions:write, transactions:read and categories:read.

Overview

Use the TransactionsViewController when you want to display a list of transactions and let the user select one of them.

let transactionsViewController = TransactionsViewController(tink: <#Tink#>)
show(transactionsViewController, sender: <#Any#>)

Responding to User Selection

To respond to the selection of a transaction you must provide a delegate that conforms to the TransactionsViewControllerDelegate.

extension <#Class#>: TransactionsViewControllerDelegate {
    func transactionsViewController(_ viewController: TransactionsViewController, didSelectTransaction transaction: Transaction) {
        <#code#>
    }
}

TransactionsViewController clears its selection every time the list is displayed, so if you pushed a detail view controller in response to a transaction being selected the transaction will be deselected when the user goes back to the transaction list.

If you present a modal in response to a transaction selection you might need to deselect the transaction when the modal is dismissed depending on the presentation style. To do that you can call the clearSelection(animated:) method.

transactionsViewController.clearSelection(animated: true)
TransactionsViewController TransactionsViewController UITableViewDelegate UITableViewDelegate TransactionsViewController->UITableViewDelegate UIViewController UIViewController TransactionsViewController->UIViewController

Conforms To

UITableViewDelegate
UIViewController

Initializers

init(tink:​query:​)

public convenience init(tink: Tink = .shared, query: TransactionsQuery = TransactionsQuery())

Initializes a new view controller.

Parameters

tink Tink

A configured Tink.

query Transactions​Query

Set a TransactionQuery to filter the transactions. Optional.

Properties

delegate

var delegate: TransactionsViewControllerDelegate?

An object that conforms to the TransactionsViewControllerDelegate protocol.

Methods

view​Did​Load()

override public func viewDidLoad()

view​Did​Layout​Subviews()

override public func viewDidLayoutSubviews()

view​Will​Appear(_:​)

override public func viewWillAppear(_ animated: Bool)

view​Did​Appear(_:​)

override public func viewDidAppear(_ animated: Bool)

clear​Selection(animated:​)

public func clearSelection(animated: Bool)

Deselects all selected rows, with an option to animated the deselection.

Use this method to deselect any selected transactions when dismissing any modal that has been presented by a transaction selection.

Parameters

animated Bool

true if you want to animate the deselection, and false if the change should be immediate.

table​View(_:​view​For​Header​InSection:​)

public func tableView(_ tableView: UITableView, viewForHeaderInSection sectionIndex: Int) -> UIView?

table​View(_:​did​Select​Row​At:​)

public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)