Skip to content

Commit

Permalink
Update and vendor UIDeviceComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
bbqsrc committed Dec 7, 2022
1 parent aff768f commit a7b5c5e
Show file tree
Hide file tree
Showing 17 changed files with 1,007 additions and 22 deletions.
60 changes: 58 additions & 2 deletions GiellaKeyboard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@
C655E8561EC5559200B12BE4 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C655E8551EC5559200B12BE4 /* HomeView.swift */; };
C655E85A1EC558D000B12BE4 /* HomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C655E8591EC558D000B12BE4 /* HomeController.swift */; };
C655E85D1EC55D0800B12BE4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C655E85B1EC55D0800B12BE4 /* Localizable.strings */; };
C66222342940B953005AE505 /* DeviceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222D2940B953005AE505 /* DeviceModel.swift */; };
C66222352940B953005AE505 /* UIDeviceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222E2940B953005AE505 /* UIDeviceExtensions.swift */; };
C66222362940B953005AE505 /* DeviceFamily.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222F2940B953005AE505 /* DeviceFamily.swift */; };
C66222372940B953005AE505 /* System.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222302940B953005AE505 /* System.swift */; };
C66222382940B953005AE505 /* Identifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222312940B953005AE505 /* Identifier.swift */; };
C66222392940B953005AE505 /* UIDeviceComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222322940B953005AE505 /* UIDeviceComplete.swift */; };
C662223A2940B953005AE505 /* Screen.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222332940B953005AE505 /* Screen.swift */; };
C662223B2940B959005AE505 /* Screen.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222332940B953005AE505 /* Screen.swift */; };
C662223C2940B959005AE505 /* DeviceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222D2940B953005AE505 /* DeviceModel.swift */; };
C662223D2940B959005AE505 /* UIDeviceComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222322940B953005AE505 /* UIDeviceComplete.swift */; };
C662223E2940B959005AE505 /* UIDeviceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222E2940B953005AE505 /* UIDeviceExtensions.swift */; };
C662223F2940B959005AE505 /* DeviceFamily.swift in Sources */ = {isa = PBXBuildFile; fileRef = C662222F2940B953005AE505 /* DeviceFamily.swift */; };
C66222402940B959005AE505 /* Identifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222312940B953005AE505 /* Identifier.swift */; };
C66222412940B959005AE505 /* System.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66222302940B953005AE505 /* System.swift */; };
C6629244254B302000620D6F /* FeatureFlag.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6629243254B302000620D6F /* FeatureFlag.swift */; };
C6629251254B319D00620D6F /* FeatureFlag.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6629243254B302000620D6F /* FeatureFlag.swift */; };
C676AD5B1EC9679000523FF3 /* InstructionsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C676AD5A1EC9679000523FF3 /* InstructionsController.swift */; };
Expand Down Expand Up @@ -247,6 +261,13 @@
C655E8551EC5559200B12BE4 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
C655E8591EC558D000B12BE4 /* HomeController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeController.swift; sourceTree = "<group>"; };
C655E85C1EC55D0800B12BE4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = HostingApp/Base.lproj/Localizable.strings; sourceTree = "<group>"; };
C662222D2940B953005AE505 /* DeviceModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceModel.swift; sourceTree = "<group>"; };
C662222E2940B953005AE505 /* UIDeviceExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIDeviceExtensions.swift; sourceTree = "<group>"; };
C662222F2940B953005AE505 /* DeviceFamily.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceFamily.swift; sourceTree = "<group>"; };
C66222302940B953005AE505 /* System.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = System.swift; sourceTree = "<group>"; };
C66222312940B953005AE505 /* Identifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Identifier.swift; sourceTree = "<group>"; };
C66222322940B953005AE505 /* UIDeviceComplete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIDeviceComplete.swift; sourceTree = "<group>"; };
C66222332940B953005AE505 /* Screen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Screen.swift; sourceTree = "<group>"; };
C6629243254B302000620D6F /* FeatureFlag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlag.swift; sourceTree = "<group>"; };
C676AD5A1EC9679000523FF3 /* InstructionsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstructionsController.swift; sourceTree = "<group>"; };
C676AD5E1EC985EB00523FF3 /* Strings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Strings.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -378,6 +399,7 @@
4E807D8A19461D9000D875D1 = {
isa = PBXGroup;
children = (
C66222282940B722005AE505 /* Shared */,
4E807D9519461D9000D875D1 /* HostingApp */,
4E807DBA19461DC700D875D1 /* Keyboard */,
C6F249301F736DCE00840F2B /* BaseKeyboard */,
Expand Down Expand Up @@ -558,6 +580,28 @@
path = Pods;
sourceTree = "<group>";
};
C66222282940B722005AE505 /* Shared */ = {
isa = PBXGroup;
children = (
C662222C2940B921005AE505 /* UIDeviceComplete */,
);
path = Shared;
sourceTree = "<group>";
};
C662222C2940B921005AE505 /* UIDeviceComplete */ = {
isa = PBXGroup;
children = (
C662222F2940B953005AE505 /* DeviceFamily.swift */,
C662222D2940B953005AE505 /* DeviceModel.swift */,
C66222312940B953005AE505 /* Identifier.swift */,
C66222332940B953005AE505 /* Screen.swift */,
C66222302940B953005AE505 /* System.swift */,
C66222322940B953005AE505 /* UIDeviceComplete.swift */,
C662222E2940B953005AE505 /* UIDeviceExtensions.swift */,
);
path = UIDeviceComplete;
sourceTree = "<group>";
};
C676AD621EC98C0F00523FF3 /* Controllers */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -896,7 +940,6 @@
"${PODS_ROOT}/Target Support Files/Pods-HostingApp/Pods-HostingApp-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Sentry/Sentry.framework",
"${BUILT_PRODUCTS_DIR}/UIDeviceComplete/UIDeviceComplete.framework",
"${BUILT_PRODUCTS_DIR}/PahkatClient/PahkatClient.framework",
"${BUILT_PRODUCTS_DIR}/DivvunSpell/DivvunSpell.framework",
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
Expand All @@ -905,7 +948,6 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sentry.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UIDeviceComplete.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PahkatClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DivvunSpell.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
Expand Down Expand Up @@ -984,7 +1026,9 @@
files = (
99989FBA2417CFBA00EF8CD3 /* BaseSettingsViewController.swift in Sources */,
9904409523FAC0C50063064E /* DisclosureCell.swift in Sources */,
C66222342940B953005AE505 /* DeviceModel.swift in Sources */,
C676AD5B1EC9679000523FF3 /* InstructionsController.swift in Sources */,
C66222362940B953005AE505 /* DeviceFamily.swift in Sources */,
99989FB72417990E00EF8CD3 /* UserDictionary+Test.swift in Sources */,
C6B638441EDF81B200A6ECB2 /* SimpleButton.swift in Sources */,
C63EE0FF2361D86800A1E15A /* MenuButton.swift in Sources */,
Expand All @@ -996,16 +1040,21 @@
C655E8541EC5551100B12BE4 /* Extensions.swift in Sources */,
C691A0E723682C8B00085AC3 /* TestingController.swift in Sources */,
C65430B41EC94BF0007FC053 /* LanguagesController.swift in Sources */,
C66222392940B953005AE505 /* UIDeviceComplete.swift in Sources */,
C66222382940B953005AE505 /* Identifier.swift in Sources */,
999790AC23F2B4E8003F7885 /* UserDictionaryViewController.swift in Sources */,
999790BA23F40E4F003F7885 /* WordContext.swift in Sources */,
999790B623F2F536003F7885 /* WordContextView.swift in Sources */,
C65430B01EC94BC7007FC053 /* InstructionsView.swift in Sources */,
4EF16F9B19D2550D0076AFCB /* AppDelegate.swift in Sources */,
997021052416DF8C00A81A27 /* KeyboardLocale+AllLocales.swift in Sources */,
C66222372940B953005AE505 /* System.swift in Sources */,
C676AD5F1EC985EB00523FF3 /* Strings.swift in Sources */,
C655E85A1EC558D000B12BE4 /* HomeController.swift in Sources */,
99DA1847240D1010003E7353 /* UserDictionaryService.swift in Sources */,
9904409223F84BDC0063064E /* SettingsViewController.swift in Sources */,
C66222352940B953005AE505 /* UIDeviceExtensions.swift in Sources */,
C662223A2940B953005AE505 /* Screen.swift in Sources */,
C6A2E01F1EDFAAA2006BAB69 /* AboutView.swift in Sources */,
9904409B23FBDC200063064E /* KeyboardLocale.swift in Sources */,
C6996B5722FC2C93007EBC3D /* Utils.swift in Sources */,
Expand Down Expand Up @@ -1043,20 +1092,25 @@
buildActionMask = 2147483647;
files = (
997550B723EAC631004ED6A5 /* UserDictionary.swift in Sources */,
C66222402940B959005AE505 /* Identifier.swift in Sources */,
99DD30F623E307430065E8D8 /* Audio.swift in Sources */,
C6996B5322FB06FA007EBC3D /* DeadKeyHandler.swift in Sources */,
C6996B5E22FC3257007EBC3D /* SpellBanner.swift in Sources */,
999790BB23F40E4F003F7885 /* WordContext.swift in Sources */,
C6996B5C22FC2D3E007EBC3D /* CursorContext.swift in Sources */,
C6996B5A22FC2CC7007EBC3D /* SystemKeys.swift in Sources */,
C6F249461F736E1400840F2B /* KeyboardDefinition.swift in Sources */,
C662223D2940B959005AE505 /* UIDeviceComplete.swift in Sources */,
99460238243B27140027C1CC /* InputContext.swift in Sources */,
99074EE82422383700075480 /* SpellBannerFlowLayout.swift in Sources */,
C662223E2940B959005AE505 /* UIDeviceExtensions.swift in Sources */,
C6629251254B319D00620D6F /* FeatureFlag.swift in Sources */,
C6F249471F736E1A00840F2B /* KeyboardViewController.swift in Sources */,
999C30172428E91000E127A6 /* BannerView.swift in Sources */,
C61829B8254225B100620D6F /* KeyboardLocale+AllLocales.swift in Sources */,
99DA184424095AF0003E7353 /* UserDictionaryService.swift in Sources */,
C66222412940B959005AE505 /* System.swift in Sources */,
C662223B2940B959005AE505 /* Screen.swift in Sources */,
C649D3D4234B7C8000EF4273 /* KeyView.swift in Sources */,
991EE55023D9AB4700DC3677 /* ViewDebugger.swift in Sources */,
FDAF59AF22F9CD0700F7C9FC /* KeyOverlayView.swift in Sources */,
Expand All @@ -1066,6 +1120,7 @@
FDAF59A522F9CCE100F7C9FC /* Theme.swift in Sources */,
999C30132428E6C000E127A6 /* UpdateBanner.swift in Sources */,
99094698243674F20070AEB6 /* SpellerAvailableBanner.swift in Sources */,
C662223F2940B959005AE505 /* DeviceFamily.swift in Sources */,
99074EEB2422387A00075480 /* SpellBannerSeparatorView.swift in Sources */,
99074EE4242230F000075480 /* SpellBannerCell.swift in Sources */,
99C4E56724320F49005F8C8A /* IPC.swift in Sources */,
Expand All @@ -1074,6 +1129,7 @@
999C30152428E70600E127A6 /* UpdateBannerView.swift in Sources */,
FDBD09C52333A56800303152 /* SplitKeyboard.swift in Sources */,
99074EF62423AAA300075480 /* SpellBannerView.swift in Sources */,
C662223C2940B959005AE505 /* DeviceModel.swift in Sources */,
99074EF224224B4400075480 /* Banner.swift in Sources */,
9930BD90243CD2BF00C0EF7F /* FolderWatcher.swift in Sources */,
FDAF59A922F9CCF200F7C9FC /* LongPressController.swift in Sources */,
Expand Down
5 changes: 1 addition & 4 deletions Keyboard/Controllers/KeyboardViewController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import UIKit
import UIDeviceComplete
import DivvunSpell

protocol KeyboardViewProvider {
Expand Down Expand Up @@ -87,10 +86,8 @@ open class KeyboardViewController: UIInputViewController {
return 405.0
case .iPadPro12_9Inch, .iPadPro12_9Inch_SecondGen, .iPadPro12_9Inch_ThirdGen:
return 405.0
case .iPadSevenGen:
return 405.0
default:
let sizeInches = UIDevice.current.dc.screenSize.sizeInches ?? Screen.maxSupportedInches
let sizeInches = UIDevice.current.dc.screenSize.sizeInches ?? 12.9

if sizeInches < 11 {
return landscapeDeviceHeight / 2.0
Expand Down
1 change: 0 additions & 1 deletion Keyboard/Models/KeyboardDefinition.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import UIKit
import UIDeviceComplete

public indirect enum TransformTree: Codable {
case tree([String: TransformTree])
Expand Down
2 changes: 1 addition & 1 deletion Keyboard/Models/SystemKeys.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Foundation
import UIKit
import UIDeviceComplete

final class SystemKeys {
static func systemKeyRowsForCurrentDevice(spaceName: String,
Expand All @@ -12,6 +11,7 @@ final class SystemKeys {

// Left side of space bar
if !UIDevice.current.dc.deviceModel.hasNotch {

if isIPad && (UIDevice.current.dc.screenSize.sizeInches ?? Screen.maxSupportedInches) >= 11.0 {
keys.append(KeyDefinition(type: .keyboard, size: CGSize(width: 1.25, height: 1.0)))
keys.append(KeyDefinition(type: .symbols, size: CGSize(width: 1.25, height: 1.0)))
Expand Down
1 change: 0 additions & 1 deletion Keyboard/Models/Theme.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Foundation
import UIKit
import UIDeviceComplete

// swiftlint:disable:next type_name
struct _Theme {
Expand Down
1 change: 0 additions & 1 deletion Keyboard/Utility/Utils.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Foundation
import UIKit
import UIDeviceComplete

extension UIDevice {
public var systemMajorVersion: Int {
Expand Down
1 change: 0 additions & 1 deletion Keyboard/Views/KeyView.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import UIDeviceComplete

final class KeyView: UIView {
private let key: KeyDefinition
Expand Down
2 changes: 0 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ use_frameworks!
target 'BaseKeyboard' do
pod 'Sentry', '=7.3.0'
pod 'DivvunSpell', :http => "https://github.com/divvun/divvunspell-sdk-swift/releases/download/v1.0.0-beta.3/cargo-pod.tgz"
pod 'UIDeviceComplete', :git => "https://github.com/bbqsrc/UIDeviceComplete"
pod 'SwiftLint'
pod 'SQLite.swift', '~> 0.12.0'
pod 'RxSwift', '~> 5.1.1'
end

target 'HostingApp' do
pod 'Sentry', '=7.3.0'
pod 'UIDeviceComplete', :git => "https://github.com/bbqsrc/UIDeviceComplete"
pod 'SwiftLint'
pod 'SQLite.swift', '~> 0.12.0'
pod 'PahkatClient', :http => "https://github.com/divvun/pahkat-client-sdk-swift/releases/download/v0.2.0/cargo-pod.tgz"
Expand Down
10 changes: 1 addition & 9 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ PODS:
- SQLite.swift/standard (= 0.12.2)
- SQLite.swift/standard (0.12.2)
- SwiftLint (0.43.1)
- UIDeviceComplete (2.6.6)

DEPENDENCIES:
- "DivvunSpell (from `{:http=>\"https://github.com/divvun/divvunspell-sdk-swift/releases/download/v1.0.0-beta.3/cargo-pod.tgz\"}`)"
Expand All @@ -18,7 +17,6 @@ DEPENDENCIES:
- Sentry (= 7.3.0)
- SQLite.swift (~> 0.12.0)
- SwiftLint
- UIDeviceComplete (from `https://github.com/bbqsrc/UIDeviceComplete`)

SPEC REPOS:
trunk:
Expand All @@ -32,17 +30,12 @@ EXTERNAL SOURCES:
:http: https://github.com/divvun/divvunspell-sdk-swift/releases/download/v1.0.0-beta.3/cargo-pod.tgz
PahkatClient:
:http: https://github.com/divvun/pahkat-client-sdk-swift/releases/download/v0.2.0/cargo-pod.tgz
UIDeviceComplete:
:git: https://github.com/bbqsrc/UIDeviceComplete

CHECKOUT OPTIONS:
DivvunSpell:
:http: https://github.com/divvun/divvunspell-sdk-swift/releases/download/v1.0.0-beta.3/cargo-pod.tgz
PahkatClient:
:http: https://github.com/divvun/pahkat-client-sdk-swift/releases/download/v0.2.0/cargo-pod.tgz
UIDeviceComplete:
:commit: af940b2ea4231b3295cd4cb2d59d115afa0d102f
:git: https://github.com/bbqsrc/UIDeviceComplete

SPEC CHECKSUMS:
DivvunSpell: a49ab7b8f0dba02062619bfe801e371f0671c32a
Expand All @@ -51,8 +44,7 @@ SPEC CHECKSUMS:
Sentry: 9a4e621430e2dae4477d791f2f7e905720b6efbf
SQLite.swift: d2b4642190917051ce6bd1d49aab565fe794eea3
SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52
UIDeviceComplete: c89b90393fb2a3446f5e0e86eca0c02d6f8e09f0

PODFILE CHECKSUM: 3bdac8799e8bb6736f7c98536eb9da1726a1e29d
PODFILE CHECKSUM: 3b18f71f7f09d4be8c66fffcf23c2f4fb2f5b022

COCOAPODS: 1.10.0
43 changes: 43 additions & 0 deletions Shared/UIDeviceComplete/DeviceFamily.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// DeviceFamily.swift
//
// Copyright (c) 2017-2019 Nicholas Maccharoli
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

public enum DeviceFamily: String {

case iPhone
case iPod
case iPad
case unknown

public init(rawValue: String) {
switch rawValue {
case "iPhone":
self = .iPhone
case "iPod":
self = .iPod
case "iPad":
self = .iPad
default:
self = .unknown
}
}
}
Loading

0 comments on commit a7b5c5e

Please sign in to comment.