Skip to content

Commit c6e9e32

Browse files
committed
Push details controller
1 parent a5f311a commit c6e9e32

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

TestSwift/APIController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
// Copyright (c) 2014 JQ Software LLC. All rights reserved.
77
//
88

9-
import UIKit
9+
import Foundation
1010

1111
protocol APIControllerProtocol {
1212
func didRecieveAPIResults(results: NSDictionary)
1313
}
1414

15-
class APIController: NSObject {
15+
class APIController {
1616

1717
let data: NSMutableData = NSMutableData()
1818
var delegate: APIControllerProtocol?
1919

20+
init(){}
21+
2022
func searchItunesFor(searchTerm: String) {
2123

2224
// The iTunes API wants multiple terms separated by + symbols, so replace spaces with + signs

TestSwift/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
</objects>
6363
<point key="canvasLocation" x="434" y="183"/>
6464
</scene>
65-
<!--View Controller-->
65+
<!--Details View Controller-->
6666
<scene sceneID="Iya-oL-ejU">
6767
<objects>
68-
<viewController id="rSr-uw-pic" sceneMemberID="viewController">
68+
<viewController id="rSr-uw-pic" customClass="DetailsViewController" customModule="TestSwift" customModuleProvider="target" sceneMemberID="viewController">
6969
<layoutGuides>
7070
<viewControllerLayoutGuide type="top" id="smX-3l-Dxh"/>
7171
<viewControllerLayoutGuide type="bottom" id="RoX-md-gkS"/>

TestSwift/Classes/DetailsViewController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ import UIKit
1111
class DetailsViewController: UIViewController {
1212

1313
var detailInfo: NSDictionary?
14-
15-
init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
16-
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
17-
// Custom initialization
14+
15+
init(coder aDecoder: NSCoder!) {
16+
super.init(coder: aDecoder)
1817
}
19-
18+
2019
override func viewDidLoad() {
2120
super.viewDidLoad()
2221

TestSwift/SearchResultsViewController.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ class SearchResultsViewController: UIViewController,/* UITableViewDataSource, UI
2121

2222
override func viewDidLoad() {
2323
super.viewDidLoad()
24-
api.delegate = self
24+
self.api.delegate = self
2525
UIApplication.sharedApplication().networkActivityIndicatorVisible = true
2626
api.searchItunesFor("Bob Dylan");
2727
}
2828

2929
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject) {
30-
31-
30+
var detailsViewController: DetailsViewController = segue.destinationViewController as DetailsViewController
31+
}
32+
33+
/*
34+
3235
if segue.identifier == "Details" {
3336
//var detailsViewController: DetailsViewController? = segue.destinationViewController! as? DetailsViewController
3437

@@ -44,7 +47,7 @@ class SearchResultsViewController: UIViewController,/* UITableViewDataSource, UI
4447

4548
detailsViewController.detailInfo = selectedAppDetails*/
4649
}
47-
}
50+
}*/
4851

4952
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
5053
return albums.count

0 commit comments

Comments
 (0)