From f47adc12b30384a21f197239581c2401e19ba747 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Wed, 2 Sep 2015 13:44:37 +0900 Subject: [PATCH] fix typealias name clash when observing both ListMonitor and ObjectMonitor --- CoreStore/Observing/ListMonitor.swift | 8 +++--- CoreStore/Observing/ListObserver.swift | 34 ++++++++++++------------ CoreStore/Observing/ObjectMonitor.swift | 4 +-- CoreStore/Observing/ObjectObserver.swift | 14 +++++----- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CoreStore/Observing/ListMonitor.swift b/CoreStore/Observing/ListMonitor.swift index 8ab0a0b..b291126 100644 --- a/CoreStore/Observing/ListMonitor.swift +++ b/CoreStore/Observing/ListMonitor.swift @@ -319,7 +319,7 @@ public final class ListMonitor { - parameter observer: a `ListObserver` to send change notifications to */ - public func addObserver(observer: U) { + public func addObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), @@ -367,7 +367,7 @@ public final class ListMonitor { - parameter observer: a `ListObjectObserver` to send change notifications to */ - public func addObserver(observer: U) { + public func addObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), @@ -485,7 +485,7 @@ public final class ListMonitor { - parameter observer: a `ListSectionObserver` to send change notifications to */ - public func addObserver(observer: U) { + public func addObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), @@ -634,7 +634,7 @@ public final class ListMonitor { - parameter observer: a `ListObserver` to unregister notifications to */ - public func removeObserver(observer: U) { + public func removeObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), diff --git a/CoreStore/Observing/ListObserver.swift b/CoreStore/Observing/ListObserver.swift index ccb18a7..dc97556 100644 --- a/CoreStore/Observing/ListObserver.swift +++ b/CoreStore/Observing/ListObserver.swift @@ -43,21 +43,21 @@ public protocol ListObserver: class { /** The `NSManagedObject` type for the observed list */ - typealias EntityType: NSManagedObject + typealias ListEntityType: NSManagedObject /** Handles processing just before a change to the observed list occurs - parameter monitor: the `ListMonitor` monitoring the list being observed */ - func listMonitorWillChange(monitor: ListMonitor) + func listMonitorWillChange(monitor: ListMonitor) /** Handles processing right after a change to the observed list occurs - parameter monitor: the `ListMonitor` monitoring the object being observed */ - func listMonitorDidChange(monitor: ListMonitor) + func listMonitorDidChange(monitor: ListMonitor) } public extension ListObserver { @@ -65,12 +65,12 @@ public extension ListObserver { /** The default implementation does nothing. */ - func listMonitorWillChange(monitor: ListMonitor) { } + func listMonitorWillChange(monitor: ListMonitor) { } /** The default implementation does nothing. */ - func listMonitorDidChange(monitor: ListMonitor) { } + func listMonitorDidChange(monitor: ListMonitor) { } } @@ -94,7 +94,7 @@ public protocol ListObjectObserver: ListObserver { - parameter object: the entity type for the inserted object - parameter indexPath: the new `NSIndexPath` for the inserted object */ - func listMonitor(monitor: ListMonitor, didInsertObject object: EntityType, toIndexPath indexPath: NSIndexPath) + func listMonitor(monitor: ListMonitor, didInsertObject object: ListEntityType, toIndexPath indexPath: NSIndexPath) /** Notifies that an object was deleted from the specified `NSIndexPath` in the list @@ -103,7 +103,7 @@ public protocol ListObjectObserver: ListObserver { - parameter object: the entity type for the deleted object - parameter indexPath: the `NSIndexPath` for the deleted object */ - func listMonitor(monitor: ListMonitor, didDeleteObject object: EntityType, fromIndexPath indexPath: NSIndexPath) + func listMonitor(monitor: ListMonitor, didDeleteObject object: ListEntityType, fromIndexPath indexPath: NSIndexPath) /** Notifies that an object at the specified `NSIndexPath` was updated @@ -112,7 +112,7 @@ public protocol ListObjectObserver: ListObserver { - parameter object: the entity type for the updated object - parameter indexPath: the `NSIndexPath` for the updated object */ - func listMonitor(monitor: ListMonitor, didUpdateObject object: EntityType, atIndexPath indexPath: NSIndexPath) + func listMonitor(monitor: ListMonitor, didUpdateObject object: ListEntityType, atIndexPath indexPath: NSIndexPath) /** Notifies that an object's index changed @@ -122,7 +122,7 @@ public protocol ListObjectObserver: ListObserver { - parameter fromIndexPath: the previous `NSIndexPath` for the moved object - parameter toIndexPath: the new `NSIndexPath` for the moved object */ - func listMonitor(monitor: ListMonitor, didMoveObject object: EntityType, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) + func listMonitor(monitor: ListMonitor, didMoveObject object: ListEntityType, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) } public extension ListObjectObserver { @@ -130,22 +130,22 @@ public extension ListObjectObserver { /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didInsertObject object: EntityType, toIndexPath indexPath: NSIndexPath) { } + func listMonitor(monitor: ListMonitor, didInsertObject object: ListEntityType, toIndexPath indexPath: NSIndexPath) { } /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didDeleteObject object: EntityType, fromIndexPath indexPath: NSIndexPath) { } + func listMonitor(monitor: ListMonitor, didDeleteObject object: ListEntityType, fromIndexPath indexPath: NSIndexPath) { } /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didUpdateObject object: EntityType, atIndexPath indexPath: NSIndexPath) { } + func listMonitor(monitor: ListMonitor, didUpdateObject object: ListEntityType, atIndexPath indexPath: NSIndexPath) { } /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didMoveObject object: EntityType, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { } + func listMonitor(monitor: ListMonitor, didMoveObject object: ListEntityType, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { } } @@ -170,7 +170,7 @@ public protocol ListSectionObserver: ListObjectObserver { - parameter sectionInfo: the `NSFetchedResultsSectionInfo` for the inserted section - parameter sectionIndex: the new section index for the new section */ - func listMonitor(monitor: ListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) + func listMonitor(monitor: ListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) /** Notifies that a section was inserted at the specified index @@ -179,7 +179,7 @@ public protocol ListSectionObserver: ListObjectObserver { - parameter sectionInfo: the `NSFetchedResultsSectionInfo` for the deleted section - parameter sectionIndex: the previous section index for the deleted section */ - func listMonitor(monitor: ListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int) + func listMonitor(monitor: ListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int) } public extension ListSectionObserver { @@ -187,10 +187,10 @@ public extension ListSectionObserver { /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) { } + func listMonitor(monitor: ListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) { } /** The default implementation does nothing. */ - func listMonitor(monitor: ListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int) { } + func listMonitor(monitor: ListMonitor, didDeleteSection sectionInfo: NSFetchedResultsSectionInfo, fromSectionIndex sectionIndex: Int) { } } diff --git a/CoreStore/Observing/ObjectMonitor.swift b/CoreStore/Observing/ObjectMonitor.swift index 26322b5..49376db 100644 --- a/CoreStore/Observing/ObjectMonitor.swift +++ b/CoreStore/Observing/ObjectMonitor.swift @@ -71,7 +71,7 @@ public final class ObjectMonitor { - parameter observer: an `ObjectObserver` to send change notifications to */ - public func addObserver(observer: U) { + public func addObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), @@ -146,7 +146,7 @@ public final class ObjectMonitor { - parameter observer: an `ObjectObserver` to unregister notifications to */ - public func removeObserver(observer: U) { + public func removeObserver(observer: U) { CoreStore.assert( NSThread.isMainThread(), diff --git a/CoreStore/Observing/ObjectObserver.swift b/CoreStore/Observing/ObjectObserver.swift index 65118ff..1eebc09 100644 --- a/CoreStore/Observing/ObjectObserver.swift +++ b/CoreStore/Observing/ObjectObserver.swift @@ -40,7 +40,7 @@ public protocol ObjectObserver: class { /** The `NSManagedObject` type for the observed object */ - typealias EntityType: NSManagedObject + typealias ObjectEntityType: NSManagedObject /** Handles processing just before a change to the observed `object` occurs @@ -48,7 +48,7 @@ public protocol ObjectObserver: class { - parameter monitor: the `ObjectMonitor` monitoring the object being observed - parameter object: the `NSManagedObject` instance being observed */ - func objectMonitor(monitor: ObjectMonitor, willUpdateObject object: EntityType) + func objectMonitor(monitor: ObjectMonitor, willUpdateObject object: ObjectEntityType) /** Handles processing right after a change to the observed `object` occurs @@ -57,7 +57,7 @@ public protocol ObjectObserver: class { - parameter object: the `NSManagedObject` instance being observed - parameter changedPersistentKeys: a `Set` of key paths for the attributes that were changed. Note that `changedPersistentKeys` only contains keys for attributes/relationships present in the persistent store, thus transient properties will not be reported. */ - func objectMonitor(monitor: ObjectMonitor, didUpdateObject object: EntityType, changedPersistentKeys: Set) + func objectMonitor(monitor: ObjectMonitor, didUpdateObject object: ObjectEntityType, changedPersistentKeys: Set) /** Handles processing right after `object` is deleted @@ -65,7 +65,7 @@ public protocol ObjectObserver: class { - parameter monitor: the `ObjectMonitor` monitoring the object being observed - parameter object: the `NSManagedObject` instance being observed */ - func objectMonitor(monitor: ObjectMonitor, didDeleteObject object: EntityType) + func objectMonitor(monitor: ObjectMonitor, didDeleteObject object: ObjectEntityType) } @@ -74,15 +74,15 @@ public extension ObjectObserver { /** The default implementation does nothing. */ - func objectMonitor(monitor: ObjectMonitor, willUpdateObject object: EntityType) { } + func objectMonitor(monitor: ObjectMonitor, willUpdateObject object: ObjectEntityType) { } /** The default implementation does nothing. */ - func objectMonitor(monitor: ObjectMonitor, didUpdateObject object: EntityType, changedPersistentKeys: Set) { } + func objectMonitor(monitor: ObjectMonitor, didUpdateObject object: ObjectEntityType, changedPersistentKeys: Set) { } /** The default implementation does nothing. */ - func objectMonitor(monitor: ObjectMonitor, didDeleteObject object: EntityType) { } + func objectMonitor(monitor: ObjectMonitor, didDeleteObject object: ObjectEntityType) { } }