Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NS_RETURNS_RETAINED macro to save time #843

Merged
merged 3 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
- Fix UIResponder handling with view backing ASDisplayNode. [Michael Schneider](https://github.com/maicki) [#789](https://github.com/TextureGroup/Texture/pull/789/)
- Optimized thread-local storage by replacing pthread_specific with C11 thread-local variables. [Adlai Holler](https://github.com/Adlai-Holler) [#811](https://github.com/TextureGroup/Texture/pull/811/)
- Fixed a thread-sanitizer warning in ASTextNode. [Adlai Holler](https://github.com/Adlai-Holler) [#830](https://github.com/TextureGroup/Texture/pull/830/)
- Fix ASTextNode2 handling background color incorrectly. [Adlai Holler](https://github.com/Adlai-Holler) [#831] (https://github.com/TextureGroup/Texture/pull/831/)
- Fix ASTextNode2 handling background color incorrectly. [Adlai Holler](https://github.com/Adlai-Holler) [#831](https://github.com/TextureGroup/Texture/pull/831/)
- [NoCopyRendering] Improved performance & fixed image memory not being tagged in Instruments. [Adlai Holler](https://github.com/Adlai-Holler) [#833](https://github.com/TextureGroup/Texture/pull/833/)
- Use `NS_RETURNS_RETAINED` macro to make our methods a tiny bit faster. [Adlai Holler](https://github.com/Adlai-Holler) [#843](https://github.com/TextureGroup/Texture/pull/843/)

## 2.6
- [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon)
Expand Down
2 changes: 1 addition & 1 deletion Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ - (void)_scheduleIvarsForMainDeallocation
*
* Result is of type NSValue<[Ivar]>
*/
+ (NSValue * _Nonnull)_ivarsThatMayNeedMainDeallocation
+ (NSValue * _Nonnull)_ivarsThatMayNeedMainDeallocation NS_RETURNS_RETAINED
{
static NSCache<Class, NSValue *> *ivarsCache;
static dispatch_once_t onceToken;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASMapNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ - (void)takeSnapshot
}];
}

+ (UIImage *)defaultPinImageWithCenterOffset:(CGPoint *)centerOffset
+ (UIImage *)defaultPinImageWithCenterOffset:(CGPoint *)centerOffset NS_RETURNS_RETAINED
{
static MKAnnotationView *pin;
static dispatch_once_t onceToken;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASMultiplexImageNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier
targetSize:(CGSize)targetSize
contentMode:(PHImageContentMode)contentMode
options:(PHImageRequestOptions *)options AS_WARN_UNUSED_RESULT API_AVAILABLE(ios(8.0), tvos(10.0));
options:(PHImageRequestOptions *)options NS_RETURNS_RETAINED AS_WARN_UNUSED_RESULT API_AVAILABLE(ios(8.0), tvos(10.0));

@end

Expand Down
2 changes: 1 addition & 1 deletion Source/ASMultiplexImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ - (void)_finishedLoadingImage:(UIImage *)image forIdentifier:(id)imageIdentifier

@implementation NSURL (ASPhotosFrameworkURLs)

+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options
+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options NS_RETURNS_RETAINED
{
ASPhotosFrameworkImageRequest *request = [[ASPhotosFrameworkImageRequest alloc] initWithAssetIdentifier:assetLocalIdentifier];
request.options = options;
Expand Down
2 changes: 2 additions & 0 deletions Source/ASRunLoopQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ AS_SUBCLASSING_RESTRICTED
* Each node will only be called once per transaction commit to reflect interface change.
*/
@property (class, atomic, readonly) ASCATransactionQueue *sharedQueue;
+ (ASCATransactionQueue *)sharedQueue NS_RETURNS_RETAINED;

- (void)enqueue:(id<ASCATransactionQueueObserving>)object;

Expand All @@ -83,6 +84,7 @@ AS_SUBCLASSING_RESTRICTED
@interface ASDeallocQueue : NSObject

@property (class, atomic, readonly) ASDeallocQueue *sharedDeallocationQueue;
+ (ASDeallocQueue *)sharedDeallocationQueue NS_RETURNS_RETAINED;

- (void)test_drain;

Expand Down
4 changes: 2 additions & 2 deletions Source/ASRunLoopQueue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ @implementation ASDeallocQueue {
ASDN::RecursiveMutex _queueLock;
}

+ (ASDeallocQueue *)sharedDeallocationQueue
+ (ASDeallocQueue *)sharedDeallocationQueue NS_RETURNS_RETAINED
{
static ASDeallocQueue *deallocQueue = nil;
static dispatch_once_t onceToken;
Expand Down Expand Up @@ -516,7 +516,7 @@ @implementation ASCATransactionQueue
// and kASASCATransactionQueuePostOrder will apply interface change immediately.
static int const kASASCATransactionQueuePostOrder = 3000000;

+ (ASCATransactionQueue *)sharedQueue
+ (ASCATransactionQueue *)sharedQueue NS_RETURNS_RETAINED
{
static dispatch_once_t onceToken;
static ASCATransactionQueue *sharedQueue;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
* NOTE: Be careful to copy `text` if needed.
*/
+ (ASTextLayout *)compatibleLayoutWithContainer:(ASTextContainer *)container
text:(NSAttributedString *)text
text:(NSAttributedString *)text NS_RETURNS_RETAINED

{
// Allocate layoutCacheLock on the heap to prevent destruction at app exit (https://github.com/TextureGroup/Texture/issues/136)
Expand Down
6 changes: 3 additions & 3 deletions Source/Debug/AsyncDisplayKit+Debug.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ - (void)drawEdgeIfClippedWithEdges:(UIRectEdge)rectEdge color:(UIColor *)color b

@interface _ASRangeDebugOverlayView : UIView

+ (instancetype)sharedInstance;
+ (instancetype)sharedInstance NS_RETURNS_RETAINED;

- (void)addRangeController:(ASRangeController *)rangeController;

Expand Down Expand Up @@ -311,7 +311,7 @@ + (UIWindow *)keyWindow
return [[NSClassFromString(@"UIApplication") sharedApplication] keyWindow];
}

+ (instancetype)sharedInstance
+ (_ASRangeDebugOverlayView *)sharedInstance NS_RETURNS_RETAINED
{
static _ASRangeDebugOverlayView *__rangeDebugOverlay = nil;

Expand Down Expand Up @@ -752,7 +752,7 @@ - (ASImageNode *)createRangeNodeWithColor:(UIColor *)color
return rangeBarImageNode;
}

+ (NSAttributedString *)whiteAttributedStringFromString:(NSString *)string withSize:(CGFloat)size
+ (NSAttributedString *)whiteAttributedStringFromString:(NSString *)string withSize:(CGFloat)size NS_RETURNS_RETAINED
{
NSDictionary *attributes = @{NSForegroundColorAttributeName : [UIColor whiteColor],
NSFontAttributeName : [UIFont systemFontOfSize:size]};
Expand Down
1 change: 1 addition & 0 deletions Source/Details/ASBasicImageDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
* @note It is strongly recommended you include PINRemoteImage and use @c ASPINRemoteImageDownloader instead.
*/
@property (class, readonly) ASBasicImageDownloader *sharedImageDownloader;
+ (ASBasicImageDownloader *)sharedImageDownloader NS_RETURNS_RETAINED;

+ (instancetype)new __attribute__((unavailable("+[ASBasicImageDownloader sharedImageDownloader] must be used.")));
- (instancetype)init __attribute__((unavailable("+[ASBasicImageDownloader sharedImageDownloader] must be used.")));
Expand Down
4 changes: 3 additions & 1 deletion Source/Details/ASIntegerMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,23 @@ AS_SUBCLASSING_RESTRICTED
*/
+ (ASIntegerMap *)mapForUpdateWithOldCount:(NSInteger)oldCount
deleted:(nullable NSIndexSet *)deleted
inserted:(nullable NSIndexSet *)inserted;
inserted:(nullable NSIndexSet *)inserted NS_RETURNS_RETAINED;

/**
* A singleton that maps each integer to itself. Its inverse is itself.
*
* Note: You cannot mutate this.
*/
@property (class, atomic, readonly) ASIntegerMap *identityMap;
+ (ASIntegerMap *)identityMap NS_RETURNS_RETAINED;

/**
* A singleton that returns NSNotFound for all keys. Its inverse is itself.
*
* Note: You cannot mutate this.
*/
@property (class, atomic, readonly) ASIntegerMap *emptyMap;
+ (ASIntegerMap *)emptyMap NS_RETURNS_RETAINED;

/**
* Retrieves the integer for a given key, or NSNotFound if the key is not found.
Expand Down
6 changes: 3 additions & 3 deletions Source/Details/ASIntegerMap.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ @implementation ASIntegerMap {

#pragma mark - Singleton

+ (ASIntegerMap *)identityMap
+ (ASIntegerMap *)identityMap NS_RETURNS_RETAINED
{
static ASIntegerMap *identityMap;
static dispatch_once_t onceToken;
Expand All @@ -43,7 +43,7 @@ + (ASIntegerMap *)identityMap
return identityMap;
}

+ (ASIntegerMap *)emptyMap
+ (ASIntegerMap *)emptyMap NS_RETURNS_RETAINED
{
static ASIntegerMap *emptyMap;
static dispatch_once_t onceToken;
Expand All @@ -55,7 +55,7 @@ + (ASIntegerMap *)emptyMap
return emptyMap;
}

+ (ASIntegerMap *)mapForUpdateWithOldCount:(NSInteger)oldCount deleted:(NSIndexSet *)deletions inserted:(NSIndexSet *)insertions
+ (ASIntegerMap *)mapForUpdateWithOldCount:(NSInteger)oldCount deleted:(NSIndexSet *)deletions inserted:(NSIndexSet *)insertions NS_RETURNS_RETAINED
{
if (oldCount == 0) {
return ASIntegerMap.emptyMap;
Expand Down
1 change: 1 addition & 0 deletions Source/Details/ASPINRemoteImageDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
* available. It uses PINRemoteImage's features to provide caching and progressive image downloads.
*/
@property (class, readonly) ASPINRemoteImageDownloader *sharedDownloader;
+ (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED;


/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASPINRemoteImageDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ @interface ASPINRemoteImageDownloader ()

@implementation ASPINRemoteImageDownloader

+ (ASPINRemoteImageDownloader *)sharedDownloader
+ (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED
{

static dispatch_once_t onceToken = 0;
Expand Down
6 changes: 3 additions & 3 deletions Source/Details/ASPageTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ typedef ASPageTable<id, NSMutableArray<UICollectionViewLayoutAttributes *> *> AS
/**
* Creates a new page table with (NSMapTableStrongMemory | NSMapTableObjectPointerPersonality) for values.
*/
+ (ASPageTable *)pageTableForStrongObjectPointers;
+ (ASPageTable *)pageTableForStrongObjectPointers NS_RETURNS_RETAINED;

/**
* Creates a new page table with (NSMapTableWeakMemory | NSMapTableObjectPointerPersonality) for values.
*/
+ (ASPageTable *)pageTableForWeakObjectPointers;
+ (ASPageTable *)pageTableForWeakObjectPointers NS_RETURNS_RETAINED;

/**
* Builds a new page to layout attributes from the given layout attributes.
Expand All @@ -98,7 +98,7 @@ typedef ASPageTable<id, NSMutableArray<UICollectionViewLayoutAttributes *> *> AS
*
* @param pageSize The size of each page.
*/
+ (ASPageToLayoutAttributesTable *)pageTableWithLayoutAttributes:(id<NSFastEnumeration>)layoutAttributesEnumerator contentSize:(CGSize)contentSize pageSize:(CGSize)pageSize;
+ (ASPageToLayoutAttributesTable *)pageTableWithLayoutAttributes:(id<NSFastEnumeration>)layoutAttributesEnumerator contentSize:(CGSize)contentSize pageSize:(CGSize)pageSize NS_RETURNS_RETAINED;

/**
* Retrieves the object for a given page, or nil if the page is not found.
Expand Down
8 changes: 4 additions & 4 deletions Source/Details/ASPageTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extern CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CGSiz

@implementation NSMapTable (ASPageTableMethods)

+ (instancetype)pageTableWithValuePointerFunctions:(NSPointerFunctions *)valueFuncs
+ (instancetype)pageTableWithValuePointerFunctions:(NSPointerFunctions *)valueFuncs NS_RETURNS_RETAINED
{
static NSPointerFunctions *pageCoordinatesFuncs;
static dispatch_once_t onceToken;
Expand All @@ -90,7 +90,7 @@ + (instancetype)pageTableWithValuePointerFunctions:(NSPointerFunctions *)valueFu
return [[NSMapTable alloc] initWithKeyPointerFunctions:pageCoordinatesFuncs valuePointerFunctions:valueFuncs capacity:0];
}

+ (ASPageTable *)pageTableForStrongObjectPointers
+ (ASPageTable *)pageTableForStrongObjectPointers NS_RETURNS_RETAINED
{
static NSPointerFunctions *strongObjectPointerFuncs;
static dispatch_once_t onceToken;
Expand All @@ -100,7 +100,7 @@ + (ASPageTable *)pageTableForStrongObjectPointers
return [self pageTableWithValuePointerFunctions:strongObjectPointerFuncs];
}

+ (ASPageTable *)pageTableForWeakObjectPointers
+ (ASPageTable *)pageTableForWeakObjectPointers NS_RETURNS_RETAINED
{
static NSPointerFunctions *weakObjectPointerFuncs;
static dispatch_once_t onceToken;
Expand All @@ -110,7 +110,7 @@ + (ASPageTable *)pageTableForWeakObjectPointers
return [self pageTableWithValuePointerFunctions:weakObjectPointerFuncs];
}

+ (ASPageToLayoutAttributesTable *)pageTableWithLayoutAttributes:(id<NSFastEnumeration>)layoutAttributesEnumerator contentSize:(CGSize)contentSize pageSize:(CGSize)pageSize
+ (ASPageToLayoutAttributesTable *)pageTableWithLayoutAttributes:(id<NSFastEnumeration>)layoutAttributesEnumerator contentSize:(CGSize)contentSize pageSize:(CGSize)pageSize NS_RETURNS_RETAINED
{
ASPageToLayoutAttributesTable *result = [ASPageTable pageTableForStrongObjectPointers];
for (UICollectionViewLayoutAttributes *attrs in layoutAttributesEnumerator) {
Expand Down
12 changes: 6 additions & 6 deletions Source/Details/ASTraitCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ AS_SUBCLASSING_RESTRICTED
@property (nonatomic, assign, readonly) CGSize containerSize;

+ (ASTraitCollection *)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection
containerSize:(CGSize)windowSize;
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED;

+ (ASTraitCollection *)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection
containerSize:(CGSize)windowSize
fallbackContentSizeCategory:(UIContentSizeCategory)fallbackContentSizeCategory;
fallbackContentSizeCategory:(UIContentSizeCategory)fallbackContentSizeCategory NS_RETURNS_RETAINED;

#if TARGET_OS_TV
+ (ASTraitCollection *)traitCollectionWithHorizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass
Expand All @@ -210,7 +210,7 @@ AS_SUBCLASSING_RESTRICTED
layoutDirection:(UITraitEnvironmentLayoutDirection)layoutDirection
userInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle
preferredContentSizeCategory:(UIContentSizeCategory)preferredContentSizeCategory
containerSize:(CGSize)windowSize;
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED;
#else
+ (ASTraitCollection *)traitCollectionWithHorizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass
verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass
Expand All @@ -220,7 +220,7 @@ AS_SUBCLASSING_RESTRICTED
forceTouchCapability:(UIForceTouchCapability)forceTouchCapability
layoutDirection:(UITraitEnvironmentLayoutDirection)layoutDirection
preferredContentSizeCategory:(UIContentSizeCategory)preferredContentSizeCategory
containerSize:(CGSize)windowSize;
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED;
#endif

- (BOOL)isEqualToTraitCollection:(ASTraitCollection *)traitCollection;
Expand All @@ -232,7 +232,7 @@ AS_SUBCLASSING_RESTRICTED
*/
@interface ASTraitCollection (PrimitiveTraits)

+ (ASTraitCollection *)traitCollectionWithASPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traits;
+ (ASTraitCollection *)traitCollectionWithASPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traits NS_RETURNS_RETAINED;

- (ASPrimitiveTraitCollection)primitiveTraitCollection;

Expand All @@ -248,7 +248,7 @@ AS_SUBCLASSING_RESTRICTED
verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass
forceTouchCapability:(UIForceTouchCapability)forceTouchCapability
containerSize:(CGSize)windowSize
ASDISPLAYNODE_DEPRECATED_MSG("Use full version of this method instead.");
NS_RETURNS_RETAINED ASDISPLAYNODE_DEPRECATED_MSG("Use full version of this method instead.");

@end

Expand Down
12 changes: 6 additions & 6 deletions Source/Details/ASTraitCollection.m
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ + (instancetype)traitCollectionWithHorizontalSizeClass:(UIUserInterfaceSizeClass
layoutDirection:(UITraitEnvironmentLayoutDirection)layoutDirection
userInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle
preferredContentSizeCategory:(UIContentSizeCategory _Nonnull)preferredContentSizeCategory
containerSize:(CGSize)windowSize
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED
{
return [[self alloc] initWithHorizontalSizeClass:horizontalSizeClass
verticalSizeClass:verticalSizeClass
Expand Down Expand Up @@ -332,7 +332,7 @@ + (instancetype)traitCollectionWithHorizontalSizeClass:(UIUserInterfaceSizeClass
forceTouchCapability:(UIForceTouchCapability)forceTouchCapability
layoutDirection:(UITraitEnvironmentLayoutDirection)layoutDirection
preferredContentSizeCategory:(UIContentSizeCategory _Nonnull)preferredContentSizeCategory
containerSize:(CGSize)windowSize
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED
{
return [[self alloc] initWithHorizontalSizeClass:horizontalSizeClass
verticalSizeClass:verticalSizeClass
Expand All @@ -348,7 +348,7 @@ + (instancetype)traitCollectionWithHorizontalSizeClass:(UIUserInterfaceSizeClass
#endif

+ (instancetype)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection
containerSize:(CGSize)windowSize
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED
{
return [self traitCollectionWithUITraitCollection:traitCollection
containerSize:windowSize
Expand All @@ -358,7 +358,7 @@ + (instancetype)traitCollectionWithUITraitCollection:(UITraitCollection *)traitC

+ (instancetype)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection
containerSize:(CGSize)windowSize
fallbackContentSizeCategory:(UIContentSizeCategory _Nonnull)fallbackContentSizeCategory
fallbackContentSizeCategory:(UIContentSizeCategory _Nonnull)fallbackContentSizeCategory NS_RETURNS_RETAINED
{
UIDisplayGamut displayGamut;
UITraitEnvironmentLayoutDirection layoutDirection;
Expand Down Expand Up @@ -435,7 +435,7 @@ - (BOOL)isEqualToTraitCollection:(ASTraitCollection *)traitCollection

@implementation ASTraitCollection (PrimitiveTraits)

+ (instancetype)traitCollectionWithASPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traits
+ (instancetype)traitCollectionWithASPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traits NS_RETURNS_RETAINED
{
#if TARGET_OS_TV
return [self traitCollectionWithHorizontalSizeClass:traits.horizontalSizeClass
Expand Down Expand Up @@ -514,7 +514,7 @@ + (ASTraitCollection *)traitCollectionWithDisplayScale:(CGFloat)displayScale
horizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass
verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass
forceTouchCapability:(UIForceTouchCapability)forceTouchCapability
containerSize:(CGSize)windowSize
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED
{
#if TARGET_OS_TV
return [self traitCollectionWithHorizontalSizeClass:horizontalSizeClass
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASWeakProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ AS_SUBCLASSING_RESTRICTED
*
* @return an instance of ASWeakProxy
*/
+ (instancetype)weakProxyWithTarget:(id)target;
+ (instancetype)weakProxyWithTarget:(id)target NS_RETURNS_RETAINED;

@end
2 changes: 1 addition & 1 deletion Source/Details/ASWeakProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (instancetype)initWithTarget:(id)target
return self;
}

+ (instancetype)weakProxyWithTarget:(id)target
+ (instancetype)weakProxyWithTarget:(id)target NS_RETURNS_RETAINED
{
return [[ASWeakProxy alloc] initWithTarget:target];
}
Expand Down
Loading