From 5f132b563ec067761a3e246c3808747cd9b726a3 Mon Sep 17 00:00:00 2001 From: "Dr. Brandon Wiley" Date: Sun, 18 Aug 2019 21:45:35 -0500 Subject: [PATCH] Make functions public --- Sources/Song/Decoding/SongDecoder.swift | 6 +++--- Sources/Song/Encoding/SongEncoder.swift | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Song/Decoding/SongDecoder.swift b/Sources/Song/Decoding/SongDecoder.swift index 553a063..55ab110 100644 --- a/Sources/Song/Decoding/SongDecoder.swift +++ b/Sources/Song/Decoding/SongDecoder.swift @@ -17,7 +17,7 @@ public class SongDecoder { userInfo=[:] } - func decode(_ type: [T].Type, from data: Data) throws -> [T] where T : Decodable { + public func decode(_ type: [T].Type, from data: Data) throws -> [T] where T : Decodable { NSLog("ARRAY DECODE CHOSEN") NSLog("decode data: \(data as NSData)") self.data=data @@ -185,7 +185,7 @@ public class SongDecoder { } } - func decode(_ type: T.Type, from data: Data) throws -> T where T : Decodable + public func decode(_ type: T.Type, from data: Data) throws -> T where T : Decodable { NSLog("decode data: \(data as NSData)") self.data=data @@ -245,7 +245,7 @@ public class SongDecoder { } } - func singleType(_ type: T.Type) -> Bool { + public func singleType(_ type: T.Type) -> Bool { if type == String.self { return true } diff --git a/Sources/Song/Encoding/SongEncoder.swift b/Sources/Song/Encoding/SongEncoder.swift index 3bb183a..bee8ab9 100644 --- a/Sources/Song/Encoding/SongEncoder.swift +++ b/Sources/Song/Encoding/SongEncoder.swift @@ -24,7 +24,7 @@ public class SongEncoder { userInfo=[:] } - func encode(_ value: [Key: Value]) throws -> Data where Key : Encodable & CodingKey, Value : Encodable { + public func encode(_ value: [Key: Value]) throws -> Data where Key : Encodable & CodingKey, Value : Encodable { let map = _container(keyedBy: Key.self) for (key, val) in value { do { @@ -37,7 +37,7 @@ public class SongEncoder { return map.data! } - func encode(_ value: [Value]) throws -> Data where Value : Encodable { + public func encode(_ value: [Value]) throws -> Data where Value : Encodable { if let ints = value as? [Int] { let list = self._unkeyedContainer() do { @@ -113,7 +113,7 @@ public class SongEncoder { } } - func encode(_ value: Value) throws -> Data where Value : Encodable { + public func encode(_ value: Value) throws -> Data where Value : Encodable { switch value { // case is Dictionary: // break