Skip to content

Commit

Permalink
Merge pull request #206 from teamterning/#202
Browse files Browse the repository at this point in the history
[Setting] #202 - v1.0.1 ์—…๋ฐ์ดํŠธ
  • Loading branch information
thingineeer authored Oct 8, 2024
2 parents 666659e + 1a87b95 commit 640ad93
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 45 deletions.
8 changes: 4 additions & 4 deletions Terning-iOS/Terning-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2024.1002.0940;
CURRENT_PROJECT_VERSION = 2024.1006.1653;
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1739,7 +1739,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.0.1;
OTHER_LDFLAGS = (
"-Xlinker",
"-interposable",
Expand All @@ -1764,7 +1764,7 @@
CODE_SIGN_ENTITLEMENTS = "Terning-iOS/Terning-iOS.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2024.1002.0940;
CURRENT_PROJECT_VERSION = 2024.1006.1653;
DEVELOPMENT_TEAM = 8Q4H7X3Q58;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1779,7 +1779,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.terning.Terning-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 6 additions & 0 deletions Terning-iOS/Terning-iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>terning</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>2024.1006.1653</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>CFBundleURLTypes</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ extension ProfileViewModelType {
func characterCount(of string: String) -> Int {
return string.count
}

func containsSpecialCharacters(_ string: String) -> Bool {
let regex = "[\\p{S}\\p{C}]"
return string.range(of: regex, options: .regularExpression) != nil
}

func containsSymbols(_ string: String) -> Bool {
let regex = "[!@#$%^&*(),.?\":;'/{}\\[\\]|<>+=\\-_\\\\\\ \\โ€”โ€ฆโ€™โ€˜โ€™]"
let regex = "[!@#$%^&*(),.?\":;'/{}\\[\\]|<>+=\\-_\\\\โ€”โ€ฆโ€™โ€˜โ€™]"
return string.range(of: regex, options: .regularExpression) != nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ extension AccountOptionViewController {

extension AccountOptionViewController {
private func navigateToLoginVC() {
let LoginVC = UINavigationController(
rootViewController: LoginViewController(
viewModel: LoginViewModel(
loginRepository: LoginRepository(
loginService: LoginService()
)
let LoginVC = LoginViewController(
viewModel: LoginViewModel(
loginRepository: LoginRepository(
loginService: LoginService()
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RxCocoa
import RxSwift

final class ProfileViewModel: ProfileViewModelType {

// MARK: - Properties

private let authProvider = Providers.authProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ extension AdvertisementCollectionViewCell {

extension AdvertisementCollectionViewCell {
func bind(with advertisement: UIImage) {
advertisementImageView.image = advertisement
advertisementImageView.image = advertisement
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ final class SearchViewController: UIViewController {

// MARK: - UI Components

let searchView = SearchView()
let rootView = SearchView()

// MARK: - Init

init(viewModel: SearchViewModel) {
self.viewModel = viewModel

super.init(nibName: nil, bundle: nil)
}

Expand Down Expand Up @@ -63,10 +64,10 @@ final class SearchViewController: UIViewController {
extension SearchViewController {
private func setUI() {
view.backgroundColor = .white
view.addSubview(searchView)
view.addSubview(rootView)
}
private func setLayout() {
searchView.snp.makeConstraints {
rootView.snp.makeConstraints {
$0.edges.equalTo(view.safeAreaLayoutGuide)
}
}
Expand All @@ -76,15 +77,15 @@ extension SearchViewController {

extension SearchViewController {
private func setDelegate() {
searchView.collectionView.dataSource = self
searchView.collectionView.delegate = self
rootView.collectionView.dataSource = self
rootView.collectionView.delegate = self
}

private func setAddTarget() {
searchView.searchView.textField.isUserInteractionEnabled = false
rootView.searchView.textField.isUserInteractionEnabled = false
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleSearchViewTap))
searchView.searchView.addGestureRecognizer(tapGestureRecognizer)
searchView.pageControl.isUserInteractionEnabled = false
rootView.searchView.addGestureRecognizer(tapGestureRecognizer)
rootView.pageControl.isUserInteractionEnabled = false
}

private func startTimer() {
Expand Down Expand Up @@ -122,11 +123,11 @@ extension SearchViewController {

@objc
private func autoScroll() {
let currentPage = searchView.pageControl.currentPage
let nextPage = (currentPage + 1) % (searchView.advertisement?.advertisements?.count ?? 1)
let currentPage = rootView.pageControl.currentPage
let nextPage = (currentPage + 1) % (rootView.advertisement?.advertisements?.count ?? 1)
let indexPath = IndexPath(item: nextPage, section: RecomandType.advertisement.rawValue)
searchView.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
searchView.pageControl.currentPage = nextPage
rootView.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
rootView.pageControl.currentPage = nextPage
}
}

Expand All @@ -144,23 +145,23 @@ extension SearchViewController {

output.announcements
.drive(onNext: { [weak self] advertisements in
self?.searchView.advertisement = advertisements
self?.searchView.collectionView.reloadData()
self?.searchView.pageControl.numberOfPages = advertisements.advertisements?.count ?? 0
self?.rootView.advertisement = advertisements
self?.rootView.collectionView.reloadData()
self?.rootView.pageControl.numberOfPages = advertisements.advertisements?.count ?? 0
})
.disposed(by: disposeBag)

output.recommendedByViews
.drive(onNext: { [weak self] viewsNum in
self?.searchView.viewsNum = viewsNum
self?.searchView.collectionView.reloadData()
self?.rootView.viewsNum = viewsNum
self?.rootView.collectionView.reloadData()
})
.disposed(by: disposeBag)

output.recommendedByScraps
.drive(onNext: { [weak self] scrapsNum in
self?.searchView.scrapsNum = scrapsNum
self?.searchView.collectionView.reloadData()
self?.rootView.scrapsNum = scrapsNum
self?.rootView.collectionView.reloadData()
})
.disposed(by: disposeBag)

Expand All @@ -174,8 +175,8 @@ extension SearchViewController {
.drive(onNext: { [weak self] page in
guard let self = self else { return }
let indexPath = IndexPath(item: page, section: RecomandType.advertisement.rawValue)
self.searchView.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
self.searchView.pageControl.currentPage = page
self.rootView.collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
self.rootView.pageControl.currentPage = page
})
.disposed(by: disposeBag)
}
Expand All @@ -191,11 +192,11 @@ extension SearchViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
switch RecomandType(rawValue: section) {
case .advertisement:
return searchView.advertisement?.advertisements?.count ?? 0
return rootView.advertisement?.advertisements?.count ?? 0
case .viewsNum:
return searchView.viewsNum?.count ?? 0
return rootView.viewsNum?.count ?? 0
case .scrapsNum:
return searchView.scrapsNum?.count ?? 0
return rootView.scrapsNum?.count ?? 0
default:
return 0
}
Expand All @@ -205,21 +206,21 @@ extension SearchViewController: UICollectionViewDataSource {
switch RecomandType(rawValue: indexPath.section) {
case .advertisement:
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: AdvertisementCollectionViewCell.className, for: indexPath) as? AdvertisementCollectionViewCell,
let advertisements = searchView.advertisement?.advertisements else {
let advertisements = rootView.advertisement?.advertisements else {
return UICollectionViewCell()
}
cell.bind(with: advertisements[indexPath.row])
return cell
case .viewsNum:
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RecommendCollectionViewCell.className, for: indexPath) as? RecommendCollectionViewCell,
let viewsNum = searchView.viewsNum else {
let viewsNum = rootView.viewsNum else {
return UICollectionViewCell()
}
cell.bind(with: viewsNum[indexPath.row])
return cell
case .scrapsNum:
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RecommendCollectionViewCell.className, for: indexPath) as? RecommendCollectionViewCell,
let scrapsNum = searchView.scrapsNum else {
let scrapsNum = rootView.scrapsNum else {
return UICollectionViewCell()
}
cell.bind(with: scrapsNum[indexPath.row])
Expand Down Expand Up @@ -266,7 +267,7 @@ extension SearchViewController: UICollectionViewDelegate {
guard let url = URL(string: urlString) else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
case .viewsNum:
guard let viewsNum = searchView.viewsNum else { return }
guard let viewsNum = rootView.viewsNum else { return }

let selectedItem = viewsNum[indexPath.item].internshipAnnouncementId

Expand All @@ -283,7 +284,7 @@ extension SearchViewController: UICollectionViewDelegate {
jobDetailVC.internshipAnnouncementId.accept(selectedItem)
self.navigationController?.pushViewController(jobDetailVC, animated: true)
case .scrapsNum:
guard let scrapsNum = searchView.scrapsNum else { return }
guard let scrapsNum = rootView.scrapsNum else { return }

let selectedItem = scrapsNum[indexPath.item].internshipAnnouncementId

Expand All @@ -309,7 +310,7 @@ extension SearchViewController: UICollectionViewDelegate {
guard let sectionType = RecomandType(rawValue: indexPath.section) else { return }

if sectionType == .advertisement {
searchView.pageControl.currentPage = indexPath.item
rootView.pageControl.currentPage = indexPath.item
}

}
Expand Down

0 comments on commit 640ad93

Please sign in to comment.