BDPDeepCopy

Objective-C

@protocol BDPDeepCopy <NSObject>

Swift

protocol BDPDeepCopy : NSObjectProtocol

An object which may be deep copied.

Whereas the NSCopying Protocol is typically used to define shallow copying; “BDPDeepCopy” specifies a copying method that must return a deep-copy. That is, an entirely new object graph which is identical to the receiver and its referenced objects.

There may be application specific exceptions to this definition, for example where those referenced objects are singletons.

See

http://en.wikipedia.org/wiki/Object_copy For a fuller explanation of deep vs. shallow copying
  • @returns a deep-copy of this object.

    Declaration

    Objective-C

    - (id)deepCopy;

    Swift

    func deepCopy() -> Any!