Skip to content

Commit

Permalink
Merge pull request #167 from TeamBeMe/feature/#166
Browse files Browse the repository at this point in the history
Feature/#166
  • Loading branch information
samsung-ga authored Feb 9, 2021
2 parents b7c1294 + acb4fa3 commit 139469d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 38 deletions.
4 changes: 0 additions & 4 deletions BeMe/BeMe/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

remoteConfig.fetch(withExpirationDuration: TimeInterval(3600), completionHandler: { (status,error)-> Void in
if status == .success {
print("Config Fetched!")
remoteConfig.activate(completion: nil)

}
else{
print("errrrrrr")
}


})

return true
Expand Down
43 changes: 32 additions & 11 deletions BeMe/BeMe/Explore/VCs/ExploreHomeVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,11 @@ extension ExploreHomeVC: UITableViewDataSource {
} else if section == 1 {
return 1
} else {

if exploreAnswerArray.count == 0 {
return 1
} else {
if currentPage < page {
return exploreAnswerArray.count + 1
} else {
return exploreAnswerArray.count
}
return exploreAnswerArray.count
}

}
}

Expand Down Expand Up @@ -250,15 +244,15 @@ extension ExploreHomeVC: UITableViewDelegate {
if scrollDirection {
let rotationTransform = CATransform3DTranslate(CATransform3DIdentity, 0, 50, 0)
cell.layer.transform = rotationTransform
UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseInOut], animations: {
UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseInOut, .allowUserInteraction], animations: {
cell.layer.transform = CATransform3DIdentity
}) { (_) in

}
} else {
let rotationTransform = CATransform3DTranslate(CATransform3DIdentity, 0, -50, 0)
cell.layer.transform = rotationTransform
UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseInOut], animations: {
UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseInOut, .allowUserInteraction], animations: {
cell.layer.transform = CATransform3DIdentity
}) { (_) in

Expand Down Expand Up @@ -320,12 +314,39 @@ extension ExploreHomeVC: UIScrollViewDelegate {
}

lastContentOffset = currentOffset

for cell in exploreTableView.visibleCells {
if let indexPath = exploreTableView.indexPath(for: cell) {
if indexPath.row > 5 && indexPath.row >= exploreAnswerArray.count - 3 {
if page > currentPage {
moreButtonAction()
}
}
}
}

// for cell in exploreTableView.visibleCells {
// if let indexPath = wholeCollectionView.indexPath(for: cell){
// if indexPath.item > 5 && indexPath.item >= answers.count-3{
// if pageLen > answerPage{
// moreButtonAction()
// }
// }
//
// }
// }

}
}

