Use NS_RETURNS_RETAINED macro to save time (#843)

* Use NS_RETURNS_RETAINED macro to save time

* Update changelog and do the thing with the license headers
This commit is contained in:
Adlai Holler
2018-03-21 08:13:09 -07:00
committed by GitHub
parent e954b1045a
commit 2b12654810
61 changed files with 239 additions and 184 deletions

View File

@@ -1,12 +1,18 @@
//
// ASTextInput.h
// Modified from YYText <https://github.com/ibireme/YYText>
// Texture
//
// Created by ibireme on 15/4/17.
// Copyright (c) 2015 ibireme.
// 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 /ASDK-Licenses directory of this source tree. An additional
// grant of patent rights can be found in the PATENTS file in the same directory.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
// Modifications to this file made after 4/13/2017 are: Copyright (c) through the present,
// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
#import <UIKit/UIKit.h>
@@ -36,8 +42,8 @@ typedef NS_ENUM(NSInteger, ASTextAffinity) {
@property (nonatomic, readonly) NSInteger offset;
@property (nonatomic, readonly) ASTextAffinity affinity;
+ (instancetype)positionWithOffset:(NSInteger)offset;
+ (instancetype)positionWithOffset:(NSInteger)offset affinity:(ASTextAffinity) affinity;
+ (instancetype)positionWithOffset:(NSInteger)offset NS_RETURNS_RETAINED;
+ (instancetype)positionWithOffset:(NSInteger)offset affinity:(ASTextAffinity) affinity NS_RETURNS_RETAINED;
- (NSComparisonResult)compare:(id)otherPosition;
@@ -57,10 +63,10 @@ typedef NS_ENUM(NSInteger, ASTextAffinity) {
@property (nonatomic, readonly) ASTextPosition *end;
@property (nonatomic, readonly, getter=isEmpty) BOOL empty;
+ (instancetype)rangeWithRange:(NSRange)range;
+ (instancetype)rangeWithRange:(NSRange)range affinity:(ASTextAffinity) affinity;
+ (instancetype)rangeWithStart:(ASTextPosition *)start end:(ASTextPosition *)end;
+ (instancetype)defaultRange; ///< <{0,0} Forward>
+ (instancetype)rangeWithRange:(NSRange)range NS_RETURNS_RETAINED;
+ (instancetype)rangeWithRange:(NSRange)range affinity:(ASTextAffinity) affinity NS_RETURNS_RETAINED;
+ (instancetype)rangeWithStart:(ASTextPosition *)start end:(ASTextPosition *)end NS_RETURNS_RETAINED;
+ (instancetype)defaultRange NS_RETURNS_RETAINED; ///< <{0,0} Forward>
- (NSRange)asRange;