Skip to content

Commit

Permalink
[Feat] #4 - adjusted+ 파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Heyjooo committed Jan 5, 2024
1 parent 58acab8 commit b5c44af
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DontBe-iOS/DontBe-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
2A6D54C12B479B4300F9891E /* adjusted+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6D54C02B479B4300F9891E /* adjusted+.swift */; };
3C2854F72B3A9E8300369C99 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2854F62B3A9E8300369C99 /* View.swift */; };
3C2854F92B3A9E8A00369C99 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2854F82B3A9E8A00369C99 /* ViewModel.swift */; };
3C2854FB2B3A9E9000369C99 /* Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2854FA2B3A9E9000369C99 /* Cell.swift */; };
Expand All @@ -29,6 +30,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
2A6D54C02B479B4300F9891E /* adjusted+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "adjusted+.swift"; sourceTree = "<group>"; };
3C2854F62B3A9E8300369C99 /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = "<group>"; };
3C2854F82B3A9E8A00369C99 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = "<group>"; };
3C2854FA2B3A9E9000369C99 /* Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -141,6 +143,7 @@
children = (
3C6193142B3A7A6400220CEB /* UIView+.swift */,
3C6193162B3A7A7B00220CEB /* UIStackView+.swift */,
2A6D54C02B479B4300F9891E /* adjusted+.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -307,6 +310,7 @@
3C61930C2B3A782100220CEB /* StringLiterals.swift in Sources */,
3C2854FB2B3A9E9000369C99 /* Cell.swift in Sources */,
3C61930A2B3A781300220CEB /* ImageLiterals.swift in Sources */,
2A6D54C12B479B4300F9891E /* adjusted+.swift in Sources */,
3C6193192B3A7AC700220CEB /* Config.swift in Sources */,
3C61931B2B3A7AD000220CEB /* NetworkError.swift in Sources */,
3C6192ED2B3A719A00220CEB /* AppDelegate.swift in Sources */,
Expand Down
44 changes: 44 additions & 0 deletions DontBe-iOS/DontBe-iOS/Global/Extension/adjusted+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// adjusted+.swift
// DontBe-iOS
//
// Created by 변희주 on 1/5/24.
//

import UIKit

extension CGFloat {
var adjusted: CGFloat {
let ratio: CGFloat = UIScreen.main.bounds.width / 375
return self * ratio
}

var adjustedH: CGFloat {
let ratio: CGFloat = UIScreen.main.bounds.height / 667
return self * ratio
}
}

extension Int {
var adjusted: Int {
let ratio: Int = Int(UIScreen.main.bounds.width / 375)
return self * ratio
}

var adjustedH: Int {
let ratio: Int = Int(UIScreen.main.bounds.height / 667)
return self * ratio
}
}

extension Double {
var adjusted: Double {
let ratio: Double = Double(UIScreen.main.bounds.width / 375)
return self * ratio
}

var adjustedH: Double {
let ratio: Double = Double(UIScreen.main.bounds.height / 667)
return self * ratio
}
}

0 comments on commit b5c44af

Please sign in to comment.