Skip to content

Commit

Permalink
merge #423: traveline 1.0.0 - iOS Release
Browse files Browse the repository at this point in the history
[merge] traveline 1.0.0 - iOS Release
  • Loading branch information
0inn authored Feb 26, 2024
2 parents ae21774 + 83b5c3d commit 79348bd
Show file tree
Hide file tree
Showing 60 changed files with 724 additions and 307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ public extension Project {
enum Environmnet {
public static let workspace = "traveline"
public static let deploymentTarget = DeploymentTarget.iOS(targetVersion: "16.0", devices: [.iphone])
public static let bundleName = "kr.codesquad.boostcamp8.traveline"
public static let bundleName = "com.boostcamp8.traveline"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public extension Project {
]
]
],
"BaseURL": "$(BASE_URL)"
"ProdURL": "$(PROD_URL)",
"DevURL": "$(DEV_URL)"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Glyph_ undefined.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Glyph_ undefined 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Glyph_ undefined 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Glyph_ undefined.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Glyph_ undefined 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Glyph_ undefined 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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: 9 additions & 0 deletions iOS/traveline/Sources/App/RootContainerVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ extension RootContainerVC: SideMenuDelegate {
switch menuItem {
case .profileEdit:
let profileEditingVC = VCFactory.makeProfileEditingVC()
profileEditingVC.delegate = self
navigationVC?.pushViewController(profileEditingVC, animated: true)
case .myPostList:
let myPostListVC = VCFactory.makeMyPostListVC()
Expand Down Expand Up @@ -210,3 +211,11 @@ extension RootContainerVC: UIGestureRecognizerDelegate {
return false
}
}

// MARK: - TimelineWriting Delegate

extension RootContainerVC: ToastDelegate {
func viewControllerDidFinishAction(isSuccess: Bool, message: String) {
showToast(message: message, type: isSuccess ? .success : .failure)
}
}
10 changes: 9 additions & 1 deletion iOS/traveline/Sources/Core/Constant/Literal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ enum Literal {
static let boundary: String = "Boundary-\(UUID().uuidString)"

enum InfoPlistKey {
static let baseURL: String = "BaseURL"
static let devURL: String = "DevURL"
static let prodURL: String = "ProdURL"
}

enum Tag {
Expand Down Expand Up @@ -117,6 +118,7 @@ enum Literal {
static let modify: String = "์ˆ˜์ •ํ•˜๊ธฐ"
static let delete: String = "์‚ญ์ œํ•˜๊ธฐ"
static let report: String = "์‹ ๊ณ ํ•˜๊ธฐ"
static let translate: String = "๋ฒˆ์—ญํ•˜๊ธฐ"
}

enum Query {
Expand Down Expand Up @@ -200,4 +202,10 @@ enum Literal {
static let drive: String = "์ž์ฐจ"
}
}

enum Setting {
static let termsOfServiceURL = "https://spiky-rat-16e.notion.site/b222abdf800e4a428a25582f2dc36290?pvs=4"
static let privacyPolicyURL = "https://spiky-rat-16e.notion.site/886a133ee0f9473a83d5f3ed8b877498?pvs=4"
static let openSourceLicenseURL = "https://spiky-rat-16e.notion.site/e8725bd989ea410390b6ef568324a439?pvs=4"
}
}
1 change: 1 addition & 0 deletions iOS/traveline/Sources/Core/Constant/UserDefaultsList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ import Foundation
enum UserDefaultsList {
@UserDefaultsWrapper<UserResponseDTO>(key: "userResponseDTO") static var userResponseDTO
@UserDefaultsWrapper<[String]>(key: "recentSearchKeyword") static var recentSearchKeyword
@UserDefaultsWrapper<Bool>(key: "isFirstEntry") static var isFirstEntry
}
13 changes: 13 additions & 0 deletions iOS/traveline/Sources/Core/Delegate/ToastDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ToastDelegate.swift
// traveline
//
// Created by ๊น€ํƒœํ˜„ on 1/24/24.
// Copyright ยฉ 2024 traveline. All rights reserved.
//

import Foundation

protocol ToastDelegate: AnyObject {
func viewControllerDidFinishAction(isSuccess: Bool, message: String)
}
42 changes: 42 additions & 0 deletions iOS/traveline/Sources/Core/Extension/Future+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Future+.swift
// traveline
//
// Created by ๊น€ํƒœํ˜„ on 12/14/23.
// Copyright ยฉ 2023 traveline. All rights reserved.
//

import Combine
import Foundation

extension Future where Failure == Error {

/// async ์‘๋‹ต ๊ฒฐ๊ณผ๋ฅผ Future publisher๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
/// - Parameter asyncFulfill: ๋ณ€ํ™˜ํ•  async ์‘๋‹ต
convenience init(_ asyncFulfill: @escaping () async throws -> Output) {
self.init { promise in
Task {
do {
let result = try await asyncFulfill()
promise(.success(result))
} catch {
promise(.failure(error))
}
}
}
}
}

extension Future where Failure == Never {

/// async ์‘๋‹ต ๊ฒฐ๊ณผ๋ฅผ Future publisher๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
/// - Parameter asyncFulfill: ๋ณ€ํ™˜ํ•  async ์‘๋‹ต
convenience init(_ asyncFulfill: @escaping () async -> Output) {
self.init { promise in
Task {
let result = await asyncFulfill()
promise(.success(result))
}
}
}
}
24 changes: 24 additions & 0 deletions iOS/traveline/Sources/Core/Extension/UIViewController+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// UIViewController+.swift
// traveline
//
// Created by ๊น€ํƒœํ˜„ on 1/16/24.
// Copyright ยฉ 2024 traveline. All rights reserved.
//

import UIKit

extension UIViewController {

/// ํ† ์ŠคํŠธ ๋ฉ”์„ธ์ง€๋ฅผ ๋…ธ์ถœํ•ฉ๋‹ˆ๋‹ค.
/// - Parameters:
/// - message: ๋…ธ์ถœํ•  ๋ฉ”์„ธ์ง€
/// - type: ํ† ์ŠคํŠธ ๋ฉ”์„ธ์ง€ ํƒ€์ž… (์‹คํŒจ, ์„ฑ๊ณต)
/// - followsUndockedKeyboard: ํ‚ค๋ณด๋“œ ์œ„์น˜๋ฅผ ํŠธ๋ž˜ํ‚นํ•˜๋ ค๋ฉด true๋กœ ์„ค์ •
func showToast(message: String, type: TLToastView.ToastType, followsUndockedKeyboard: Bool = false) {
let toast: TLToastView = .init(type: type, message: message, followsUndockedKeyboard: followsUndockedKeyboard)
view.keyboardLayoutGuide.followsUndockedKeyboard = followsUndockedKeyboard
toast.show(in: view)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum TimelineDetailEndPoint {
case fetchPlaceList(String, Int)
case putTimeline(String, TimelineDetailRequestDTO)
case deleteTimeline(String)
case translateTimeline(String)
}

extension TimelineDetailEndPoint: EndPoint {
Expand All @@ -34,14 +35,17 @@ extension TimelineDetailEndPoint: EndPoint {
case .deleteTimeline(let id):
return "\(curPath)/\(id)"

case .translateTimeline(let id):
return "\(curPath)/\(id)/translate"

default:
return curPath
}
}

var httpMethod: HTTPMethod {
switch self {
case .specificTimeline, .fetchPlaceList:
case .specificTimeline, .fetchPlaceList, .translateTimeline:
return .GET

case .createTimeline:
Expand Down
6 changes: 5 additions & 1 deletion iOS/traveline/Sources/Data/Network/Base/EndPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ protocol EndPoint {
extension EndPoint {

var baseURL: String? {
return Bundle.main.object(forInfoDictionaryKey: Literal.InfoPlistKey.baseURL) as? String
#if DEBUG
return Bundle.main.object(forInfoDictionaryKey: Literal.InfoPlistKey.devURL) as? String
#else
return Bundle.main.object(forInfoDictionaryKey: Literal.InfoPlistKey.prodURL) as? String
#endif
}

var body: Encodable? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct TimelineDetailResponseDTO: Decodable {
let coordX: Double?
let coordY: Double?
let date: String
let place: String
let place: String?
let time: String
let isOwner: Bool
let posting: PostingID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TimelineResponseDTO: Decodable {
let imagePath: String?
let coordX: Double?
let coordY: Double?
let place: String
let place: String?
let time: String
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// TimelineTranslatedResponseDTO.swift
// traveline
//
// Created by ๊น€ํƒœํ˜„ on 12/14/23.
// Copyright ยฉ 2023 traveline. All rights reserved.
//

import Foundation

struct TimelineTranslatedResponseDTO: Decodable {
let description: String
}

extension TimelineTranslatedResponseDTO {
func toDomain() -> TimelineTranslatedInfo {
return .init(description: description)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ final class TimelineDetailRepositoryMock: TimelineDetailRepository {

return true
}

func fetchTimelineTranslatedInfo(id: String) async throws -> TimelineTranslatedInfo {
try await Task.sleep(nanoseconds: 1_000_000_000)

return TimelineTranslatedInfo.empty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,13 @@ final class TimelineDetailRepositoryImpl: TimelineDetailRepository {
return deleteTimelineDTO
}

func fetchTimelineTranslatedInfo(id: String) async throws -> TimelineTranslatedInfo {
let translateTimelineDTO = try await network.request(
endPoint: TimelineDetailEndPoint.translateTimeline(id),
type: TimelineTranslatedResponseDTO.self
)

return translateTimelineDTO.toDomain()
}

}
2 changes: 2 additions & 0 deletions iOS/traveline/Sources/DesignSystem/Common/TLImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ enum TLImage {
static let close = TravelineAsset.Images.closeMedium.image
static let logo = TravelineAsset.Images.travelineLogo.image
static let`default` = TravelineAsset.Images.default.image
static let empty = TravelineAsset.Images.empty.image
static let errorCircle = TravelineAsset.Images.errorCircle.image
}

enum Travel {
Expand Down
Loading

0 comments on commit 79348bd

Please sign in to comment.