Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
1f1e9901
Commit
1f1e9901
authored
May 21, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed Analytics class to AppAnalytics. Added fade in animation to splash screen.
parent
2063a98a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
17 deletions
+38
-17
1Weather.xcodeproj/project.pbxproj
+4
-4
1Weather/Analytics/AnalyticsGlobal.swift
+1
-1
1Weather/Analytics/AppAnalytics.swift
+3
-3
1Weather/Common/Logger.swift
+4
-0
1Weather/Coordinators/AppCoordinator.swift
+0
-5
1Weather/Model/CCPA/CCPAHelper.swift
+3
-2
1Weather/Model/LocationManager.swift
+1
-2
1Weather/UI/View controllers/SplashAnimation/SplashAnimationViewController.swift
+22
-0
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
1f1e9901
...
@@ -286,7 +286,7 @@
...
@@ -286,7 +286,7 @@
CEF9596C2600C32E00975FAA
/* AnalyticsEvent.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
;
};
CEF9596C2600C32E00975FAA
/* AnalyticsEvent.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
;
};
CEF959742600C3A400975FAA
/* FlurryAnalyticsService.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959732600C3A400975FAA
/* FlurryAnalyticsService.swift */
;
};
CEF959742600C3A400975FAA
/* FlurryAnalyticsService.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959732600C3A400975FAA
/* FlurryAnalyticsService.swift */
;
};
CEF959902600C5A800975FAA
/* MoEngageAnalyticsService.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF9598F2600C5A800975FAA
/* MoEngageAnalyticsService.swift */
;
};
CEF959902600C5A800975FAA
/* MoEngageAnalyticsService.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF9598F2600C5A800975FAA
/* MoEngageAnalyticsService.swift */
;
};
CEF959932600C63500975FAA
/* A
nalytics.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959922600C63500975FAA
/*
Analytics.swift */
;
};
CEF959932600C63500975FAA
/* A
ppAnalytics.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959922600C63500975FAA
/* App
Analytics.swift */
;
};
CEF959982600C88100975FAA
/* AnalyticsParameter.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
;
};
CEF959982600C88100975FAA
/* AnalyticsParameter.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
;
};
CEF959A626035A2600975FAA
/* DeviceLocationMonitor.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959A526035A2600975FAA
/* DeviceLocationMonitor.swift */
;
};
CEF959A626035A2600975FAA
/* DeviceLocationMonitor.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEF959A526035A2600975FAA
/* DeviceLocationMonitor.swift */
;
};
CEFB857226174F7A00C5CDD2
/* Storage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEFB857126174F7A00C5CDD2
/* Storage.swift */
;
};
CEFB857226174F7A00C5CDD2
/* Storage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEFB857126174F7A00C5CDD2
/* Storage.swift */
;
};
...
@@ -623,7 +623,7 @@
...
@@ -623,7 +623,7 @@
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AnalyticsEvent.swift
;
sourceTree
=
"<group>"
;
};
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AnalyticsEvent.swift
;
sourceTree
=
"<group>"
;
};
CEF959732600C3A400975FAA
/* FlurryAnalyticsService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FlurryAnalyticsService.swift
;
sourceTree
=
"<group>"
;
};
CEF959732600C3A400975FAA
/* FlurryAnalyticsService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FlurryAnalyticsService.swift
;
sourceTree
=
"<group>"
;
};
CEF9598F2600C5A800975FAA
/* MoEngageAnalyticsService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MoEngageAnalyticsService.swift
;
sourceTree
=
"<group>"
;
};
CEF9598F2600C5A800975FAA
/* MoEngageAnalyticsService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MoEngageAnalyticsService.swift
;
sourceTree
=
"<group>"
;
};
CEF959922600C63500975FAA
/* A
nalytics.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Analytics.swift
;
sourceTree
=
"<group>"
;
};
CEF959922600C63500975FAA
/* A
ppAnalytics.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
App
Analytics.swift
;
sourceTree
=
"<group>"
;
};
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AnalyticsParameter.swift
;
sourceTree
=
"<group>"
;
};
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AnalyticsParameter.swift
;
sourceTree
=
"<group>"
;
};
CEF959A526035A2600975FAA
/* DeviceLocationMonitor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DeviceLocationMonitor.swift
;
sourceTree
=
"<group>"
;
};
CEF959A526035A2600975FAA
/* DeviceLocationMonitor.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DeviceLocationMonitor.swift
;
sourceTree
=
"<group>"
;
};
CEFB857126174F7A00C5CDD2
/* Storage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Storage.swift
;
sourceTree
=
"<group>"
;
};
CEFB857126174F7A00C5CDD2
/* Storage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Storage.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -1611,7 +1611,7 @@
...
@@ -1611,7 +1611,7 @@
CEF959682600C30500975FAA
/* AnalyticsGlobal.swift */
,
CEF959682600C30500975FAA
/* AnalyticsGlobal.swift */
,
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
,
CEF9596B2600C32E00975FAA
/* AnalyticsEvent.swift */
,
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
,
CEF959972600C88100975FAA
/* AnalyticsParameter.swift */
,
CEF959922600C63500975FAA
/* Analytics.swift */
,
CEF959922600C63500975FAA
/* A
ppA
nalytics.swift */
,
CEF959952600C84D00975FAA
/* Services */
,
CEF959952600C84D00975FAA
/* Services */
,
);
);
path
=
Analytics
;
path
=
Analytics
;
...
@@ -2163,7 +2163,7 @@
...
@@ -2163,7 +2163,7 @@
CEE0A1A226317A3F0044C257
/* NWSSeverityLevel.swift in Sources */
,
CEE0A1A226317A3F0044C257
/* NWSSeverityLevel.swift in Sources */
,
CD86246525E66E8A0097F3FB
/* PrecipitationCell.swift in Sources */
,
CD86246525E66E8A0097F3FB
/* PrecipitationCell.swift in Sources */
,
CD80917B2578E4A8003541A4
/* UIViewController+Alert.swift in Sources */
,
CD80917B2578E4A8003541A4
/* UIViewController+Alert.swift in Sources */
,
CEF959932600C63500975FAA
/* Analytics.swift in Sources */
,
CEF959932600C63500975FAA
/* A
ppA
nalytics.swift in Sources */
,
CEE0A1A426317A8F0044C257
/* NWSAlertInfoParser.swift in Sources */
,
CEE0A1A426317A8F0044C257
/* NWSAlertInfoParser.swift in Sources */
,
CEBAC1C62638236D00A89681
/* PushNotificationsManager.swift in Sources */
,
CEBAC1C62638236D00A89681
/* PushNotificationsManager.swift in Sources */
,
CE13B821262480B3007CBD4D
/* Scheduler.swift in Sources */
,
CE13B821262480B3007CBD4D
/* Scheduler.swift in Sources */
,
...
...
1Weather/Analytics/AnalyticsGlobal.swift
View file @
1f1e9901
...
@@ -8,5 +8,5 @@
...
@@ -8,5 +8,5 @@
import
Foundation
import
Foundation
public
func
analytics
(
log
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?
=
nil
)
{
public
func
analytics
(
log
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?
=
nil
)
{
Analytics
.
shared
.
log
(
event
:
event
,
params
:
params
)
A
ppA
nalytics
.
shared
.
log
(
event
:
event
,
params
:
params
)
}
}
1Weather/Analytics/Analytics.swift
→
1Weather/Analytics/A
ppA
nalytics.swift
View file @
1f1e9901
//
//
// Analytics.swift
// A
ppA
nalytics.swift
// 1Weather
// 1Weather
//
//
// Created by Demid Merzlyakov on 16.03.2021.
// Created by Demid Merzlyakov on 16.03.2021.
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
Foundation
import
Foundation
public
class
Analytics
{
public
class
A
ppA
nalytics
{
private
let
services
:
[
AnalyticsService
]
private
let
services
:
[
AnalyticsService
]
private
let
log
=
Logger
(
componentName
:
"⬜ Analytics"
)
private
let
log
=
Logger
(
componentName
:
"⬜ Analytics"
)
...
@@ -15,7 +15,7 @@ public class Analytics {
...
@@ -15,7 +15,7 @@ public class Analytics {
self
.
services
=
services
self
.
services
=
services
}
}
public
static
let
shared
=
Analytics
(
services
:
[
FlurryAnalyticsService
(),
MoEngageAnalyticsService
(),
AppsFlyerAnalyticsService
()])
public
static
let
shared
=
A
ppA
nalytics
(
services
:
[
FlurryAnalyticsService
(),
MoEngageAnalyticsService
(),
AppsFlyerAnalyticsService
()])
public
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?
=
nil
)
{
public
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?
=
nil
)
{
var
loggedTo
=
[
String
]()
var
loggedTo
=
[
String
]()
...
...
1Weather/Common/Logger.swift
View file @
1f1e9901
...
@@ -36,7 +36,11 @@ final class Logger {
...
@@ -36,7 +36,11 @@ final class Logger {
guard
level
.
rawValue
>=
minLogLevel
.
rawValue
else
{
guard
level
.
rawValue
>=
minLogLevel
.
rawValue
else
{
return
return
}
}
onMain
{
Crashlytics
.
crashlytics
()
.
log
(
message
)
Crashlytics
.
crashlytics
()
.
log
(
message
)
}
let
prefix
=
"
\(
Logger
.
prefix
)
\(
componentName
)
[
\(
logLevelString
(
level
:
level
)
)
]"
let
prefix
=
"
\(
Logger
.
prefix
)
\(
componentName
)
[
\(
logLevelString
(
level
:
level
)
)
]"
if
message
.
count
<
maxCharsPerMessage
{
if
message
.
count
<
maxCharsPerMessage
{
NSLog
(
"
\(
prefix
)
:
\(
message
)
"
)
NSLog
(
"
\(
prefix
)
:
\(
message
)
"
)
...
...
1Weather/Coordinators/AppCoordinator.swift
View file @
1f1e9901
...
@@ -44,13 +44,8 @@ class AppCoordinator: Coordinator {
...
@@ -44,13 +44,8 @@ class AppCoordinator: Coordinator {
tabBarController
.
setupTabBar
()
tabBarController
.
setupTabBar
()
if
Settings
.
shared
.
locationDidAdded
{
window
.
rootViewController
=
tabBarController
}
else
{
let
animationController
=
SplashAnimationViewController
(
appCoordinator
:
self
)
let
animationController
=
SplashAnimationViewController
(
appCoordinator
:
self
)
window
.
rootViewController
=
animationController
window
.
rootViewController
=
animationController
}
self
.
window
.
makeKeyAndVisible
()
self
.
window
.
makeKeyAndVisible
()
}
}
...
...
1Weather/Model/CCPA/CCPAHelper.swift
View file @
1f1e9901
...
@@ -13,6 +13,7 @@ import IASDKCore
...
@@ -13,6 +13,7 @@ import IASDKCore
import
MoEngage
import
MoEngage
import
Flurry_iOS_SDK
import
Flurry_iOS_SDK
import
Firebase
import
Firebase
import
FirebaseCoreDiagnostics
import
CommonCrypto
import
CommonCrypto
import
CryptoKit
import
CryptoKit
import
FBAudienceNetwork
import
FBAudienceNetwork
...
@@ -148,8 +149,8 @@ class CCPAHelper {
...
@@ -148,8 +149,8 @@ class CCPAHelper {
}
}
// Firebase
// Firebase
Firebase
.
Analytics
.
setUserProperty
(
canCollectData
?
"true"
:
"false"
,
forName
:
AnalyticsUserPropertyAllowAdPersonalizationSignals
)
Analytics
.
setUserProperty
(
canCollectData
?
"true"
:
"false"
,
forName
:
AnalyticsUserPropertyAllowAdPersonalizationSignals
)
Firebase
.
Analytics
.
setAnalyticsCollectionEnabled
(
canCollectData
)
Analytics
.
setAnalyticsCollectionEnabled
(
canCollectData
)
PSMLocation
.
sharedInstance
()
.
halted
=
!
canCollectData
PSMLocation
.
sharedInstance
()
.
halted
=
!
canCollectData
...
...
1Weather/Model/LocationManager.swift
View file @
1f1e9901
...
@@ -119,7 +119,7 @@ public class LocationManager {
...
@@ -119,7 +119,7 @@ public class LocationManager {
return
_selectedLocationIndex
return
_selectedLocationIndex
}
}
set
{
set
{
if
!
Settings
.
shared
.
locationDidAdded
{
if
!
Settings
.
shared
.
locationDidAdded
&&
newValue
!=
nil
{
Settings
.
shared
.
locationDidAdded
=
true
Settings
.
shared
.
locationDidAdded
=
true
}
}
_selectedLocationIndex
=
newValue
_selectedLocationIndex
=
newValue
...
@@ -268,7 +268,6 @@ public class LocationManager {
...
@@ -268,7 +268,6 @@ public class LocationManager {
guard
let
legacyLocations
=
legacyLocations
else
{
guard
let
legacyLocations
=
legacyLocations
else
{
storageLoadingCompletion
(
locations
,
selectedIndex
,
error
)
storageLoadingCompletion
(
locations
,
selectedIndex
,
error
)
fatalError
(
"Should never happen. Either legacyLocations or migrationError must be not nil"
)
fatalError
(
"Should never happen. Either legacyLocations or migrationError must be not nil"
)
return
}
}
for
location
:
PartialLocation
in
legacyLocations
{
for
location
:
PartialLocation
in
legacyLocations
{
...
...
1Weather/UI/View controllers/SplashAnimation/SplashAnimationViewController.swift
View file @
1f1e9901
...
@@ -48,10 +48,32 @@ class SplashAnimationViewController: UIViewController {
...
@@ -48,10 +48,32 @@ class SplashAnimationViewController: UIViewController {
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
super
.
viewDidAppear
(
animated
)
if
Settings
.
shared
.
locationDidAdded
{
cityAnimation
()
}
else
{
noCityAnimation
()
}
}
private
func
noCityAnimation
()
{
self
.
animationView
?
.
play
(
completion
:
{[
weak
self
]
_
in
self
.
animationView
?
.
play
(
completion
:
{[
weak
self
]
_
in
DispatchQueue
.
global
()
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
DispatchQueue
.
global
()
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
self
?
.
appCoordinator
.
finishAnimation
()
self
?
.
appCoordinator
.
finishAnimation
()
}
}
})
})
}
}
private
func
cityAnimation
()
{
self
.
animationView
?
.
alpha
=
0
self
.
animationView
?
.
currentProgress
=
1
UIView
.
animate
(
withDuration
:
0.5
)
{
self
.
animationView
?
.
alpha
=
1
}
completion
:
{
_
in
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.3
)
{
self
.
appCoordinator
.
finishAnimation
()
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment