diff --git a/Source/FrameSubscribe.swift b/Source/FrameSubscribe.swift index 15918ff5..c00ca6dd 100644 --- a/Source/FrameSubscribe.swift +++ b/Source/FrameSubscribe.swift @@ -120,10 +120,7 @@ extension FrameSubscribe { //3.8.2.1.3 User Property if let userProperty = self.userProperty { - let dictValues = [String](userProperty.values) - for (value) in dictValues { - properties += getMQTTPropertyData(type: CocoaMQTTPropertyName.userProperty.rawValue, value: value.bytesWithLength) - } + properties += userProperty.userPropertyBytes } return properties diff --git a/Source/FrameUnsubAck.swift b/Source/FrameUnsubAck.swift index e3d60f4f..a8d722ef 100644 --- a/Source/FrameUnsubAck.swift +++ b/Source/FrameUnsubAck.swift @@ -69,10 +69,7 @@ extension FrameUnsubAck { //3.11.2.1.3 User Property if let userProperty = self.userProperty { - let dictValues = [String](userProperty.values) - for (value) in dictValues { - properties += getMQTTPropertyData(type: CocoaMQTTPropertyName.userProperty.rawValue, value: value.bytesWithLength) - } + properties += userProperty.userPropertyBytes } return properties; diff --git a/Source/FrameUnsubscribe.swift b/Source/FrameUnsubscribe.swift index c250990e..14a539f8 100644 --- a/Source/FrameUnsubscribe.swift +++ b/Source/FrameUnsubscribe.swift @@ -86,10 +86,7 @@ extension FrameUnsubscribe { // 3.10.2.1.2 User Property if let userProperty = self.userProperty { - let dictValues = [String](userProperty.values) - for (value) in dictValues { - properties += getMQTTPropertyData(type: CocoaMQTTPropertyName.userProperty.rawValue, value: value.bytesWithLength) - } + properties += userProperty.userPropertyBytes } return properties diff --git a/Source/MqttPublishProperties.swift b/Source/MqttPublishProperties.swift index 35b1f03a..1325b7fb 100644 --- a/Source/MqttPublishProperties.swift +++ b/Source/MqttPublishProperties.swift @@ -77,9 +77,7 @@ public class MqttPublishProperties: NSObject { } //3.3.2.3.7 Property Length User Property if let userProperty = self.userProperty { - for (key, value) in userProperty { - properties += getMQTTPropertyData(type: CocoaMQTTPropertyName.userProperty.rawValue, value: key.bytesWithLength + value.bytesWithLength) - } + properties += userProperty.userPropertyBytes } //3.3.2.3.8 Subscription Identifier if let subscriptionIdentifier = self.subscriptionIdentifier,