From 7675fb92935236c12db9718f4d2c0ed4b87a65d2 Mon Sep 17 00:00:00 2001 From: Pascal Brogle Date: Thu, 24 Jul 2014 14:23:11 +0200 Subject: [PATCH] modernise objc header for Swift support --- MQTTKit/MQTTKit.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/MQTTKit/MQTTKit.h b/MQTTKit/MQTTKit.h index 14be2b2..125822d 100644 --- a/MQTTKit/MQTTKit.h +++ b/MQTTKit/MQTTKit.h @@ -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 @@ -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