Skip to content

Commit

Permalink
[Fix] #232 - getDevice 함수 상수값으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Feb 16, 2024
1 parent 3cb94c4 commit 0475994
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 17 deletions.
14 changes: 11 additions & 3 deletions iOS-NOTTODO/iOS-NOTTODO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
09A1465F2A192C4900DDC308 /* WeekMissionResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09A1465E2A192C4900DDC308 /* WeekMissionResponseDTO.swift */; };
09A146652A1964B500DDC308 /* AddAnotherDayResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09A146642A19649A00DDC308 /* AddAnotherDayResponseDTO.swift */; };
09C8602D2AB14B4800C4F4B1 /* FSCalendar in Frameworks */ = {isa = PBXBuildFile; productRef = 09C8602C2AB14B4800C4F4B1 /* FSCalendar */; };
09CF56042B09F23800526C8C /* HomeDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CF56032B09F23800526C8C /* HomeDataSource.swift */; };
09CF56022B09E98A00526C8C /* DetailAchieveHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CF56012B09E98A00526C8C /* DetailAchieveHeaderView.swift */; };
09CF56042B09F23800526C8C /* HomeDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CF56032B09F23800526C8C /* HomeDataSource.swift */; };
09DCCD1F2A18ED76003DCF8A /* DailyMissionResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09DCCD1E2A18ED76003DCF8A /* DailyMissionResponseDTO.swift */; };
09DCCD212A18EF43003DCF8A /* HomeSevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09DCCD202A18EF43003DCF8A /* HomeSevice.swift */; };
09DCCD232A18EFB0003DCF8A /* HomeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09DCCD222A18EFB0003DCF8A /* HomeAPI.swift */; };
Expand Down Expand Up @@ -117,6 +117,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 @@ -212,8 +214,8 @@
099FC98829B3233D005B37E6 /* CalendarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarView.swift; sourceTree = "<group>"; };
09A1465E2A192C4900DDC308 /* WeekMissionResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekMissionResponseDTO.swift; sourceTree = "<group>"; };
09A146642A19649A00DDC308 /* AddAnotherDayResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAnotherDayResponseDTO.swift; sourceTree = "<group>"; };
09CF56032B09F23800526C8C /* HomeDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeDataSource.swift; sourceTree = "<group>"; };
09CF56012B09E98A00526C8C /* DetailAchieveHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailAchieveHeaderView.swift; sourceTree = "<group>"; };
09CF56032B09F23800526C8C /* HomeDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeDataSource.swift; sourceTree = "<group>"; };
09DCCD1E2A18ED76003DCF8A /* DailyMissionResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DailyMissionResponseDTO.swift; sourceTree = "<group>"; };
09DCCD202A18EF43003DCF8A /* HomeSevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeSevice.swift; sourceTree = "<group>"; };
09DCCD222A18EFB0003DCF8A /* HomeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeAPI.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -280,6 +282,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 @@ -705,6 +709,7 @@
3B11740C2A4B574B0033DDF3 /* CALayer+.swift */,
0943A9F82A53239200614761 /* Bundle+.swift */,
3B03D0D72B0F5EF300302872 /* CGSize+.swift */,
3B80B5D42B7F304D00697250 /* adjust+.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1126,6 +1131,7 @@
isa = PBXGroup;
children = (
6CF4706929A71D71008D145C /* Strings.swift */,
3B80B5D62B7F30E200697250 /* Numbers.swift */,
);
path = Literals;
sourceTree = "<group>";
Expand Down Expand Up @@ -1357,6 +1363,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 @@ -1421,6 +1428,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 @@ -1846,4 +1854,4 @@
/* End XCSwiftPackageProductDependency section */
};
rootObject = 3B027A6C299C31B500BEB65C /* Project object */;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ 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

Expand Down
7 changes: 6 additions & 1 deletion iOS-NOTTODO/iOS-NOTTODO/Global/Literals/Numbers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
// Created by 강윤서 on 2/16/24.
//

import Foundation
import UIKit

struct Numbers {
static let width: CGFloat = UIScreen.main.bounds.width
static let height: CGFloat = UIScreen.main.bounds.height
}
2 changes: 1 addition & 1 deletion 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
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,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 @@ -88,7 +88,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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ extension AddMissionViewController {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumLineSpacing = 14
layout.footerReferenceSize = CGSize(width: getDeviceWidth(), height: 319)
layout.footerReferenceSize = CGSize(width: Numbers.width, height: 319)
return layout
}

Expand Down Expand Up @@ -382,7 +382,7 @@ extension AddMissionViewController: UICollectionViewDataSource {

extension AddMissionViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let cellWidth: CGFloat = UIScreen.main.bounds.width - 40
let cellWidth: CGFloat = Numbers.width - 40
let height = heightList[indexPath.row]

return CGSize(width: cellWidth, height: height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension DetailCalendarViewController {
monthCalendar.snp.makeConstraints {
$0.centerY.equalTo(safeArea)
$0.directionalHorizontalEdges.equalTo(safeArea).inset(15)
$0.height.equalTo((getDeviceWidth()-30)*1.2)
$0.height.equalTo((Numbers.width-30)*1.2)
}

subLabel.snp.makeConstraints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension HomeDeleteViewController {

deleteModalView.snp.makeConstraints {
$0.directionalHorizontalEdges.equalTo(safeArea).inset(52)
$0.height.equalTo((getDeviceWidth() - 104)*1.09)
$0.height.equalTo((Numbers.width - 104)*1.09)
$0.center.equalTo(safeArea)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension FifthOnboardingViewController {
}
gradientView.snp.makeConstraints {
$0.bottom.equalTo(nextButton.snp.top).offset(-90)
$0.top.equalTo(safeArea).offset(getDeviceHeight()*0.5)
$0.top.equalTo(safeArea).offset(Numbers.height*0.5)
$0.directionalHorizontalEdges.equalTo(safeArea)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ extension FourthOnboardingViewController {
}
gradientView.snp.makeConstraints {
$0.bottom.equalTo(nextButton.snp.top)
$0.top.equalTo(safeArea).offset(getDeviceHeight()*0.5)
$0.top.equalTo(safeArea).offset(Numbers.height*0.5)
$0.directionalHorizontalEdges.equalTo(safeArea)
}
}
Expand Down

0 comments on commit 0475994

Please sign in to comment.