CKTransaction
class CKTransaction : NSManagedObject, Model
Transaction core data model.
Note
Type used to handle and store a transaction.-
Name of the transaction (merchant name).
Declaration
Swift
@NSManaged var name: String { get set }
-
Amount value.
Declaration
Swift
@NSManaged var amount: Double { get set }
-
Date that the transaction takes place.
Declaration
Swift
@NSManaged var date: Date { get set }
-
Free note related to the transaction.
Declaration
Swift
@NSManaged var note: String { get set }
-
Creation date.
Declaration
Swift
@NSManaged var createdAt: Date { get set }
-
Updated date.
Declaration
Swift
@NSManaged var updatedAt: Date { get set }
-
Associated category.
Declaration
Swift
@NSManaged var category: CKCategory { get set }
-
List of articles.
Declaration
Swift
@NSManaged var articles: Set<CKArticle> { get set }
-
List of associated tags.
Declaration
Swift
@NSManaged var tags: Set<CKTag> { get set }
-
Entity name is
Transaction
.Declaration
Swift
static var entityName: String
-
No pimary key, always creates a new entry.
Declaration
Swift
static var primaryKey: String?
-
Add an article to this transaction instance.
Declaration
Swift
func addToArticles(name: String, amount: Double, quantity: Double = 1.0)
Parameters
name
The name of the article.
amount
The amount of the article.
quantity
The quantity of the article.
-
Remove all articles of this transaction instance.
Declaration
Swift
func removeAllArticles()
-
Remove all tags of this transaction instance.
Declaration
Swift
func removeAllTags()