MNFComment

Objective-C

@interface MNFComment : MNFObject

Swift

class MNFComment : MNFObject

The MNFComment class encapsulates comment json data from the server in an object.

A comment should not be initialized directly but rather fetched from the server through fetching transactions. A comment can be created by posting a comment to a transaction.

Immutable properties

  • @abstract The identifier of the person who created the comment.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull personId;

    Swift

    var personId: NSNumber { get }
  • @abstract The date the comment was created.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDate *_Nonnull createdDate;

    Swift

    var createdDate: Date { get }
  • @abstract The date the comment was last modified.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDate *_Nonnull modifiedDate;

    Swift

    var modifiedDate: Date { get }
  • @abstract The identifier of the transaction the comment belongs to.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull transactionId;

    Swift

    var transactionId: NSNumber { get }

Mutable properties

  • @abstract The actual comment.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nullable comment;

    Swift

    var comment: String? { get set }

Saving

  • @abstract Saves changes to a comment to the server.

    Declaration

    Objective-C

    - (nonnull MNFJob *)saveWithCompletion:
        (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    func save(completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning a result and an error.

    Return Value

    An MNFJob containing a result and an error.

Deleting

  • @abstract Deletes a comment from the server.

    Warning

    Remember to deallocate objects that have been deleted from the server.

    Declaration

    Objective-C

    - (nonnull MNFJob *)deleteCommentWithCompletion:
        (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    func delete(completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning an error.

    Return Value

    An MNFJob containing an error.