Skip to content

Commit

Permalink
Search tag in same tab
Browse files Browse the repository at this point in the history
When the tags in PostDetailTableVC are clicked, the search result will
be shown on the current tab, instead of the search tab
  • Loading branch information
hkalexling committed Feb 23, 2016
1 parent ea90f02 commit 3c94d1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Binary file not shown.
14 changes: 7 additions & 7 deletions KonaBot/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<!--Search View Controller-->
<scene sceneID="Ndm-nv-xUQ">
<objects>
<viewController id="qX2-8t-910" customClass="SearchViewController" customModule="KonaBot" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="searchVC" id="qX2-8t-910" customClass="SearchViewController" customModule="KonaBot" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="vQ7-aI-Pnx"/>
<viewControllerLayoutGuide type="bottom" id="TVM-YQ-Ml5"/>
Expand Down Expand Up @@ -256,7 +256,7 @@
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="xhV-l8-jZM" id="7z2-dg-8cf">
<rect key="frame" x="0.0" y="0.0" width="567" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="567" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Mw-tV-uwd">
Expand All @@ -280,7 +280,7 @@
<rect key="frame" x="0.0" y="136" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8Ji-7Y-hPc" id="LOM-7X-YEX">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LVA-Ah-IWO">
Expand All @@ -305,7 +305,7 @@
<rect key="frame" x="0.0" y="180" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Mpo-Bp-Wud" id="8iE-iK-B0C">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cnZ-ns-f5p">
Expand Down Expand Up @@ -338,7 +338,7 @@
<rect key="frame" x="0.0" y="224" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9rF-EQ-N4T" id="9qg-Vo-658">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="5SD-97-huZ">
Expand Down Expand Up @@ -410,7 +410,7 @@
<rect key="frame" x="0.0" y="28" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="pJx-RT-cYV" id="YAe-CU-Zwh">
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E4l-ky-JZZ">
Expand Down Expand Up @@ -482,6 +482,6 @@
<image name="Home" width="30" height="30"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="gzH-KP-3rh"/>
<segue reference="7iG-pN-Fav"/>
</inferredMetricsTieBreakers>
</document>
6 changes: 0 additions & 6 deletions KonaBot/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ class SearchViewController: UIViewController, UISearchBarDelegate, KonaAPITagDel
var searchText = self.searchBar.text!
searchText = self.prepareSearchKeyword(searchText)
if (!searchText.isEmpty){
/*
if (searchText == "r18"){
self.toggleR18()
return
}
*/
self.keyword = searchText
self.handleSearch()
}
Expand Down
6 changes: 6 additions & 0 deletions PostDetailTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,17 @@ class PostDetailTableViewController: UITableViewController, TagViewDelegate {
}

func tagViewDidSelecteTag(tag: String?) {
let searchVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("searchVC") as! SearchViewController
self.parentVC.navigationController!.pushViewController(searchVC, animated: true)
searchVC.searchBar.text = tag
searchVC.searchBarSearchButtonClicked(searchVC.searchBar)
/*
self.parentVC.tabBarController?.selectedIndex = 1
let navigationVC = self.parentVC.tabBarController?.selectedViewController as! UINavigationController
navigationVC.popToRootViewControllerAnimated(false)
let searchVC = navigationVC.topViewController as! SearchViewController
searchVC.searchBar.text = tag
searchVC.searchBarSearchButtonClicked(searchVC.searchBar)
*/
}
}

0 comments on commit 3c94d1b

Please sign in to comment.