Skip to content

Commit

Permalink
[Merge] 'develop' into feat/#226
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongdung-eo committed Feb 29, 2024
2 parents ab0b152 + 4248387 commit 715e553
Show file tree
Hide file tree
Showing 35 changed files with 223 additions and 109 deletions.
12 changes: 10 additions & 2 deletions iOS-NOTTODO/iOS-NOTTODO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
3B5F8F8329BF90290063A7F8 /* SituationCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5F8F8229BF90290063A7F8 /* SituationCollectionViewCell.swift */; };
3B5F8F8929BF9EFE0063A7F8 /* AddMissionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5F8F8829BF9EFE0063A7F8 /* AddMissionLabel.swift */; };
3B710A5C2A62D4AB00E95620 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3B710A5B2A62D4AB00E95620 /* Settings.bundle */; };
3B80B5D52B7F304D00697250 /* adjust+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B80B5D42B7F304D00697250 /* adjust+.swift */; };
3B80B5D72B7F30E200697250 /* Numbers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B80B5D62B7F30E200697250 /* Numbers.swift */; };
3B892AB82A2FBBAD00A316BC /* AddMissionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B892AB72A2FBBAD00A316BC /* AddMissionService.swift */; };
3B892ABB2A2FBD4C00A316BC /* RecommendSituationResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B892ABA2A2FBD4C00A316BC /* RecommendSituationResponseDTO.swift */; };
3B892ABE2A2FBDDE00A316BC /* AddMissionAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B892ABD2A2FBDDE00A316BC /* AddMissionAPI.swift */; };
Expand Down Expand Up @@ -314,6 +316,8 @@
3B5F8F8229BF90290063A7F8 /* SituationCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SituationCollectionViewCell.swift; sourceTree = "<group>"; };
3B5F8F8829BF9EFE0063A7F8 /* AddMissionLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddMissionLabel.swift; sourceTree = "<group>"; };
3B710A5B2A62D4AB00E95620 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
3B80B5D42B7F304D00697250 /* adjust+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "adjust+.swift"; sourceTree = "<group>"; };
3B80B5D62B7F30E200697250 /* Numbers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Numbers.swift; sourceTree = "<group>"; };
3B892AB72A2FBBAD00A316BC /* AddMissionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddMissionService.swift; sourceTree = "<group>"; };
3B892ABA2A2FBD4C00A316BC /* RecommendSituationResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendSituationResponseDTO.swift; sourceTree = "<group>"; };
3B892ABD2A2FBDDE00A316BC /* AddMissionAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddMissionAPI.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -804,6 +808,7 @@
3B11740C2A4B574B0033DDF3 /* CALayer+.swift */,
0943A9F82A53239200614761 /* Bundle+.swift */,
3B03D0D72B0F5EF300302872 /* CGSize+.swift */,
3B80B5D42B7F304D00697250 /* adjust+.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1225,6 +1230,7 @@
isa = PBXGroup;
children = (
6CF4706929A71D71008D145C /* Strings.swift */,
3B80B5D62B7F30E200697250 /* Numbers.swift */,
);
path = Literals;
sourceTree = "<group>";
Expand Down Expand Up @@ -1462,6 +1468,7 @@
6CF4705B29A68EA9008D145C /* URLConstant.swift in Sources */,
3BD3B5C829B8F82C00D3575B /* AddMissionTextFieldView.swift in Sources */,
3B14518629C618920013DFB4 /* ActionCollectionViewCell.swift in Sources */,
3B80B5D72B7F30E200697250 /* Numbers.swift in Sources */,
092E04B129BD9C86008A5892 /* MissionDetailCollectionViewCell.swift in Sources */,
6CF4706D29A739D9008D145C /* RecommendViewController.swift in Sources */,
3BC1A27429C9AF500088376B /* MissionHistoryCollectionViewCell.swift in Sources */,
Expand Down Expand Up @@ -1533,6 +1540,7 @@
6CF4706529A690E5008D145C /* NetworkBase.swift in Sources */,
099FC98129B3094F005B37E6 /* WeekMonthFSCalendar.swift in Sources */,
6C16016429C5E37D005AE3F5 /* MyInfoAccountStackView.swift in Sources */,
3B80B5D52B7F304D00697250 /* adjust+.swift in Sources */,
09F6718229CAD86100708725 /* OnboardingCollectionViewCell.swift in Sources */,
6CF4707029A73A15008D145C /* RecommendActionViewController.swift in Sources */,
0943A9F92A53239200614761 /* Bundle+.swift in Sources */,
Expand Down Expand Up @@ -1718,7 +1726,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = "nottodo.iOS-NOTTODO";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1756,7 +1764,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = "nottodo.iOS-NOTTODO";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
1 change: 1 addition & 0 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Enum/AnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ enum AnalyticsEvent {
case clickGuide = "click_guide"
case clickFaq = "click_faq"
case clickNotice = "click_notice"
case clickSuggestion = "click_suggestion"
case clickQuestion = "click_question"
case clickTerms = "click_terms"
case clickOpenSource = "click_opensource"
Expand Down
1 change: 1 addition & 0 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Enum/KeychainUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ public final class KeychainUtil {

UserDefaults.standard.removeObject(forKey: DefaultKeys.socialToken)
UserDefaults.standard.removeObject(forKey: DefaultKeys.accessToken)
UserDefaults.standard.removeObject(forKey: DefaultKeys.isDeprecatedBtnClicked)
}
}
9 changes: 6 additions & 3 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Enum/MyInfoURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import Foundation
import SafariServices

