Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-07-01 14:32:43 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4ab22c75b91d230ea34a07d7e9f58e67b6e4e375
4ab22c75
1 parent
fec87841
update Pacing Models
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
4ab22c7
...
...
@@ -2172,12 +2172,20 @@ public class swiftApi {
public
class
PacingDetails
{
private
var
steps
:
PacingInner
private
var
meters
:
Pacing
Details
Inner
private
var
meters
:
PacingInner
public
init
()
{
self
.
steps
=
PacingInner
()
self
.
meters
=
PacingDetailsInner
()
self
.
meters
=
PacingInner
()
}
public
init
(
dictionary
:
[
String
:
Any
])
{
let
pacingDataSteps
=
(
dictionary
[
"steps"
]
as?
[
String
:
Any
]
??
[
String
:
Any
]())
let
pacingDataMeters
=
(
dictionary
[
"meters"
]
as?
[
String
:
Any
]
??
[
String
:
Any
]())
self
.
steps
=
PacingInner
(
dictionary
:
pacingDataSteps
)
self
.
meters
=
PacingInner
(
dictionary
:
pacingDataMeters
)
}
public
var
_steps
:
PacingInner
{
...
...
@@ -2189,7 +2197,7 @@ public class swiftApi {
}
}
public
var
_meters
:
Pacing
Details
Inner
{
public
var
_meters
:
PacingInner
{
get
{
// getter
return
self
.
meters
}
...
...
@@ -2213,6 +2221,33 @@ public class swiftApi {
self
.
day
=
PacingDetailsInner
()
}
public
init
(
dictionary
:
[
String
:
Any
])
{
if
let
stepsTotal
=
dictionary
[
"total"
]
as?
[
String
:
Any
]
{
self
.
total
=
PacingDetailsInner
(
dictionary
:
stepsTotal
)
}
else
{
self
.
total
=
PacingDetailsInner
()
}
if
let
stepsMonth
=
dictionary
[
"month"
]
as?
[
String
:
Any
]
{
self
.
month
=
PacingDetailsInner
(
dictionary
:
stepsMonth
)
}
else
{
self
.
month
=
PacingDetailsInner
()
}
if
let
stepsWeek
=
dictionary
[
"week"
]
as?
[
String
:
Any
]
{
self
.
week
=
PacingDetailsInner
(
dictionary
:
stepsWeek
)
}
else
{
self
.
week
=
PacingDetailsInner
()
}
if
let
stepsDay
=
dictionary
[
"day"
]
as?
[
String
:
Any
]
{
self
.
day
=
PacingDetailsInner
(
dictionary
:
stepsDay
)
}
else
{
self
.
day
=
PacingDetailsInner
()
}
}
public
var
_total
:
PacingDetailsInner
{
get
{
// getter
return
self
.
total
...
...
@@ -2263,6 +2298,22 @@ public class swiftApi {
}
public
init
(
dictionary
:
[
String
:
Any
])
{
self
.
goal
=
dictionary
[
"goal"
]
as?
Float
??
0.0
self
.
value
=
dictionary
[
"value"
]
as?
Float
??
0.0
if
let
perDay
=
dictionary
[
"per_day"
]
as?
[[
String
:
Any
]]
{
var
tempPerDayArray
:
Array
<
PacingDetailsDay
>
=
[]
for
item
in
perDay
{
let
newPerDayItem
=
PacingDetailsDay
(
dictionary
:
item
)
tempPerDayArray
.
append
(
newPerDayItem
)
}
self
.
per_day
=
tempPerDayArray
}
else
{
self
.
per_day
=
[]
}
}
public
var
_goal
:
Float
{
get
{
// getter
return
self
.
goal
...
...
@@ -2299,7 +2350,11 @@ public class swiftApi {
public
init
()
{
self
.
day
=
""
self
.
value
=
0.0
}
public
init
(
dictionary
:
[
String
:
Any
])
{
self
.
day
=
dictionary
[
"day"
]
as?
String
??
""
self
.
value
=
dictionary
[
"value"
]
as?
Double
??
0.0
}
public
var
_day
:
String
{
...
...
@@ -2321,4 +2376,5 @@ public class swiftApi {
}
}
}
...
...
Please
register
or
login
to post a comment