This repository was archived by the owner on Sep 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,16 @@ extension StatsAllTimesInsight: StatsInsightData {
2525 public init ? ( jsonDictionary: [ String : AnyObject ] ) {
2626 guard
2727 let statsDict = jsonDictionary [ " stats " ] as? [ String : AnyObject ] ,
28- let postsCount = statsDict [ " posts " ] as? Int ,
29- let viewsCount = statsDict [ " views " ] as? Int ,
30- let visitorsCount = statsDict [ " visitors " ] as? Int ,
31- let bestViewsPerDayCount = statsDict [ " views_best_day_total " ] as? Int ,
3228 let bestViewsDayString = statsDict [ " views_best_day " ] as? String ,
3329 let bestViewsDay = StatsAllTimesInsight . dateFormatter. date ( from: bestViewsDayString)
3430 else {
3531 return nil
3632 }
3733
38- self . postsCount = postsCount
39- self . bestViewsPerDayCount = bestViewsPerDayCount
40- self . visitorsCount = visitorsCount
41- self . viewsCount = viewsCount
34+ self . postsCount = statsDict [ " posts " ] as? Int ?? 0
35+ self . bestViewsPerDayCount = statsDict [ " views_best_day_total " ] as? Int ?? 0
36+ self . visitorsCount = statsDict [ " visitors " ] as? Int ?? 0
37+ self . viewsCount = statsDict [ " views " ] as? Int ?? 0
4238 self . bestViewsDay = bestViewsDay
4339 }
4440
You can’t perform that action at this time.
0 commit comments