aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvery Pierce <aapierce0@gmail.com>2017-01-17 20:36:01 -0600
committerRichard van der Hoff <richard@matrix.org>2017-01-18 10:46:37 +0000
commit757be9aeba67d609942c54c1bbe0461e120a392e (patch)
treef3f36c250d7cf5dec0012552a1f115c508655025
parent4373ac3ef605d6b2831e5686e7f58180f928ebfd (diff)
OLMKit: Change OLMKitVersionString from a C function to an Obj-C static method
-rw-r--r--xcode/OLMKit/OLMKit.h11
-rw-r--r--xcode/OLMKit/OLMKit.m10
2 files changed, 14 insertions, 7 deletions
diff --git a/xcode/OLMKit/OLMKit.h b/xcode/OLMKit/OLMKit.h
index e23a9f1..455d11b 100644
--- a/xcode/OLMKit/OLMKit.h
+++ b/xcode/OLMKit/OLMKit.h
@@ -18,10 +18,6 @@
#import <Foundation/Foundation.h>
-
-//! Project version string for OLMKit, the same as libolm.
-NSString *OLMKitVersionString();
-
// In this header, you should import all the public headers of your framework using statements like #import <OLMKit/PublicHeader.h>
#import <OLMKit/OLMAccount.h>
@@ -30,3 +26,10 @@ NSString *OLMKitVersionString();
#import <OLMKit/OLMUtility.h>
#import <OLMKit/OLMInboundGroupSession.h>
#import <OLMKit/OLMOutboundGroupSession.h>
+
+@interface OLMKit : NSObject
+
+//! Project version string for OLMKit, the same as libolm.
++ (NSString*)versionString;
+
+@end
diff --git a/xcode/OLMKit/OLMKit.m b/xcode/OLMKit/OLMKit.m
index e7bfd25..c383650 100644
--- a/xcode/OLMKit/OLMKit.m
+++ b/xcode/OLMKit/OLMKit.m
@@ -19,11 +19,15 @@
#include "olm/olm.h"
-NSString *OLMKitVersionString()
+@implementation OLMKit
+
++ (NSString*)versionString
{
uint8_t major, minor, patch;
-
+
olm_get_library_version(&major, &minor, &patch);
-
+
return [NSString stringWithFormat:@"%tu.%tu.%tu", major, minor, patch];
}
+
+@end