UserNetwork

@interface UserNetwork : NSObject

UserNetwork is a model to represent the different networks a user has connected with.

  • The name of the network. Eg. Phone / Email / Facebook.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSString *_Nonnull name;

    Swift

    var name: String { get }
  • The User‘s name of the network. One of externalUserName / externalUserId must be set.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *externalUserName;

    Swift

    var externalUserName: String? { get }
  • The User‘s id of the network. One of externalUserName / externalUserId must be set.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *externalUserId;

    Swift

    var externalUserId: String? { get }
  • The status of the network. Either Active or Verifying.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UserNetworkStatus status;

    Swift

    var status: UserNetworkStatus { get }
  • Default initializer for the UserNetwork.

    Declaration

    Objective-C

    + (nonnull instancetype)userNetworkFromDictionary:
        (nonnull NSDictionary *)dictionary;

    Swift

    convenience init(from dictionary: [AnyHashable : Any])

    Parameters

    dictionary

    - a dictionary with properties used to create the UserNetwork.

    Return Value

    instance of UserNetwork.

  • Converts the UserNetwork to an NSDictionary that can be used for caching or sending to the server.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)dictionaryRepresentation;

    Swift

    func dictionaryRepresentation() -> [AnyHashable : Any]

    Return Value

    dictionary - Dictionary form of a UserNetwork.