enum MyInfoURL {
case guid, faq, notice, question, service, personalInfo, googleForm
case guid, faq, notice, suggestoin, question, service, personalInfo, commonAlarmModal

var url: String {
switch self {
case .guid:
Expand All @@ -19,14 +20,16 @@ enum MyInfoURL {
return "https://teamnottodo.notion.site/a6ef7036bde24e289e576ace099f39dc"
case .notice:
return "https://teamnottodo.notion.site/a5dbb310ec1d43baae02b7e9bf0b3411"
case .suggestoin:
return "https://forms.gle/xKq4oV8u7TQawKtE6"
case .question:
return "http://pf.kakao.com/_fUIQxj/chat"
case .service:
return "https://teamnottodo.notion.site/81594da775614d23900cdb2475eadb73?pvs=4"
case .personalInfo:
return "https://teamnottodo.notion.site/5af34df7da3649fc941312c5f533c1eb"
case .googleForm:
return "https://forms.gle/gwBJ4hL4bCTjXRTP6"
case .commonAlarmModal:
return "https://open.kakao.com/o/gbrW727f"
}
}

Expand Down
12 changes: 2 additions & 10 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Extensions/CGSize+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,13 @@ import UIKit

extension CGSize {

func getDeviceWidth() -> CGFloat {
return UIScreen.main.bounds.width
}

func getDeviceHeight() -> CGFloat {
return UIScreen.main.bounds.height
}

/// 아이폰 13 미니(width 375)를 기준으로 레이아웃을 잡고, 기기의 width 사이즈를 곱해 대응 값을 구할 때 사용
func convertByWidthRatio(_ convert: CGFloat) -> CGFloat {
return (convert / 375) * getDeviceWidth()
return (convert / 375) * Numbers.width
}

/// 아이폰 13 미니(height 812)를 기준으로 레이아웃을 잡고, 기기의 height 사이즈를 곱해 대응 값을 구할 때 사용
func convertByHeightRatio(_ convert: CGFloat) -> CGFloat {
return (convert / 812) * getDeviceHeight()
return (convert / 812) * Numbers.height
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ extension UIImage {
static var icBell: UIImage { UIImage(named: "ic_bell")! }
static var icCircle: UIImage { UIImage(named: "acceptCircle")! }
static var icStarbucks: UIImage { UIImage(named: "ic_starbucks")! }
static var icFeedback: UIImage { UIImage(named: "ic_feedback")! }

// image

static var imgCreateTip: UIImage { UIImage(named: "img_create_tip")! }
static var imgUser: UIImage { UIImage(named: "img_myinfouser")! }
static var imgTotal: UIImage { UIImage(named: "img_total")! }
static var imgStarbucks: UIImage { UIImage(named: "img_starbucks")! }
static var imgOpenChat: UIImage { UIImage(named: "img_openchat")! }

// recommend

Expand Down
41 changes: 26 additions & 15 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Extensions/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,7 @@ extension UILabel {
self.attributedText = attributedString
}

func htmlToString(_ targetString: String) -> NSAttributedString? {
let text = targetString

guard let data = text.data(using: .utf8) else {
return NSAttributedString()
}
do {
return try NSAttributedString(data: data,
options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue],
documentAttributes: nil)
} catch {
return NSAttributedString()
}
}

/// 라벨 일부 textColor와 font 변경해주는 함수
func setAttributedText(targetFontList: [String: UIFont],
targetColorList: [String: UIColor]) {
let fullText = self.text ?? ""
Expand All @@ -91,4 +77,29 @@ extension UILabel {
}
self.attributedText = attributedString
}

/// 라벨에 highlight를 칠해주는 함수
func partHighlightText(targetString: String, targetHighlightColor: UIColor) {
guard let fullText = self.text else { return }
let range = (fullText as NSString).range(of: targetString)
let attributedString = NSMutableAttributedString(string: fullText)
attributedString.addAttribute(.backgroundColor, value: targetHighlightColor, range: range)
self.attributedText = attributedString
}

/// html을 string으로 변경해주는 함수
func htmlToString(_ targetString: String) -> NSAttributedString? {
let text = targetString

guard let data = text.data(using: .utf8) else {
return NSAttributedString()
}
do {
return try NSAttributedString(data: data,
options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue],
documentAttributes: nil)
} catch {
return NSAttributedString()
}
}
}
2 changes: 1 addition & 1 deletion iOS-NOTTODO/iOS-NOTTODO/Global/Extensions/UIScreen+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import UIKit

extension UIScreen {
var hasNotch: Bool {
return !( (UIScreen.main.bounds.width / UIScreen.main.bounds.height) > 0.5 )
return !( (Numbers.width / Numbers.height) > 0.5 )
}
}
12 changes: 2 additions & 10 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Extensions/UIViewController+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@ import UIKit
import SnapKit

extension UIViewController {
func getDeviceWidth() -> CGFloat {
return UIScreen.main.bounds.width
}

func getDeviceHeight() -> CGFloat {
return UIScreen.main.bounds.height
}

/// Constraint 설정 시 노치 유무로 기기를 대응하는 상황에서 사용
func constraintByNotch(_ hasNotch: CGFloat, _ noNotch: CGFloat) -> CGFloat {
return UIScreen.main.hasNotch ? hasNotch : noNotch
}

/// 아이폰 13 미니(width 375)를 기준으로 레이아웃을 잡고, 기기의 width 사이즈를 곱해 대응 값을 구할 때 사용
func convertByWidthRatio(_ convert: CGFloat) -> CGFloat {
return (convert / 375) * getDeviceWidth()
return (convert / 375) * Numbers.width
}

/// 아이폰 13 미니(height 812)를 기준으로 레이아웃을 잡고, 기기의 height 사이즈를 곱해 대응 값을 구할 때 사용
func convertByHeightRatio(_ convert: CGFloat) -> CGFloat {
return (convert / 812) * getDeviceHeight()
return (convert / 812) * Numbers.height
}

func changeRootViewController(_ viewControllerToPresent: UIViewController) {
Expand Down
29 changes: 29 additions & 0 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Extensions/adjust+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// adjust+.swift
// iOS-NOTTODO
//
// Created by 강윤서 on 2/16/24.
//

import UIKit

extension CGFloat {
var adjusted: CGFloat {
let ratio: CGFloat = Numbers.width / 375
return ratio * CGFloat(self)
}
}

extension Int {
var adjusted: CGFloat {
let ratio: CGFloat = (Numbers.width) / 375
return ratio * CGFloat(self)
}
}

extension Double {
var adjusted: CGFloat {
let ratio: CGFloat = (Numbers.width) / 375
return ratio * CGFloat(self)
}
}
13 changes: 13 additions & 0 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Literals/Numbers.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Numbers.swift
// iOS-NOTTODO
//
// Created by 강윤서 on 2/16/24.
//

import UIKit

struct Numbers {
static let width: CGFloat = UIScreen.main.bounds.width
static let height: CGFloat = UIScreen.main.bounds.height
}
11 changes: 9 additions & 2 deletions iOS-NOTTODO/iOS-NOTTODO/Global/Literals/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct I18N {
/// Achievement

static let achievement = "성취"
static let total = "<매달 낫투두 성취 공유하고 선물받자!>\n인스타 @nottodo_official을 확인해주세요 :)"
static let total = "남겨주신 피드백으로\n새로운 기능을 업데이트 할 예정이에요 :)"

/// Detail

Expand Down Expand Up @@ -118,6 +118,13 @@ struct I18N {
static let withdraw = "회원 탈퇴"
static let logoutAlertTitle = "로그아웃 하시겠습니까?"
static let logoutAlertmessage = "로그아웃을 하면\n다른 기기와 낫투두 기록을 연동하지 못해요."
static let guide = "낫투두 가이드"
static let oftenQuestion = "자주 묻는 질문"
static let notice = "공지사항"
static let sendFeedback = "의견 보내기"
static let inquiry = "1:1 문의"
static let version = "버전 정보"
static let policies = "약관 및 정책"

/// Onboarding

Expand Down Expand Up @@ -187,7 +194,7 @@ struct I18N {
static let allow = "허용"
static let notiDialogButton = "네, 알겠어요 :)"

static let formButton = "이정도야 쉽지!"
static let commonModalTitle = "지금 바로 참여하기"
static let deprecatedTitle = "더 이상 보지 않기"
static let close = "닫기"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ extension AchievementViewController {
monthCalendar.snp.makeConstraints {
$0.top.equalTo(achievementLabel.snp.bottom).offset(22)
$0.directionalHorizontalEdges.equalTo(safeArea).inset(15)
$0.height.equalTo((getDeviceWidth()-30)*1.1)
$0.height.equalTo((Numbers.width-30)*1.1)
}

statisticsView.snp.makeConstraints {
$0.top.equalTo(monthCalendar.snp.bottom)
$0.directionalHorizontalEdges.equalTo(safeArea).inset(15)
$0.height.equalTo((getDeviceWidth()-30)*0.6)
$0.height.equalTo((Numbers.width-30)*0.6)
$0.bottom.equalTo(scrollView.snp.bottom).inset(20)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extension DetailAchievementViewController {
collectionView.snp.makeConstraints {
$0.center.equalTo(safeArea)
$0.directionalHorizontalEdges.equalTo(safeArea).inset(15)
$0.height.equalTo(getDeviceWidth()*1.1)
$0.height.equalTo(Numbers.width*1.1)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension StatisticsView {
private func setUI() {

totalImage.do {
$0.image = .icSNS
$0.image = .icFeedback
}

titleLabel.do {
Expand All @@ -54,13 +54,13 @@ extension StatisticsView {
addSubviews(totalImage, titleLabel)

totalImage.snp.makeConstraints {
$0.top.equalToSuperview().offset(69)
$0.top.equalToSuperview().offset(18.adjusted)
$0.centerX.equalToSuperview()
$0.size.equalTo(CGSize(width: 63, height: 51))
$0.size.equalTo(127.adjusted)
}

titleLabel.snp.makeConstraints {
$0.top.equalTo(totalImage.snp.bottom).offset(26)
$0.top.equalTo(totalImage.snp.bottom).offset(6.adjusted)
$0.centerX.equalToSuperview()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ final class DateCollectionViewCell: UICollectionViewCell, AddMissionMenu {
private lazy var tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: today)!
private var dateList: [String] = []
private var missionType: MissionType?
private var deviceWidth = UIScreen.main.bounds.width

// MARK: - UI Components

Expand Down Expand Up @@ -57,8 +56,7 @@ final class DateCollectionViewCell: UICollectionViewCell, AddMissionMenu {
func setFoldState(_ state: FoldState) {
fold = state

let deviceWidth = UIScreen.main.bounds.width
let cellWidth = deviceWidth * (345/375)
let cellWidth = Numbers.width * (345/375)
let cellHeight = cellWidth * (470/345)
missionCellHeight?(state == .folded ? 54 : cellHeight)
updateUI()
Expand Down
Loading

0 comments on commit 715e553

Please sign in to comment.