diff --git a/CBORSwift.podspec b/CBORSwift.podspec index 6f3a79f..55b639f 100644 --- a/CBORSwift.podspec +++ b/CBORSwift.podspec @@ -63,11 +63,11 @@ Pod::Spec.new do |s| # # s.platform = :ios - s.platform = :ios, "10.0" + # s.platform = :ios, "10.0" # When using multiple platforms - # s.ios.deployment_target = "10.13" - # s.osx.deployment_target = "10.7" + s.ios.deployment_target = "10.0" + s.osx.deployment_target = "10.12" # s.watchos.deployment_target = "2.0" # s.tvos.deployment_target = "9.0" diff --git a/CBORSwift.xcodeproj/project.pbxproj b/CBORSwift.xcodeproj/project.pbxproj index 8ea5a7b..41f4144 100644 --- a/CBORSwift.xcodeproj/project.pbxproj +++ b/CBORSwift.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 1747B8C0209C5BA9000663CA /* Decoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1747B8BF209C5BA9000663CA /* Decoder.swift */; }; 179837AB209A1A2E0048DCD2 /* CBORSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179837A1209A1A2E0048DCD2 /* CBORSwift.framework */; }; 179837B0209A1A2E0048DCD2 /* CBORSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179837AF209A1A2E0048DCD2 /* CBORSwiftTests.swift */; }; - 179837B2209A1A2E0048DCD2 /* CBORSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = 179837A4209A1A2E0048DCD2 /* CBORSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 179837BC209A1CAD0048DCD2 /* MajorTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179837BB209A1CAD0048DCD2 /* MajorTypes.swift */; }; 179837BF209A22310048DCD2 /* CBOR.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179837BE209A22310048DCD2 /* CBOR.swift */; }; 179837C1209A2A490048DCD2 /* Encoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179837C0209A2A490048DCD2 /* Encoder.swift */; }; @@ -35,7 +34,6 @@ 1747B8BD209C5B8F000663CA /* CBORDecoderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBORDecoderTests.swift; sourceTree = ""; }; 1747B8BF209C5BA9000663CA /* Decoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoder.swift; sourceTree = ""; }; 179837A1209A1A2E0048DCD2 /* CBORSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CBORSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 179837A4209A1A2E0048DCD2 /* CBORSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CBORSwift.h; sourceTree = ""; }; 179837A5209A1A2E0048DCD2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 179837AA209A1A2E0048DCD2 /* CBORSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CBORSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 179837AF209A1A2E0048DCD2 /* CBORSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBORSwiftTests.swift; sourceTree = ""; }; @@ -88,7 +86,6 @@ isa = PBXGroup; children = ( 179837BD209A1CB30048DCD2 /* Classes */, - 179837A4209A1A2E0048DCD2 /* CBORSwift.h */, 179837A5209A1A2E0048DCD2 /* Info.plist */, ); path = CBORSwift; @@ -125,7 +122,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 179837B2209A1A2E0048DCD2 /* CBORSwift.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -397,7 +393,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.hassaniiii.CBORSwift; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; + SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; @@ -426,7 +422,7 @@ ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.hassaniiii.CBORSwift; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; + SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -449,7 +445,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.hassaniiii.CBORSwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SDKROOT = iphoneos; + SDKROOT = macosx; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -471,7 +467,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.hassaniiii.CBORSwiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SDKROOT = iphoneos; + SDKROOT = macosx; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/CBORSwift.xcodeproj/project.xcworkspace/xcuserdata/hassan.xcuserdatad/UserInterfaceState.xcuserstate b/CBORSwift.xcodeproj/project.xcworkspace/xcuserdata/hassan.xcuserdatad/UserInterfaceState.xcuserstate index 1d082cb..e9dccc9 100644 Binary files a/CBORSwift.xcodeproj/project.xcworkspace/xcuserdata/hassan.xcuserdatad/UserInterfaceState.xcuserstate and b/CBORSwift.xcodeproj/project.xcworkspace/xcuserdata/hassan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CBORSwift.xcodeproj/xcuserdata/hassan.xcuserdatad/xcschemes/CBORSwift.xcscheme b/CBORSwift.xcodeproj/xcuserdata/hassan.xcuserdatad/xcschemes/CBORSwift.xcscheme index 0d5e1fd..496d414 100644 --- a/CBORSwift.xcodeproj/xcuserdata/hassan.xcuserdatad/xcschemes/CBORSwift.xcscheme +++ b/CBORSwift.xcodeproj/xcuserdata/hassan.xcuserdatad/xcschemes/CBORSwift.xcscheme @@ -38,9 +38,6 @@ ReferencedContainer = "container:CBORSwift.xcodeproj"> - - diff --git a/CBORSwift/CBORSwift.h b/CBORSwift/CBORSwift.h deleted file mode 100644 index 13c74f6..0000000 --- a/CBORSwift/CBORSwift.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// CBORSwift.h -// CBORSwift -// -// Created by Hassan Shahbazi on 5/2/18. -// Copyright © 2018 Hassan Shahbazi. All rights reserved. -// - -#import - -//! Project version number for CBORSwift. -FOUNDATION_EXPORT double CBORSwiftVersionNumber; - -//! Project version string for CBORSwift. -FOUNDATION_EXPORT const unsigned char CBORSwiftVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/CBORSwift/Classes/CBOR.swift b/CBORSwift/Classes/CBOR.swift index da4c290..0e3402a 100644 --- a/CBORSwift/Classes/CBOR.swift +++ b/CBORSwift/Classes/CBOR.swift @@ -6,6 +6,8 @@ // Copyright © 2018 Hassan Shahbazi. All rights reserved. // +import Foundation + public class CBOR: NSObject { //MARK:- Encoder diff --git a/CBORSwift/Classes/Decoder.swift b/CBORSwift/Classes/Decoder.swift index 38930a1..09d806b 100644 --- a/CBORSwift/Classes/Decoder.swift +++ b/CBORSwift/Classes/Decoder.swift @@ -6,6 +6,8 @@ // Copyright © 2018 Hassan Shahbazi. All rights reserved. // +import Foundation + class Decoder: NSObject { private var body = [UInt8]() diff --git a/CBORSwift/Classes/Encoder.swift b/CBORSwift/Classes/Encoder.swift index 0a8def4..24c4d81 100644 --- a/CBORSwift/Classes/Encoder.swift +++ b/CBORSwift/Classes/Encoder.swift @@ -6,6 +6,8 @@ // Copyright © 2018 Hassan Shahbazi. All rights reserved. // +import Foundation + class Encoder: NSObject { class func prepareByteArray(major: MajorType, measure: Int) -> [UInt8] { var encoded = MajorTypes(major).get().bytes diff --git a/CBORSwift/Classes/MajorTypes.swift b/CBORSwift/Classes/MajorTypes.swift index a9ed9dd..2d98074 100644 --- a/CBORSwift/Classes/MajorTypes.swift +++ b/CBORSwift/Classes/MajorTypes.swift @@ -5,6 +5,9 @@ // Created by Hassan Shahbazi on 5/2/18. // Copyright © 2018 Hassan Shahbazi. All rights reserved. // + +import Foundation + enum MajorType: String { case major0 = "000" //unsigned integer case major1 = "001" //negative integer diff --git a/CBORSwift/Classes/MyNSObject.swift b/CBORSwift/Classes/MyNSObject.swift index e94a5a1..193945e 100644 --- a/CBORSwift/Classes/MyNSObject.swift +++ b/CBORSwift/Classes/MyNSObject.swift @@ -6,7 +6,7 @@ // Copyright © 2018 Hassan Shahbazi. All rights reserved. // -import UIKit +import Foundation public class NSByteString: NSObject { private var value: String = "" diff --git a/README.md b/README.md index 879651e..45679e3 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ var encoded = NSNumber(value: -42949295).encode() var decoded = CBOR.decode([0x0A]) var decoded = [0x0A].decode() -var decoded = CBOR.decode([[0x39, 0x01, 0x00]]) -var decoded = [[0x39, 0x01, 0x00]].decode() +var decoded = CBOR.decode([0x39, 0x01, 0x00]) +var decoded = [0x39, 0x01, 0x00].decode() ``` #### Byte Strings