From 48b1b9b57c931234f80de5d06d338989503ee49d Mon Sep 17 00:00:00 2001 From: Brent Royal-Gordon Date: Mon, 1 Sep 2014 21:18:26 -0700 Subject: [PATCH] Add means to access mutable versions of relationships --- templates/machine.swift.motemplate | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/machine.swift.motemplate b/templates/machine.swift.motemplate index 47a0acf6..81a29679 100644 --- a/templates/machine.swift.motemplate +++ b/templates/machine.swift.motemplate @@ -81,6 +81,9 @@ class _<$managedObjectClassName$>: <$customSuperentity$> { @NSManaged var <$Relationship.name$>: <$Relationship.immutableCollectionClassName$> + var mutable<$Relationship.name.initialCapitalString$>: <$Relationship.mutableCollectionClassName$> { + return mutable<$if Relationship.jr_isOrdered$>Ordered<$endif$>SetValueForKey("<$Relationship.name$>") + } <$else$> @NSManaged var <$Relationship.name$>: <$Relationship.destinationEntity.managedObjectClassName$><$if Relationship.isOptional$>?<$endif$>