Skip to content

Commit

Permalink
Making the relevant fields public.
Browse files Browse the repository at this point in the history
  • Loading branch information
wicheda committed Jul 5, 2021
1 parent c08361f commit c9c3805
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion FlagsmithClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'FlagsmithClient'
s.version = '1.0.3'
s.version = '1.0.4'
s.summary = 'iOS Client written in Swift for Flagsmith. Ship features with confidence using feature flags and remote config.'
s.homepage = 'https://github.com/Flagsmith/flagsmith-ios-client'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
9 changes: 5 additions & 4 deletions FlagsmithClient/Classes/Trait.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ public struct PostTrait: Codable {

public let key: String
public var value: String
var identity: IdentityStruct
public var identity: IdentityStruct

struct IdentityStruct: Codable {
var identifier: String
public struct IdentityStruct: Codable {
public var identifier: String

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case identifier = "identifier"
}

public init(identifier: String) {
self.identifier = identifier
}
Expand Down
12 changes: 6 additions & 6 deletions FlagsmithClient/Classes/UnknownTypeValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import Foundation
/**
An UnknownTypeValue represents a value which can have a variable type
*/
enum UnknownTypeValue: Decodable {
public enum UnknownTypeValue: Decodable {

case int(Int), string(String), float(Float)

init(from decoder: Decoder) throws {
public init(from decoder: Decoder) throws {
if let int = try? decoder.singleValueContainer().decode(Int.self) {
self = .int(int)
return
Expand All @@ -33,27 +33,27 @@ enum UnknownTypeValue: Decodable {
throw UnknownTypeError.missingValue
}

enum UnknownTypeError:Error {
public enum UnknownTypeError:Error {
case missingValue
}

var intValue: Int? {
public var intValue: Int? {
switch self {
case .int(let value): return value
case .string(let value): return Int(value)
case .float(let value): return Int(value)
}
}

var stringValue: String? {
public var stringValue: String? {
switch self {
case .int(let value): return String(value)
case .string(let value): return value
case .float(let value): return String(value)
}
}

var floatValue: Float? {
public var floatValue: Float? {
switch self {
case .int(let value): return Float(value)
case .string(let value): return Float(value)
Expand Down

0 comments on commit c9c3805

Please sign in to comment.