diff --git a/librx.xcodeproj/project.pbxproj b/librx.xcodeproj/project.pbxproj index b2bbb59..7ca4daf 100644 --- a/librx.xcodeproj/project.pbxproj +++ b/librx.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 452DC1231B6287E600847691 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 452DC1221B6287E600847691 /* Images.xcassets */; }; 452DC1261B6287E600847691 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 452DC1241B6287E600847691 /* LaunchScreen.xib */; }; 452DC1321B6287E600847691 /* librxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452DC1311B6287E600847691 /* librxTests.swift */; }; + 4545581E1B6F994200FB7839 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4545581D1B6F994200FB7839 /* DetailViewController.swift */; }; 45CF60111B67937000CA7F06 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 45CF60011B67929600CA7F06 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 45CF60431B67C3A400CA7F06 /* ContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45CF60421B67C3A400CA7F06 /* ContainerViewController.swift */; }; 45CF60481B67C3D900CA7F06 /* StorysTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45CF60471B67C3D900CA7F06 /* StorysTableViewController.swift */; }; @@ -108,6 +109,7 @@ 452DC12B1B6287E600847691 /* librxTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = librxTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 452DC1301B6287E600847691 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 452DC1311B6287E600847691 /* librxTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = librxTests.swift; sourceTree = ""; }; + 4545581D1B6F994200FB7839 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 45CF5FF71B67929600CA7F06 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = externals/Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; 45CF60421B67C3A400CA7F06 /* ContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerViewController.swift; sourceTree = ""; }; 45CF60471B67C3D900CA7F06 /* StorysTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorysTableViewController.swift; sourceTree = ""; }; @@ -212,6 +214,7 @@ 452DC11D1B6287E600847691 /* ViewController.swift */, 45CF60421B67C3A400CA7F06 /* ContainerViewController.swift */, 45CF60471B67C3D900CA7F06 /* StorysTableViewController.swift */, + 4545581D1B6F994200FB7839 /* DetailViewController.swift */, ); name = controllers; sourceTree = ""; @@ -421,6 +424,7 @@ 45CF60481B67C3D900CA7F06 /* StorysTableViewController.swift in Sources */, 452DC11C1B6287E600847691 /* librx.xcdatamodeld in Sources */, 451281D41B6F926500C59C6B /* CustomTableCell.swift in Sources */, + 4545581E1B6F994200FB7839 /* DetailViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/librx/Base.lproj/Main.storyboard b/librx/Base.lproj/Main.storyboard index 06bb0f8..a14469c 100644 --- a/librx/Base.lproj/Main.storyboard +++ b/librx/Base.lproj/Main.storyboard @@ -59,7 +59,7 @@ - + @@ -109,6 +109,7 @@ + @@ -120,7 +121,7 @@ - + @@ -220,6 +221,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/librx/DetailViewController.swift b/librx/DetailViewController.swift new file mode 100644 index 0000000..eb4376d --- /dev/null +++ b/librx/DetailViewController.swift @@ -0,0 +1,23 @@ +// +// DetailViewController.swift +// librx +// +// Created by Yunlong Zheng on 15/8/3. +// Copyright (c) 2015年 librx. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + @IBOutlet var storyImageView:UIImageView! + @IBOutlet var storyName:UILabel! + + var storyImage:String! + + override func viewDidLoad() { + + super.viewDidLoad() + self.storyImageView.image = UIImage(named: storyImage) + } +} diff --git a/librx/StorysTableViewController.swift b/librx/StorysTableViewController.swift index bf3b762..9f0939f 100644 --- a/librx/StorysTableViewController.swift +++ b/librx/StorysTableViewController.swift @@ -54,14 +54,25 @@ class StorysTableViewController: UITableViewController { cell.readNumLabel.text = "阅读1024" cell.commentNumLabel.text = "评论100" cell.shareNumLabel.text = "分享101" - - - // cell.textLabel!.text = storys[indexPath.row] -// cell.textLabel!.text = storys[indexPath.row] -// cell.imageView?.image = UIImage(named: storyImages[indexPath.row]) + return cell } + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + + if segue.identifier == "showStoryDetail" { + + if let indexPath = self.tableView.indexPathForSelectedRow(){ + + let destinationController = segue.destinationViewController as! DetailViewController + destinationController.storyImage = self.storyImages[indexPath.row] + + } + + } + + } }