diff --git a/BlogSmart/BlogSmart.xcodeproj/project.pbxproj b/BlogSmart/BlogSmart.xcodeproj/project.pbxproj index 54b5f5f..5362dd6 100644 --- a/BlogSmart/BlogSmart.xcodeproj/project.pbxproj +++ b/BlogSmart/BlogSmart.xcodeproj/project.pbxproj @@ -22,7 +22,7 @@ AFA3139729FA22B4003719FE /* PostCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA3139629FA22B4003719FE /* PostCell.swift */; }; AFA3139929FA2A5B003719FE /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA3139829FA2A5B003719FE /* Post.swift */; }; AFAD94482A007BF900510528 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFAD94472A007BF900510528 /* DetailViewController.swift */; }; - AFF89DCF29FDB31300302838 /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = AFF89DCE29FDB31300302838 /* Keys.plist */; }; + AFFB8AD72A37CA1E00EBD49B /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = AFFB8AD62A37CA1E00EBD49B /* Keys.plist */; }; BA1BA4F129EA503A00E13CDC /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA1BA4F029EA503A00E13CDC /* LoginViewController.swift */; }; BA1BA4F429EA534100E13CDC /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA1BA4F329EA534100E13CDC /* User.swift */; }; BA1BA4F729EA571700E13CDC /* ViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA1BA4F629EA571700E13CDC /* ViewController+Extensions.swift */; }; @@ -44,7 +44,7 @@ AFA3139629FA22B4003719FE /* PostCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCell.swift; sourceTree = ""; }; AFA3139829FA2A5B003719FE /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = ""; }; AFAD94472A007BF900510528 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; - AFF89DCE29FDB31300302838 /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Keys.plist; sourceTree = ""; }; + AFFB8AD62A37CA1E00EBD49B /* Keys.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Keys.plist; sourceTree = ""; }; BA1BA4F029EA503A00E13CDC /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; BA1BA4F329EA534100E13CDC /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; BA1BA4F629EA571700E13CDC /* ViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+Extensions.swift"; sourceTree = ""; }; @@ -104,7 +104,7 @@ AF202F1129E889E800D18F2C /* Assets.xcassets */, AF202F1329E889E800D18F2C /* LaunchScreen.storyboard */, AF202F1629E889E800D18F2C /* Info.plist */, - AFF89DCE29FDB31300302838 /* Keys.plist */, + AFFB8AD62A37CA1E00EBD49B /* Keys.plist */, ); path = BlogSmart; sourceTree = ""; @@ -222,7 +222,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - AFF89DCF29FDB31300302838 /* Keys.plist in Resources */, + AFFB8AD72A37CA1E00EBD49B /* Keys.plist in Resources */, AF202F1529E889E800D18F2C /* LaunchScreen.storyboard in Resources */, AF202F1229E889E800D18F2C /* Assets.xcassets in Resources */, AF202F1029E889E600D18F2C /* Main.storyboard in Resources */, diff --git a/BlogSmart/BlogSmart.xcodeproj/project.xcworkspace/xcuserdata/raunaqmalhotra.xcuserdatad/UserInterfaceState.xcuserstate b/BlogSmart/BlogSmart.xcodeproj/project.xcworkspace/xcuserdata/raunaqmalhotra.xcuserdatad/UserInterfaceState.xcuserstate index af3a240..1636f7a 100644 Binary files a/BlogSmart/BlogSmart.xcodeproj/project.xcworkspace/xcuserdata/raunaqmalhotra.xcuserdatad/UserInterfaceState.xcuserstate and b/BlogSmart/BlogSmart.xcodeproj/project.xcworkspace/xcuserdata/raunaqmalhotra.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/BlogSmart/BlogSmart/Feed/ReadViewController.swift b/BlogSmart/BlogSmart/Feed/ReadViewController.swift index fa0d275..927574a 100644 --- a/BlogSmart/BlogSmart/Feed/ReadViewController.swift +++ b/BlogSmart/BlogSmart/Feed/ReadViewController.swift @@ -56,11 +56,15 @@ class ReadViewController: UIViewController { // Get the index path of the cell from the table view let indexPath = blogTable.indexPath(for: cell), // Get the detail view controller - let detailViewController = segue.destination as? DetailViewController { - + let detailViewController = segue.destination as? DetailViewController + { + // Use the index path to get the associated post - let post = posts[indexPath.row] - + var post = posts[indexPath.row] + if searching { + post = searchedPosts[indexPath.row] + } + // Set the post content on the detail view controller detailViewController.post = post }