Skip to content

Commit c9d58db

Browse files
author
Eric Wu
committed
update for xcode 14.1
1 parent 53ccbc3 commit c9d58db

21 files changed

+178
-121
lines changed

‎CRBoostSwift.podspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TODO: Add long description of the pod here.
2929
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
3030
s.swift_version = '5.0'
3131

32-
s.ios.deployment_target = '9.0'
32+
s.ios.deployment_target = '11.0'
3333

3434
s.source_files = 'CRBoostSwift/Classes/*.{swift}'
3535
#s.xcconfig = {'OTHER_LDFLAGS' => '-ObjC'}

‎CRBoostSwift/Classes/CRMacros.swift‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public let IS_IOS10 = (kSystemVersion >= Float(10.0) && kSystemVersion <= Float(
123123
public let IS_IOS11 = (kSystemVersion >= Float(11.0) && kSystemVersion <= Float(12.0))
124124
public let IS_IOS12 = (kSystemVersion >= Float(12.0) && kSystemVersion <= Float(13.0))
125125
public let IS_IOS13 = (kSystemVersion >= Float(13.0) && kSystemVersion <= Float(14.0))
126+
public let IS_IOS14 = (kSystemVersion >= Float(14.0) && kSystemVersion <= Float(15.0))
127+
public let IS_IOS15 = (kSystemVersion >= Float(15.0) && kSystemVersion <= Float(16.0))
128+
public let IS_IOS16 = (kSystemVersion >= Float(16.0) && kSystemVersion <= Float(17.0))
126129

127130
// application status
128131
public let CRAPP_IN_BACKGROUND = UIApplication.shared.applicationState == UIApplication.State.background
@@ -139,7 +142,14 @@ public func CRDisplayNetworkIndicator(flag: Bool) {
139142

140143
public let CRAppBuild = Bundle.main.infoDictionary![kCFBundleVersionKey as String] as! String
141144
public let CRAppVersionShort = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
142-
public let CRAppName = Bundle.main.infoDictionary!["CFBundleDisplayName"] as! String
145+
public let CRAppName: String = {
146+
var appName = Bundle.main.infoDictionary!["CFBundleDisplayName"]
147+
if appName == nil {
148+
appName = Bundle.main.infoDictionary![kCFBundleNameKey as String]
149+
}
150+
return appName as! String
151+
152+
}()
143153

144154
public let CRIdfa: String = {
145155
var idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
@@ -160,6 +170,9 @@ public let CRIdfv = UIDevice.current.identifierForVendor?.uuidString
160170
public let CRSharedApp = UIApplication.shared
161171
public let CRAppDelegate = CRSharedApp.delegate!
162172

173+
@available(iOS 13.0, *)
174+
public let CRCurrentTheme = UITraitCollection.current.userInterfaceStyle
175+
163176
public let CRNotificationCenter = NotificationCenter.default
164177
public let CRCurrentDevice = UIDevice.current
165178
public let CRBundle = Bundle.main

‎CRBoostSwift/Classes/CRMath.swift‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,18 @@ public func CRScreenRect() -> CGRect {
194194

195195
@discardableResult
196196
public func CRIsIphoneX() -> Bool {
197-
return (CRScreenSize().equalTo(CGSize(width: 375, height: 812)) || // X or Xs
198-
CRScreenSize().equalTo(CGSize(width: 812, height: 375)) || // X or Xs
199-
CRScreenSize().equalTo(CGSize(width: 414, height: 896)) || // iPhone Xs Max | Xr
200-
CRScreenSize().equalTo(CGSize(width: 896, height: 414)) // iPhone Xs Max | Xr
201-
)
197+
var result = false
198+
199+
if UIDevice.current.userInterfaceIdiom != .phone {
200+
return result
201+
}
202+
let size = UIScreen.main.bounds.size
203+
let notchValue = size.width / size.height * 100
204+
let mainWindow = CRMainWindow()
205+
if mainWindow.safeAreaInsets.bottom > 0.0 || notchValue == 216 || notchValue == 46 {
206+
result = true
207+
}
208+
return result
202209
}
203210

204211
@discardableResult

‎Example/CRBoostSwift.xcodeproj/project.pbxproj‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 55;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -156,7 +156,7 @@
156156
};
157157
};
158158
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "CRBoostSwift" */;
159-
compatibilityVersion = "Xcode 3.2";
159+
compatibilityVersion = "Xcode 13.0";
160160
developmentRegion = en;
161161
hasScannedForEncodings = 0;
162162
knownRegions = (
@@ -214,13 +214,12 @@
214214
buildActionMask = 2147483647;
215215
files = (
216216
);
217-
inputPaths = (
218-
"${PODS_ROOT}/Target Support Files/Pods-CRBoostSwift_Example/Pods-CRBoostSwift_Example-frameworks.sh",
219-
"${BUILT_PRODUCTS_DIR}/CRBoostSwift/CRBoostSwift.framework",
217+
inputFileListPaths = (
218+
"${PODS_ROOT}/Target Support Files/Pods-CRBoostSwift_Example/Pods-CRBoostSwift_Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
220219
);
221220
name = "[CP] Embed Pods Frameworks";
222-
outputPaths = (
223-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CRBoostSwift.framework",
221+
outputFileListPaths = (
222+
"${PODS_ROOT}/Target Support Files/Pods-CRBoostSwift_Example/Pods-CRBoostSwift_Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
224223
);
225224
runOnlyForDeploymentPostprocessing = 0;
226225
shellPath = /bin/sh;
@@ -361,7 +360,8 @@
361360
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
362361
MTL_ENABLE_DEBUG_INFO = NO;
363362
SDKROOT = iphoneos;
364-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
363+
SWIFT_COMPILATION_MODE = wholemodule;
364+
SWIFT_OPTIMIZATION_LEVEL = "-O";
365365
VALIDATE_PRODUCT = YES;
366366
};
367367
name = Release;
@@ -375,7 +375,10 @@
375375
CODE_SIGN_STYLE = Manual;
376376
DEVELOPMENT_TEAM = H843PBVDG6;
377377
INFOPLIST_FILE = CRBoostSwift/Info.plist;
378-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
378+
LD_RUNPATH_SEARCH_PATHS = (
379+
"$(inherited)",
380+
"@executable_path/Frameworks",
381+
);
379382
MODULE_NAME = ExampleApp;
380383
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -D DEBUG";
381384
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
@@ -394,7 +397,10 @@
394397
CODE_SIGN_STYLE = Manual;
395398
DEVELOPMENT_TEAM = "";
396399
INFOPLIST_FILE = CRBoostSwift/Info.plist;
397-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
400+
LD_RUNPATH_SEARCH_PATHS = (
401+
"$(inherited)",
402+
"@executable_path/Frameworks",
403+
);
398404
MODULE_NAME = ExampleApp;
399405
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
400406
PRODUCT_NAME = "$(TARGET_NAME)";

‎Example/CRBoostSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata‎

100644100755
File mode changed.

‎Example/CRBoostSwift.xcodeproj/xcshareddata/xcschemes/CRBoostSwift-Example.xcscheme‎

100644100755
File mode changed.

‎Example/CRBoostSwift/ViewController.swift‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class ViewController: UIViewController {
2424
// print("1".retainDecimal(5))
2525
// print(".11".retainDecimal(5))
2626
// print(".".retainDecimal(5))
27+
28+
2729
print("".retainDecimal(5))
2830

2931
let test = "Hello USA 🇺🇸!!! Hello Brazil 🇧🇷!!!"

‎Example/Podfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
platform :ios, '12.0'
22
use_frameworks!
3+
source "https://github.com/CocoaPods/Specs.git"
4+
inhibit_all_warnings!
35

46
target 'CRBoostSwift_Example' do
57
pod 'CRBoostSwift', :path => '../'

‎Example/Podfile.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
CRBoostSwift: fb794a4d62feacaf2ac26b0ab8860ed99b8ce9cb
12+
CRBoostSwift: b1ce84ef755176c91fb682098e5364ea311096c9
1313

14-
PODFILE CHECKSUM: ebfc6892f66966e16f7838b1a3a345ea379a0874
14+
PODFILE CHECKSUM: d5a13b0977eec4d48a54817a82aef7e53b24db41
1515

16-
COCOAPODS: 1.10.0
16+
COCOAPODS: 1.11.3

‎Example/Pods/Local Podspecs/CRBoostSwift.podspec.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)