mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
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:
committed by
Michael Schneider
parent
a798cf9008
commit
69ab24bc00
@@ -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)
|
||||
|
||||
@@ -40,7 +40,6 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState)
|
||||
};
|
||||
|
||||
@protocol ASInterfaceStateDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
/**
|
||||
* @abstract Called whenever any bit in the ASInterfaceState bitfield is changed.
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
- (void)interfaceStateDidChange:(ASInterfaceState)newState
|
||||
fromState:(ASInterfaceState)oldState ASDISPLAYNODE_REQUIRES_SUPER;
|
||||
|
||||
- (void)hierarchyDisplayDidFinish ASDISPLAYNODE_REQUIRES_SUPER;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASDisplayNode (ASNodeController)
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
- (void)interfaceStateDidChange:(ASInterfaceState)newState
|
||||
fromState:(ASInterfaceState)oldState {}
|
||||
|
||||
- (void)hierarchyDisplayDidFinish {}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASDisplayNode (ASNodeController)
|
||||
|
||||
Reference in New Issue
Block a user