IOSAD-103 make sendMessage KVO conformant IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Wed, 31 Oct 2018 16:38:25 +0100
branchIOSAD-103
changeset 744cb9231c6fc83
parent 743 ca6ca5d80a3c
child 745 fb63476f9adc
IOSAD-103 make sendMessage KVO conformant
pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.h
pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.m
     1.1 --- a/pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.h	Wed Oct 31 16:38:25 2018 +0100
     1.2 +++ b/pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.h	Wed Oct 31 16:38:25 2018 +0100
     1.3 @@ -14,6 +14,12 @@
     1.4  
     1.5  @interface PEPSessionTestSendMessageDelegate : NSObject<PEPSendMessageDelegate>
     1.6  
     1.7 +/**
     1.8 + Meant for waiting for changes in `messages`, since `NSMutableArray`
     1.9 + doesn't support KVO.
    1.10 + */
    1.11 +@property (nonatomic, nullable) PEPMessage *lastMessage;
    1.12 +
    1.13  @property (nonatomic, nonnull) NSMutableArray<PEPMessage *> *messages;
    1.14  
    1.15  @end
     2.1 --- a/pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.m	Wed Oct 31 16:38:25 2018 +0100
     2.2 +++ b/pEpObjCTests/TestUtils/PEPSessionTestSendMessageDelegate.m	Wed Oct 31 16:38:25 2018 +0100
     2.3 @@ -23,6 +23,7 @@
     2.4  
     2.5  - (PEP_STATUS)sendMessage:(PEPMessage * _Nonnull)message {
     2.6      [self.messages addObject:message];
     2.7 +    self.lastMessage = message;
     2.8      return PEP_STATUS_OK;
     2.9  }
    2.10