Skip to content

Commit

Permalink
Merge pull request #195 from Sopt-Mongle/feature/#191
Browse files Browse the repository at this point in the history
[fix] 리프레쉬, 스크롤 위로
  • Loading branch information
seu11ee committed Nov 29, 2020
2 parents 2e583e7 + 9aaf2e3 commit b69830c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Mongle/Mongle/Resource/Storyboard/MyTab.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="6xl-pJ-Xyg" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1042.4000000000001" y="56.896551724137936"/>
<point key="canvasLocation" x="-657" y="-175"/>
</scene>
<!--My Tab SentenceVC-->
<scene sceneID="Gch-JJ-ymH">
Expand Down Expand Up @@ -326,10 +326,10 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="searchResultSentenceTVC" id="seG-tn-jv4" customClass="SearchResultSentenceTVC" customModule="Mongle" customModuleProvider="target">
<rect key="frame" x="0.0" y="148.33333587646484" width="375" height="121.33333587646484"/>
<rect key="frame" x="0.0" y="148.33333587646484" width="375" height="121.66666412353516"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="seG-tn-jv4" id="RNw-tD-tyf">
<rect key="frame" x="0.0" y="0.0" width="375" height="121.33333587646484"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="121.66666412353516"/>
<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="BcV-0r-6QI">
Expand All @@ -351,7 +351,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="maX-5S-sW2">
<rect key="frame" x="33" y="88" width="31" height="15.333333333333329"/>
<rect key="frame" x="33" y="88" width="31" height="15.666666666666671"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down
10 changes: 9 additions & 1 deletion Mongle/Mongle/Source/VCs/CuratorTabMainVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CuratorTabMainVC: UIViewController {
var keywordList:[String] = ["감성자극","동기부여","자기계발","깊은생각","독서기록","일상문장"]
var popularList:[CuratorRecommendData] = []
var themeList:[CuratorTabTheme] = []

let refreshControl = UIRefreshControl()
//MARK:- IBOutlet
@IBOutlet weak var naviView: UIView!
@IBOutlet weak var curatorTabTableView: UITableView!
Expand Down Expand Up @@ -51,6 +51,8 @@ class CuratorTabMainVC: UIViewController {

}
curatorTabTableView.contentInset.bottom = 60
curatorTabTableView.refreshControl = refreshControl
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)

}
override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -129,6 +131,12 @@ class CuratorTabMainVC: UIViewController {
func hideNaviShadow(){
naviView.layer.shadowOpacity = 0
}

@objc func refresh(){
setRecommendedCurator()
setThemeInCurator()
self.refreshControl.endRefreshing()
}

}
// MARK: - UITableViewDelegate
Expand Down
2 changes: 2 additions & 0 deletions Mongle/Mongle/Source/VCs/MyTabVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MyTabVC: UIViewController,UIGestureRecognizerDelegate {
let heightRatio: CGFloat = UIScreen.main.bounds.height/812
let widthRatio: CGFloat = UIScreen.main.bounds.width/375
let token = UserDefaults.standard.string(forKey: "token")
let refreshControl = UIRefreshControl()
//팝업뷰
let blurImageView = UIImageView().then{
$0.image = UIImage(named: "logoutPopupBg")
Expand Down Expand Up @@ -83,6 +84,7 @@ class MyTabVC: UIViewController,UIGestureRecognizerDelegate {
setMenu()
self.pageInstance?.setViewControllers([(self.pageInstance?.vcArr![0])!], direction: .forward, animated: false, completion: nil)
self.navigationController?.interactivePopGestureRecognizer?.delegate = self

}
override func viewWillDisappear(_ animated: Bool) {
observingList.forEach { $0.invalidate() }
Expand Down
5 changes: 5 additions & 0 deletions Mongle/Mongle/Source/VCs/UnderTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ extension UnderTabBarController: UITabBarControllerDelegate {

else {
self.curIndex = tabBarController.selectedIndex
if tabBarController.selectedIndex == 3{
if let vc = viewController as? CuratorTabMainVC{
vc.curatorTabTableView.setContentOffset(CGPoint(x: 0, y: 0), animated: true)
}
}
}
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
Expand Down

0 comments on commit b69830c

Please sign in to comment.