A look at devxoul/Umbrella: 615 stars on GitHub, written primarily in Swift, tracked under the Data category. ☂️ Analytics abstraction layer for Swift
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Analytics abstraction layer for Swift. Inspired by Moya.
Table of Contents
Why?
Features
At a Glance
Getting Started
Defining Events
Using Analytics
Built-in Providers
Creating Custom Providers
Installation
Contributing
Generating Xcode Workspace
Creating New Provider
License
Why?
There are many tools for mobile app analytics such as Firebase, Google Analytics, Fabric Answers, Flurry, Mixpanel, etc. You might use one or more of those in your application. But most of those SDKs have some problems: if you use multiple analytics tools, your code will be messed up. And the SDKs take event name as a string and parameters as a dictionary which is not guaranteed by Swift compiler. It means that if you change the event definition, you should find all related code by your hand. It has an opportunity that cause a human error. Umbrella uses Swift enums and the associated values to solve these problems.
Features
💪 Taking advantages of Swift compiler by using an enum and associated values.
🎯 Logging events to multiple analytics providers at once.
First of all, you should define all of your events in a single enum. Let's assume that we have three events that have associated parameters.
enum MyAppEvent {
case signup(username: String)
case viewContent(productID: Int)
case purchase(productID: Int, price: Float)
}
Then make the enum to conform the protocol EventType. It requires two functions: name(for:) and parameters(for:).
extension MyAppEvent: EventType {
/// An event name to be logged
func name(for provider: ProviderType) -> String? {
switch self {
case .signup: return "signup"
case .viewContent: return "view_content"
case .purchase: return "purchase"
}
}
/// Parameters to be logged
func parameters(for provider: ProviderType) -> [String: Any]? {
switch self {
case let .signup(username):
return ["username": username]
case let .viewContent(productID):
return ["product_id": productID]
case let .purchase(productID, price):
return ["product_id": productID, "price": price]
}
}
}
You can even provide different event names and parameters by providers.
Using Analytics
You can define an Analytics instance anywhere but it's recommended to define at a global scope.
let analytics = Analytics<MyAppEvent>()
Then you should register providers. A prodiver is a wrapper for an actual analytics service such as Firebase and Fabric Answers. It's recommended to register providers in application(_:didFinishLaunchingWithOptions:).
If you finished those steps, you can now log the events 🎉
analytics.log(.signup(username: "devxoul"))
Built-in Providers
There are several built-in providers.
AmplitudeProvider (Amplitude-iOS)
AnswersProvider (Answers)
AppboyProvider (Appboy-iOS-SDK)
AppsFlyerProvider (AppsFlyerFramework)
FacebookProvider (FBSDKCoreKit)
FirebaseProvider (Firebase/Analytics)
FlurryProvider (Flurry-iOS-SDK/FabricSDK)
IntercomProvider (Intercom)
LocalyticsProvider (Localytics)
MixpanelProvider (Mixpanel)
SegmentProvider (Analytics)
If there's no provider you're looking for, you can create an issue or create custom providers. It's also welcomed to create a pull request for missing services 🎉
Creating Custom Providers
If there's no built-in provider for the serivce you're using, you can also create your own. It's easy to create a provider: just create a class and conform to the protocol ProviderType.
final class MyAwesomeProvider: ProviderType {
func log(_ eventName: String, parameters: [String: Any]?) {
AwesomeAnalytics.logEvent(withName: eventName, parameters: parameters)
}
}
Installation
Umbrella currently support CocoaPods only.
pod 'Umbrella'
pod 'Umbrella/Firebase' # using with built-in FirebaseProvider
pod 'Umbrella/...'
Contributing
Any discussions and pull requests are welcomed 💖
Generating Xcode Workspace
$ make project
This will automatically generate Umbrella.xcworkspace and perform pod install.
Creating New Provider
For example, imagine that we are going to create a new provider for an analytics service 'Raincoat'.
Add a library and a target definition in Package.swift.
target 'UmbrellaFirebaseTests' do
platform :ios, '8.0'
pod 'Firebase/Analytics'
end
target 'UmbrellaMixpanelTests' do
platform :ios, '8.0'
pod 'Mixpanel'
end
+ target 'UmbrellaRaincoatTests' do
+ platform :ios, '8.0'
+ pod 'Raincoat'
+ end
Add a CocoaPods subspec in Umbrella.podspec.
s.subspec "Firebase" do |ss|
ss.source_files = "Sources/UmbrellaFirebase/*.swift"
ss.dependency "Umbrella/Core"
end
s.subspec "Mixpanel" do |ss|
ss.source_files = "Sources/UmbrellaMixpanel/*.swift"
ss.dependency "Umbrella/Core"
end
+ s.subspec "Raincoat" do |ss|
+ ss.source_files = "Sources/UmbrellaRaincoat/*.swift"
+ ss.dependency "Umbrella/Core"
+ end
Create a Xcode workspace and run tests. Don't forget to check the code coverage to ensure that tests can cover the new provider.
$ make project
License
Umbrella is under MIT license. See the LICENSE file for more info.
No homepage URL was recorded for devxoul/Umbrella in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How does devxoul/Umbrella compare to other Data projects?
devxoul/Umbrella is tracked by TopGit in the Data category, with 615 GitHub stars and written in Swift. Browse the Data topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does devxoul/Umbrella have?
devxoul/Umbrella has 615 GitHub stars — refresh the page for the live number, or check github.com/devxoul/Umbrella. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is devxoul/Umbrella open source?
Yes — devxoul/Umbrella ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/devxoul/Umbrella.
What else is in the Data space?
devxoul/Umbrella is tracked by TopGit under the Data category, alongside 2 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is devxoul/Umbrella?
devxoul/Umbrella (devxoul/Umbrella) is a Swift project on GitHub. From the project's own README: ☂️ Analytics abstraction layer for Swift
Where do I read more about devxoul/Umbrella?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/devxoul/Umbrella is the definitive source.
Read full README in the tab above.
Curious whether Umbrella is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about Umbrella.