-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
60 changed files
with
1,439 additions
and
698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// CGSize+.swift | ||
// iOS-NOTTODO | ||
// | ||
// Created by 강윤서 on 11/23/23. | ||
// | ||
|
||
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() | ||
} | ||
|
||
/// 아이폰 13 미니(height 812)를 기준으로 레이아웃을 잡고, 기기의 height 사이즈를 곱해 대응 값을 구할 때 사용 | ||
func convertByHeightRatio(_ convert: CGFloat) -> CGFloat { | ||
return (convert / 812) * getDeviceHeight() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.