Skip to content

Commit 3ed5daf

Browse files
committed
refactor: remove importing & using UIKit in non-ui service
1 parent 1d1858a commit 3ed5daf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Sources/EmojiPicker/Services/EmojiManager.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23-
import UIKit
23+
import Foundation
2424

2525
/// An abstraction over entity that provides emoji set.
2626
protocol EmojiManagerProtocol {
@@ -64,8 +64,11 @@ final class EmojiManager: EmojiManagerProtocol {
6464
}
6565

6666
/// Version of operating system of a device.
67+
///
68+
/// It takes major and minor version of a device and returns it as `15.5`.
6769
private var deviceVersion: Double {
68-
return (UIDevice.current.systemVersion as NSString).doubleValue
70+
let operatingSystemVersion = ProcessInfo().operatingSystemVersion
71+
return Double(operatingSystemVersion.majorVersion) + Double(operatingSystemVersion.minorVersion) / 10
6972
}
7073

7174
// MARK: - Internal Methods

0 commit comments

Comments
 (0)