//MARK: - Private Method
extension ExploreHomeVC {

private func moreButtonAction() {
currentPage += 1
setAnswerData(page: currentPage, category: selectedCategoryId, sorting: selectedRecentOrFavorite)
}

private func setThoughtData() {

ExploreThoughtService.shared.getExploreThought { (result) in
Expand Down Expand Up @@ -641,7 +662,7 @@ extension ExploreHomeVC: UITableViewButtonSelectedDelegate {
}

func goToTodayAnswerButtonDidTapped() {

ExploreWriteService.shared.getExploreWrite { (result) in
switch result {
case .success(let data):
Expand All @@ -665,7 +686,7 @@ extension ExploreHomeVC: UITableViewButtonSelectedDelegate {


answerVC.answerData = inputData

self.navigationController?.pushViewController(answerVC, animated: true)

}
Expand Down
3 changes: 1 addition & 2 deletions BeMe/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ pod 'Then'
pod 'lottie-ios'
pod 'SwiftyGif'
pod 'SwiftLint'
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
pod 'GoogleAnalytics'
pod 'Firebase/Analytics'

end
38 changes: 17 additions & 21 deletions BeMe/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PODS:
- Firebase/RemoteConfig (7.5.0):
- Firebase/CoreOnly
- FirebaseRemoteConfig (~> 7.5.0)
- FirebaseABTesting (7.5.0):
- FirebaseABTesting (7.6.0):
- FirebaseCore (~> 7.0)
- FirebaseAnalytics (7.5.0):
- FirebaseCore (~> 7.0)
Expand All @@ -25,12 +25,12 @@ PODS:
- FirebaseCoreDiagnostics (~> 7.4)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/Logger (~> 7.0)
- FirebaseCoreDiagnostics (7.5.0):
- FirebaseCoreDiagnostics (7.6.0):
- GoogleDataTransport (~> 8.0)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/Logger (~> 7.0)
- nanopb (~> 2.30907.0)
- FirebaseInstallations (7.5.0):
- FirebaseInstallations (7.6.0):
- FirebaseCore (~> 7.0)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/UserDefaults (~> 7.0)
Expand All @@ -41,7 +41,6 @@ PODS:
- FirebaseInstallations (~> 7.0)
- GoogleUtilities/Environment (~> 7.0)
- "GoogleUtilities/NSData+zlib (~> 7.0)"
- GoogleAnalytics (3.17.0)
- GoogleAppMeasurement (7.5.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
- GoogleUtilities/MethodSwizzler (~> 7.0)
Expand All @@ -50,24 +49,24 @@ PODS:
- nanopb (~> 2.30907.0)
- GoogleDataTransport (8.2.0):
- nanopb (~> 2.30907.0)
- GoogleUtilities/AppDelegateSwizzler (7.2.0):
- GoogleUtilities/AppDelegateSwizzler (7.2.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.2.0):
- GoogleUtilities/Environment (7.2.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (7.2.0):
- GoogleUtilities/Logger (7.2.2):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (7.2.0):
- GoogleUtilities/MethodSwizzler (7.2.2):
- GoogleUtilities/Logger
- GoogleUtilities/Network (7.2.0):
- GoogleUtilities/Network (7.2.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.2.0)"
- GoogleUtilities/Reachability (7.2.0):
- "GoogleUtilities/NSData+zlib (7.2.2)"
- GoogleUtilities/Reachability (7.2.2):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.2.0):
- GoogleUtilities/UserDefaults (7.2.2):
- GoogleUtilities/Logger
- Kingfisher (6.0.1)
- lottie-ios (3.1.9)
Expand All @@ -86,7 +85,6 @@ DEPENDENCIES:
- Alamofire
- Firebase/Analytics
- Firebase/RemoteConfig
- GoogleAnalytics
- Kingfisher
- lottie-ios
- SnapKit
Expand All @@ -104,7 +102,6 @@ SPEC REPOS:
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FirebaseRemoteConfig
- GoogleAnalytics
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleUtilities
Expand All @@ -120,16 +117,15 @@ SPEC REPOS:
SPEC CHECKSUMS:
Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c
Firebase: fd5e4d2b756292c6e7ee6faac1eb320225d6e97e
FirebaseABTesting: e419991eb6e92772b3c0a02fa3a675f59da692f1
FirebaseABTesting: 8d7f24fdf94cd10f06a84c879262a1159e22db28
FirebaseAnalytics: 00b7f74571d346ee1ffb9bf0a2e6f2ffff222bcc
FirebaseCore: 06a2b68af8901f2244eb989419eb89edc3789b4d
FirebaseCoreDiagnostics: 35685db68b11fe7d19d2d8b557fd7e3a56ac81cc
FirebaseInstallations: a46ae59915f0931e18814164849cd0354bea24ed
FirebaseCoreDiagnostics: ee1184d51da3293335b83355aad20f537acc24cf
FirebaseInstallations: 6e4e77396559bc2ae0504823837ed737b1c7e47f
FirebaseRemoteConfig: 98dac0952e07858dbd70ad0f26d470eb7fa37ee4
GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b
GoogleAppMeasurement: 65a1071e5f52f63ab03d0a4d814a54fd762d885a
GoogleDataTransport: 1024b1a4dfbd7a0e92cb20d7e0a6f1fb66b449a4
GoogleUtilities: d866834472f1324d080496bc67ab3ce5d0d46027
GoogleUtilities: 31c5b01f978a70c6cff2afc6272b3f1921614b43
Kingfisher: adde87a4f74f6a3845395769354efff593581740
lottie-ios: 3a3758ef5a008e762faec9c9d50a39842f26d124
nanopb: 59221d7f958fb711001e6a449489542d92ae113e
Expand All @@ -139,6 +135,6 @@ SPEC CHECKSUMS:
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
Then: acfe0be7e98221c6204e12f8161459606d5d822d

PODFILE CHECKSUM: 3fe7054b504654d7ca560626bf9e4dc15531fc68
PODFILE CHECKSUM: bbd394ecfdbab2e5befc59f8524778a9e7d660ae

COCOAPODS: 1.10.0
COCOAPODS: 1.10.1

0 comments on commit 139469d

Please sign in to comment.