Class
TransactionsViewController
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)
Relationships
Conforms To
UITableViewDelegate
UIViewController
Initializers
init(tink:query:)
public convenience init(tink: Tink = .shared, query: TransactionsQuery = TransactionsQuery())
Initializes a new view controller.
Parameters
Name | Type | Description |
---|---|---|
tink | Tink |
A configured |
query | TransactionsQuery |
Set a |
Properties
delegate
var delegate: TransactionsViewControllerDelegate?
An object that conforms to the TransactionsViewControllerDelegate
protocol.
Methods
viewDidLoad()
override public func viewDidLoad()
viewDidLayoutSubviews()
override public func viewDidLayoutSubviews()
viewWillAppear(_:)
override public func viewWillAppear(_ animated: Bool)
viewDidAppear(_:)
override public func viewDidAppear(_ animated: Bool)
clearSelection(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
Name | Type | Description |
---|---|---|
animated | Bool |
|
tableView(_:viewForHeaderInSection:)
public func tableView(_ tableView: UITableView, viewForHeaderInSection sectionIndex: Int) -> UIView?
tableView(_:didSelectRowAt:)
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)