forked from tvidenov/appstore-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeaturedApps.swift
33 lines (27 loc) · 892 Bytes
/
FeaturedApps.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// FeaturedApps.swift
// AppStore
//
// Created by Tihomir Videnov on 11/12/16.
// Copyright © 2016 Tihomir Videnov. All rights reserved.
//
import UIKit
class FeaturedApps: NSObject {
var bannerCategory: AppCategory?
var appCategories: [AppCategory]?
override func setValue(_ value: Any?, forKey key: String) {
if key == "categories" {
appCategories = [AppCategory]()
for dict in value as! [[String:Any]] {
let appCategory = AppCategory()
appCategory.setValuesForKeys(dict)
appCategories?.append(appCategory)
}
} else if key == "bannerCategory" {
bannerCategory = AppCategory()
bannerCategory?.setValuesForKeys(value as! [String:Any])
} else {
super.setValue(value, forKey: key)
}
}
}