Swiftgram/Source/Base/ASEqualityHelpers.h
2017-02-26 18:14:13 -08:00

23 lines
883 B
Objective-C

//
// ASEqualityHelpers.h
// AsyncDisplayKit
//
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
#import <AsyncDisplayKit/ASBaseDefines.h>
/**
@abstract Correctly equates two objects, including cases where both objects are nil. The latter is a case where `isEqual:` fails.
@param obj The first object in the comparison. Can be nil.
@param otherObj The second object in the comparison. Can be nil.
@result YES if the objects are equal, including cases where both object are nil.
*/
ASDISPLAYNODE_INLINE BOOL ASObjectIsEqual(id<NSObject> obj, id<NSObject> otherObj)
{
return obj == otherObj || [obj isEqual:otherObj];
}