Make interface state delegate non optional (#1112)

* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* Make interface state delegate protocol non-optional.

* add change log

* add missing removal

* add required method to ASNodeController

* fix indentation

* Update CHANGELOG.md
This commit is contained in:
Max Wang
2018-09-12 09:48:39 -07:00
committed by Michael Schneider
parent a798cf9008
commit 69ab24bc00
5 changed files with 7 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
## master
* Add your own contributions to the next release on the line below this with your name.
- [Breaking][ASDisplayNode] Make interface state delegate protocol required. [Max Wang](https://github.com/wsdwsd0829). [#1112](https://github.com/TextureGroup/Texture/pull/1112)
- [ASCollectionView] Fix reording of cells manually for iOS 9 & 10. [Max Wang](https://github.com/wsdwsd0829). [#1081](https://github.com/TextureGroup/Texture/pull/1081)
- [ASDisplayNode] Allow add/remove interface state delegates on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1090](https://github.com/TextureGroup/Texture/pull/1090)
- [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077)

View File

@@ -40,7 +40,6 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState)
};
@protocol ASInterfaceStateDelegate <NSObject>
@optional
/**
* @abstract Called whenever any bit in the ASInterfaceState bitfield is changed.

View File

@@ -460,9 +460,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__);
} \
__instanceLock__.unlock(); \
for (id <ASInterfaceStateDelegate> delegate in delegates) { \
if ([delegate respondsToSelector:@selector(method)]) { \
[delegate method]; \
} \
[delegate method]; \
}
- (BOOL)_locked_shouldLoadViewOrLayer
@@ -3220,9 +3218,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) {
NSHashTable *delegates = [_interfaceStateDelegates copy];
__instanceLock__.unlock();
for (id <ASInterfaceStateDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(interfaceStateDidChange:fromState:)]) {
[delegate interfaceStateDidChange:newState fromState:oldState];
}
[delegate interfaceStateDidChange:newState fromState:oldState];
}
}

View File

@@ -38,6 +38,8 @@
- (void)interfaceStateDidChange:(ASInterfaceState)newState
fromState:(ASInterfaceState)oldState ASDISPLAYNODE_REQUIRES_SUPER;
- (void)hierarchyDisplayDidFinish ASDISPLAYNODE_REQUIRES_SUPER;
@end
@interface ASDisplayNode (ASNodeController)

View File

@@ -80,6 +80,8 @@
- (void)interfaceStateDidChange:(ASInterfaceState)newState
fromState:(ASInterfaceState)oldState {}
- (void)hierarchyDisplayDidFinish {}
@end
@implementation ASDisplayNode (ASNodeController)