This file contains hidden or 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
/// Use this method to inject the configuration for this framework. | |
public func setup(with config: AnalyticsConfig.Type) { | |
ConfigType.shared = ConfigType(config) | |
} |
This file contains hidden or 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
var Config: ConfigType { // swiftlint:disable:this variable_name | |
if let config = ConfigType.shared { | |
return config | |
} else { | |
fatalError("Please set the Config for \(Bundle(for: ConfigType.self))") | |
} | |
} |
This file contains hidden or 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
extension Config: AnalyticsConfig, HomeConfig, BrowseConfig, SearchConfig { | |
static let appVersion = valueFromInfoPlist(forKey: "CFBundleShortVersionString") | |
} |
This file contains hidden or 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
Analytics.setup(with: Config.self) | |
Home.setup(with: Config.self) | |
Browse.setup(with: Config.self) | |
Search.setup(with: Config.self) |
This file contains hidden or 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
extension Config: AnalyticsConfig, HomeConfig, BrowseConfig, SearchConfig { | |
static let appVersion = valueFromInfoPlist(forKey: "CFBundleShortVersionString") | |
static let buildVersion = valueFromInfoPlist(forKey: "CFBundleVersion") | |
} |
This file contains hidden or 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
/// performs one time setup activities before running tests. Used as the Principal class in the test target's info.plist | |
class TestInitializer: NSObject { | |
override init() { | |
Analytics.setup(with: MockConfig.self) | |
} | |
} | |
private class MockConfig: AnalyticsConfig { | |
static let appVersion = "1.0" | |
static let buildVersion = "1234" |
This file contains hidden or 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
// | |
// Config.swift | |
// Analytics | |
// | |
public protocol AnalyticsConfig { | |
static var analyticsKey: String { get } | |
static var appVersion: String { get } | |
} |
This file contains hidden or 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
<FileRef | |
location = “group:Common/Common.xcodeproj”> | |
</FileRef> | |
<FileRef | |
location = “group:FunkySocial/FunkySocial.xcodeproj”> | |
</FileRef> |
This file contains hidden or 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
<FileRef | |
location = “group:FunkySocial/FunkySocial.xcodeproj”> | |
</FileRef> | |
<FileRef | |
location = “group:Common/Common.xcodeproj”> | |
</FileRef> |
This file contains hidden or 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
<Workspace | |
version = "1.0"> | |
<FileRef | |
location = “group:FunkySocial/FunkySocial.xcodeproj”> | |
</FileRef> | |
<Group | |
location = “container:” | |
name = “Features”> | |
<FileRef | |
location = “group:NewsFeed/NewsFeed.xcodeproj”> |