-
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.
[refactor] #154 Device 관련 로직 Util로 이동
- Loading branch information
1 parent
84eb77c
commit 49c523f
Showing
6 changed files
with
52 additions
and
64 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
39 changes: 0 additions & 39 deletions
39
Projects/CoreKit/Sources/Data/Client/DeviceClient/DeviceClient+LiveKey.swift
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
Projects/CoreKit/Sources/Data/Client/DeviceClient/DeviceClient.swift
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
// | ||
// Device.swift | ||
// Util | ||
// | ||
// Created by 김도형 on 10/26/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct Device { | ||
#if os(iOS) | ||
static private let device = UIDevice.current.userInterfaceIdiom | ||
#endif | ||
|
||
public static var isPhone: Bool { | ||
#if os(macOS) | ||
return false | ||
#endif | ||
return device == .phone | ||
} | ||
|
||
public static var isPad: Bool { | ||
#if os(macOS) | ||
return false | ||
#endif | ||
return device == .pad | ||
} | ||
|
||
public static var isMac: Bool { | ||
#if os(macOS) | ||
return true | ||
#endif | ||
return device == .mac | ||
} | ||
|
||
public static var isPortrait: Bool { | ||
#if os(macOS) | ||
return false | ||
#endif | ||
return UIDevice.current.orientation == .portrait | ||
|| UIDevice.current.orientation == .portraitUpsideDown | ||
} | ||
} |