Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import Foundation
// MARK: - Encodable Extension

extension Encodable {

func asParameter() throws -> [String: Any] {
let data = try JSONEncoder().encode(self)
guard let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
as? [String: Any] else {
throw NSError()
func asParameter() throws -> [String: Any] {
let data = try JSONEncoder().encode(self)
guard let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
as? [String: Any] else {
throw NSError()
}
return dictionary
}
return dictionary
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum GestureType {
return pinchGesture
case let .edge(edgePanGesture):
return edgePanGesture
}
}
}
}

Expand All @@ -43,9 +43,10 @@ extension UIGestureRecognizer {
self.view = view
self.gestureType = gestureType
}
func receive<S>(subscriber: S) where S : Subscriber,
GesturePublisher.Failure == S.Failure, GesturePublisher.Output
== S.Input {

func receive<S>(subscriber: S) where S: Subscriber,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확실히 줄바꿔주는게 낫네용!! 저도 앞으로 신경써서 작성해보겠습니다 👊🏻👊🏻

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고민 해보다가 변경 했는데 좋게 봐주셔서 감사합니다. 🫠

GesturePublisher.Failure == S.Failure,
GesturePublisher.Output == S.Input {
let subscription = GestureSubscription(
subscriber: subscriber,
view: view,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "ios 앱 배너-1.png",
"filename" : "ios 앱 배너.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ enum AlertType {
final class RNAlertVC: UIViewController {

// MARK: - Properties
var leftButtonTapAction: (()-> Void)?
var leftButtonTapAction: (() -> Void)?
var rightButtonTapAction: (() -> Void)?
var alertType: AlertType = .defaultType

// MARK: - UI Components

private let containerView = UIView().then {
Expand Down Expand Up @@ -99,8 +99,7 @@ extension RNAlertVC {

extension RNAlertVC {
@objc private func touchUpNoButton() {
alertType == .defaultType
? dismiss(animated: false) : self.leftButtonTapAction? ()
alertType == .defaultType ? dismiss(animated: false) : self.leftButtonTapAction?()
}

@objc private func touchYesButton() {
Expand All @@ -123,7 +122,7 @@ extension RNAlertVC {
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(30)
// make.height.equalTo(126)
// make.height.equalTo(126)
}

containerView.addSubviews(descriptionLabel, yesButton, noButton)
Expand Down
6 changes: 3 additions & 3 deletions Runnect-iOS/Runnect-iOS/Global/Utils/GesturePublisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum GestureType {
return pinchGesture
case let .edge(edgePanGesture):
return edgePanGesture
}
}
}
}

Expand All @@ -42,8 +42,8 @@ struct GesturePublisher: Publisher {
self.view = view
self.gestureType = gestureType
}
func receive<S>(subscriber: S) where S : Subscriber,
GesturePublisher.Failure == S.Failure, GesturePublisher.Output
func receive<S>(subscriber: S) where S: Subscriber,
GesturePublisher.Failure == S.Failure, GesturePublisher.Output
== S.Input {
let subscription = GestureSubscription(
subscriber: subscriber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

import Foundation


struct CourseDetailScrapCountDto: Codable {
let scrapCount: Int

let publicCourse: Int?
let scarpTF: Bool?
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct CourseDrawingRequestDto: Codable {
let departureAddress, departureName: String
}

//"image" : 이미지 파일,
// "image" : 이미지 파일,
// "path" : [{lat : 실수(double), long : 실수},{lat : 실수(double), long : 실수},{lat : 실수(double), long : 실수} ],
// "title" : "한강 공원 한 바퀴",
// "distance" : 4.4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ extension DepartureSearchingRouter: TargetType {
case .getLocationAddress(let latitude, let longitude):
return .requestParameters(parameters: ["x": longitude, "y": latitude], encoding: URLEncoding.default)
case .getLocationTmapAddress(let latitude, let longitude):
return .requestParameters(parameters: ["lat": latitude, "lon":longitude, "addressType": "A04","appKey": Config.tmapAPIKey], encoding: URLEncoding.default)
return .requestParameters(parameters: ["lat": latitude, "lon": longitude, "addressType": "A04", "appKey": Config.tmapAPIKey], encoding: URLEncoding.default)
}
}

Expand Down
2 changes: 0 additions & 2 deletions Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ extension CourseRouter: TargetType {
multipartFormData.append(imageData)

var content = [String: Any]()

var path = [[String: Any]]()
var tempPath = String()

do {
for location in param.path {
Expand Down
10 changes: 5 additions & 5 deletions Runnect-iOS/Runnect-iOS/Network/Service/NetworkProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@

import Moya

class NetworkProvider<Provider : TargetType> : MoyaProvider<Provider> {
func request<Model : Codable>(target : Provider, instance : Model.Type , vc: UIViewController, completion : @escaping(Model) -> ()){
class NetworkProvider<Provider: TargetType> : MoyaProvider<Provider> {
func request<Model: Codable>(target: Provider, instance: Model.Type , vc: UIViewController, completion: @escaping(Model) -> ()){
self.request(target) { result in
switch result {
/// 서버 통신 성공
/// 서버 통신 성공
case .success(let response):
if (200..<300).contains(response.statusCode) {
if let decodeData = try? JSONDecoder().decode(instance, from: response.data) {
completion(decodeData)
} else{
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아차차 요런 부분까지 확인해주다니.. 넘 꼼꼼해요 명진쌤 !!~! 고맙습니다 🙇🏻‍♀️

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

노란 경고 창이 떠서.. ㅎㅎ

/// decoding error
vc.showNetworkFailureToast()
}
} else {
/// 응답 코드 400인 경우
vc.showNetworkFailureToast()
}
/// 서버 통신 실패
/// 서버 통신 실패
case .failure(let error):
if let response = error.response {
if let responseData = String(data: response.data, encoding: .utf8) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ extension CourseDetailVC {
print("The long URL is: \(longDynamicLink)")

/// 짧은 Dynamic Link로 변환하는 부분 입니다.
linkBuilder.shorten { [weak self] url, warnings, error in
linkBuilder.shorten { [weak self] url, _, error in // warning 파라미터 와일드 카드
guard let shortDynamicLink = url else {
if let error = error {
print("❌Error shortening dynamic link: \(error)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class CourseDiscoveryVC: UIViewController {

private let searchButton = UIButton(type: .system).then {
$0.setImage(ImageLiterals.icSearch, for: .normal)
$0.tintColor = .g1
$0.tintColor = .g3
}
private let uploadButton = CustomButton(title: "업로드").then {
$0.clipsToBounds = true
Expand Down Expand Up @@ -187,7 +187,7 @@ extension CourseDiscoveryVC {

naviBar.snp.makeConstraints { make in
make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(48)
make.height.equalTo(56)
}
searchButton.snp.makeConstraints { make in
make.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ extension CourseDrawingVC {
}

naviBar.snp.makeConstraints { make in
make.height.equalTo(48)
make.height.equalTo(56)
}

naviBarContainerStackView.snp.makeConstraints { make in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final class DepartureSearchVC: UIViewController, CLLocationManagerDelegate {
}

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
self.setUI()
Expand Down Expand Up @@ -132,8 +132,7 @@ extension DepartureSearchVC {
guard let latitude = locationManager.location?.coordinate.latitude,
let longitude = locationManager.location?.coordinate.longitude else { return }
searchLocationTmapAddress(latitude: latitude, longitude: longitude)
}
else {
} else {
locationManager.startUpdatingLocation()
}
}
Expand All @@ -143,7 +142,7 @@ extension DepartureSearchVC {
let authorizationStatus: CLAuthorizationStatus
if #available(iOS 14.0, *) {
authorizationStatus = locationManager.authorizationStatus
}else {
} else {
authorizationStatus = CLLocationManager.authorizationStatus()
}

Expand Down Expand Up @@ -198,7 +197,7 @@ extension DepartureSearchVC {
}
self.navigationController?.popViewController(animated: true)
}

self.present(alertVC, animated: false)
}
}
Expand Down Expand Up @@ -310,28 +309,28 @@ extension DepartureSearchVC {
LoadingIndicator.showLoading()
departureSearchingProvider
.request(.getAddress(keyword: keyword)) { [weak self] response in
guard let self = self else { return }
LoadingIndicator.hideLoading()
switch response {
case .success(let result):
let status = result.statusCode
if 200..<300 ~= status {
do {
let responseDto = try result.map(DepartureSearchingResponseDto.self)
self.setData(data: responseDto.documents)
} catch {
print(error.localizedDescription)
guard let self = self else { return }
LoadingIndicator.hideLoading()
switch response {
case .success(let result):
let status = result.statusCode
if 200..<300 ~= status {
do {
let responseDto = try result.map(DepartureSearchingResponseDto.self)
self.setData(data: responseDto.documents)
} catch {
print(error.localizedDescription)
}
}
if status >= 400 {
print("400 error")
self.setData(data: [])
}
case .failure(let error):
print(error.localizedDescription)
self.showToast(message: "네트워크 통신 실패")
}
if status >= 400 {
print("400 error")
self.setData(data: [])
}
case .failure(let error):
print(error.localizedDescription)
self.showToast(message: "네트워크 통신 실패")
}
}
}

private func searchLocationTmapAddress(latitude: Double, longitude: Double) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ extension CourseStorageVC {

naviBar.snp.makeConstraints { make in
make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(48)
make.height.equalTo(56)
}

guard UserManager.shared.userType != .visitor else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ final class PrivateCourseListView: UIView {
}

private let editButton = UIButton(type: .custom).then {
$0.setTitle("편집", for: .normal)
$0.setTitle("선택", for: .normal)
$0.setTitleColor(.m1, for: .normal)
$0.titleLabel?.font = .b7
$0.layer.borderColor = UIColor.m1.cgColor
$0.layer.borderWidth = 1
$0.titleLabel?.font = .b5
$0.layer.backgroundColor = UIColor.m3.cgColor
$0.layer.cornerRadius = 11
// $0.layer.borderColor = UIColor.m1.cgColor
// $0.layer.borderWidth = 1
}

lazy var courseListCollectionView = UICollectionView(
Expand Down Expand Up @@ -130,7 +131,7 @@ extension PrivateCourseListView {

private func finishEditMode() {
self.totalNumOfRecordlabel.text = "총 코스 \(self.courseList.count)개"
self.editButton.setTitle("편집", for: .normal)
self.editButton.setTitle("선택", for: .normal)
self.deselectAllItems()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ final class ActivityRecordInfoVC: UIViewController {
}

private let editButton = UIButton(type: .custom).then {
$0.setTitle("편집", for: .normal)
$0.setTitle("선택", for: .normal)
$0.setTitleColor(.m1, for: .normal)
$0.titleLabel?.font = .b7
$0.layer.borderColor = UIColor.m1.cgColor
$0.layer.borderWidth = 1
$0.titleLabel?.font = .b5
$0.layer.backgroundColor = UIColor.m3.cgColor
$0.layer.cornerRadius = 11
// $0.layer.borderColor = UIColor.m1.cgColor
// $0.layer.borderWidth = 1
}

private lazy var deleteRecordButton = CustomButton(title: "삭제하기").then {
Expand Down Expand Up @@ -99,7 +100,7 @@ extension ActivityRecordInfoVC {
}

func reloadActivityRecordInfoVC() {
self.editButton.setTitle("편집", for: .normal)
self.editButton.setTitle("선택", for: .normal)
self.deleteRecordButton.isHidden = true
self.totalNumOfRecordlabel.text = "총 기록 \(self.activityRecordList.count)개"
deselectedActivityRecordTableRows()
Expand Down Expand Up @@ -137,7 +138,7 @@ extension ActivityRecordInfoVC {
print(isEditMode)
if isEditMode {
self.totalNumOfRecordlabel.text = "총 기록 \(self.activityRecordList.count)개"
self.editButton.setTitle("편집", for: .normal)
self.editButton.setTitle("선택", for: .normal)
self.deleteRecordButton.isHidden = true
deselectedActivityRecordTableRows()
self.deleteRecordButton.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ final class UploadedCourseInfoVC: UIViewController {
}

private let editButton = UIButton(type: .custom).then {
$0.setTitle("편집", for: .normal)
$0.setTitle("선택", for: .normal)
$0.setTitleColor(.m1, for: .normal)
$0.titleLabel?.font = .b7
$0.layer.borderColor = UIColor.m1.cgColor
$0.layer.borderWidth = 1
$0.titleLabel?.font = .b5
$0.layer.backgroundColor = UIColor.m3.cgColor
$0.layer.cornerRadius = 11
// $0.layer.borderColor = UIColor.m1.cgColor
// $0.layer.borderWidth = 1
}

private lazy var deleteCourseButton = CustomButton(title: "삭제하기").then {
Expand Down Expand Up @@ -140,7 +141,7 @@ extension UploadedCourseInfoVC {

private func finishEditMode() {
self.totalNumOfRecordlabel.text = "총 코스 \(self.uploadedCourseList.count)개"
self.editButton.setTitle("편집", for: .normal)
self.editButton.setTitle("선택", for: .normal)
self.deleteCourseButton.isEnabled = false
self.deleteCourseButton.setTitle(title: "삭제하기")
self.deleteCourseButton.isHidden = true
Expand Down
Loading