This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FFService { | |
init() { | |
// .... | |
switch target { | |
case .es: | |
overwriteESFlags() | |
case .it: | |
overwriteITFlags() | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FFService.main.$allowsSSON.setValue(true, providers: [LocalProvider.self]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct UserExperiments: FlagCollectionProtocol { | |
@FlagCollection(description: "A nested collection") | |
var secrets: SecretsExperiments | |
@Flag(key: "sson", default: false, description: "Enable Single-Sign-On") | |
var allowsSSON: Bool | |
} | |
struct SecretsExperiments: FlagCollectionProtocol { | |
@Flag(default: false, description: "Risky feature!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if FFService.user.$allowsSSON.flagValue(from: LocalProvider.self) { | |
// this is the value of local provider for this flag | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if FFService.main.user.allowsSSON { | |
// do something | |
} else { | |
// do something else | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FFService { | |
public let main = FFService() | |
public let user: FlagLoader<UserExperiments> | |
private init() { | |
let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]..appendingPathComponent("user_flags.xml")) | |
user = FlagsLoader(UserExperiments.self, | |
description: .init(name: "User Features", description: "Experimental lab"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct UserExperiments: FlagsCollectionProtocol { | |
@Flag(key: "sson", default: false, description: "Enable Single-Sign-On") | |
var allowsSSON: Bool | |
public init() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct UserExperiments: FlagsCollectionProtocol { | |
// .... | |
public init() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pod::Spec.new do |s| | |
s.name = "MyLib" | |
,,, | |
s.default_subspec = 'CHTMLSAXParser', 'Core' | |
s.subspec 'CHTMLSAXParser' do |ss| | |
ss.library = "CHTMLSAXParser" | |
ss.source_files = 'Sources/CHTMLSAXParser/**/*.{c}' | |
ss.public_header_files = "Sources/**/*.{h}" | |
ss.ios.deployment_target = '9.0' |