-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathShoe.swift
94 lines (59 loc) · 3.63 KB
/
Shoe.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// Shoe.swift
// Ecommerce
//
// Created by Eric Rosas on 2/13/17.
// Copyright © 2017 EmpireAppDesignz. All rights reserved.
//
import UIKit
class Shoe
{
var uid: String?
var name: String?
var images: [UIImage]?
var price: Double?
var description: String?
var detail: String?
init(uid: String, name: String, images: [UIImage], price: Double, description: String, detail: String)
{
self.uid = uid
self.name = name
self.images = images
self.price = price
self.description = description
self.detail = detail
}
class func fetchShoes() -> [Shoe]
{
var shoes = [Shoe]()
// 1
var shoe1Images = [UIImage]()
for i in 1...8 {
shoe1Images.append(UIImage(named: "s\(i)")!)
}
let shoe1 = Shoe(uid: "875942-100", name: "NIKE AIR MAX 1 ULTRA 2.0 FLYKNIT", images: shoe1Images, price: 180, description: "LIGHTER THAN EVER! The Nike Air Max 1 Ultra 2.0 Flyknit Men's Shoe updates the iconic original with an ultra-lightweight upper while keeping the plush, time-tested Max Air cushioning.", detail: "LIGHTER THAN EVER! The Nike Air Max 1 Ultra 2.0 Flyknit Men's Shoe updates the iconic original with an ultra-lightweight upper while keeping the plush, time-tested Max Air cushioning.")
shoes.append(shoe1)
// 2
var shoe2Images = [UIImage]()
for i in 1...7 {
shoe2Images.append(UIImage(named: "t\(i)")!)
}
let shoe2 = Shoe(uid: "880843-003", name: "NIKE FREE RN FLYKNIT 2017", images: shoe2Images, price: 120, description: "The Nike Free RN Flyknit 2017 Men's Running Shoe brings you miles of comfort with an exceptionally flexible outsole for the ultimate natural ride. Flyknit fabric wraps your foot for a snug, supportive fit while a tri-star outsole expands and flexes to let your foot move naturally.", detail: "The Nike Free RN Flyknit 2017 Men's Running Shoe brings you miles of comfort with an exceptionally flexible outsole for the ultimate natural ride. Flyknit fabric wraps your foot for a snug, supportive fit while a tri-star outsole expands and flexes to let your foot move naturally.")
shoes.append(shoe2)
// 3
var shoe3Images = [UIImage]()
for i in 1...6 {
shoe3Images.append(UIImage(named: "j\(i)")!)
}
let shoe3 = Shoe(uid: "384664-113", name: "AIR JORDAN 6 RETRO", images: shoe3Images, price: 190, description: "The Air Jordan 6 Retro Men's Shoe celebrates a championship heritage with design lines and plush cushioning inspired by the ground-breaking hoops original.", detail: "The Air Jordan 6 Retro Men's Shoe celebrates a championship heritage with design lines and plush cushioning inspired by the ground-breaking hoops original.")
shoes.append(shoe3)
// 4
var shoe4Images = [UIImage]()
for i in 1...6 {
shoe4Images.append(UIImage(named: "f\(i)")!)
}
let shoe4 = Shoe(uid: "805144-852", name: "TECH FLEECE WINDRUNNER", images: shoe4Images, price: 130, description: "The Nike Sportswear Tech Fleece Windrunner Men's Hoodie is redesigned for cooler weather with smooth, engineered fleece that offers lightweight warmth. Bonded seams lend a modern update to the classic chevron design.", detail: "The Nike Sportswear Tech Fleece Windrunner Men's Hoodie is redesigned for cooler weather with smooth, engineered fleece that offers lightweight warmth. Bonded seams lend a modern update to the classic chevron design.")
shoes.append(shoe4)
return shoes
}
}