Skip to content

Modernise objc header for Swift support #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions MQTTKit/MQTTKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@
// Copyright 2012 Nicholas Humfrey. All rights reserved.
//

typedef enum MQTTConnectionReturnCode : NSUInteger {
#ifndef NS_DESIGNATED_INITIALIZER
#define NS_DESIGNATED_INITIALIZER
#endif

typedef NS_ENUM(NSUInteger, MQTTConnectionReturnCode) {
ConnectionAccepted,
ConnectionRefusedUnacceptableProtocolVersion,
ConnectionRefusedIdentiferRejected,
ConnectionRefusedServerUnavailable,
ConnectionRefusedBadUserNameOrPassword,
ConnectionRefusedNotAuthorized
} MQTTConnectionReturnCode;
};

typedef enum MQTTQualityOfService : NSUInteger {
typedef NS_ENUM(NSUInteger, MQTTQualityOfService) {
AtMostOnce,
AtLeastOnce,
ExactlyOnce
} MQTTQualityOfService;
};

#pragma mark - MQTT Message

Expand Down Expand Up @@ -66,7 +70,7 @@ typedef void (^MQTTDisconnectionHandler)(NSUInteger code);

- (MQTTClient*) initWithClientId: (NSString *)clientId;
- (MQTTClient*) initWithClientId: (NSString *)clientId
cleanSession: (BOOL )cleanSession;
cleanSession: (BOOL )cleanSession NS_DESIGNATED_INITIALIZER;
- (void) setMessageRetry: (NSUInteger)seconds;

#pragma mark - Connection
Expand Down