Skip to content

Commit f2e4fa3

Browse files
author
Chad Cummings
committed
Upgrades to project and code to allow for Swift 4, SDK iOS11.
Target iOS 9.3. Add support for UPC-A. Add all new barcode types to the metadata array.
1 parent b255880 commit f2e4fa3

16 files changed

Lines changed: 133 additions & 79 deletions

File tree

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
osx_image: xcode8
2-
language: objective-c
1+
osx_image: xcode9
2+
language: swift
33

44
script:
55
- xcodebuild clean build -project BarcodeScanner.xcodeproj -scheme "BarcodeScanner-iOS" -sdk iphonesimulator

BarcodeScanner.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Pod::Spec.new do |s|
1111
}
1212
s.social_media_url = 'https://twitter.com/hyperoslo'
1313

14-
s.platform = :ios, '8.0'
14+
s.platform = :ios, '9.3'
1515
s.requires_arc = true
1616

1717
s.source_files = 'Sources/**/*'
1818
s.resource_bundles = { 'BarcodeScanner' => ['Images/*.{png}'] , 'Localization' => ['Localization/*.lproj/Localizable.strings']}
1919

2020
s.frameworks = 'UIKit', 'AVFoundation'
2121

22-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
22+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
2323
end

BarcodeScanner.xcodeproj/project.pbxproj

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

99
/* Begin PBXBuildFile section */
@@ -133,7 +133,7 @@
133133
isa = PBXProject;
134134
attributes = {
135135
LastSwiftUpdateCheck = 0720;
136-
LastUpgradeCheck = 0800;
136+
LastUpgradeCheck = 0900;
137137
ORGANIZATIONNAME = "Hyper Interaktiv AS";
138138
TargetAttributes = {
139139
D5B2E89E1C3A780C00C0327D = {
@@ -142,7 +142,7 @@
142142
};
143143
};
144144
buildConfigurationList = D5B2E8991C3A780C00C0327D /* Build configuration list for PBXProject "BarcodeScanner" */;
145-
compatibilityVersion = "Xcode 3.2";
145+
compatibilityVersion = "Xcode 8.0";
146146
developmentRegion = English;
147147
hasScannedForEncodings = 0;
148148
knownRegions = (
@@ -197,14 +197,20 @@
197197
CLANG_CXX_LIBRARY = "libc++";
198198
CLANG_ENABLE_MODULES = YES;
199199
CLANG_ENABLE_OBJC_ARC = YES;
200+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
200201
CLANG_WARN_BOOL_CONVERSION = YES;
202+
CLANG_WARN_COMMA = YES;
201203
CLANG_WARN_CONSTANT_CONVERSION = YES;
202204
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
203205
CLANG_WARN_EMPTY_BODY = YES;
204206
CLANG_WARN_ENUM_CONVERSION = YES;
205207
CLANG_WARN_INFINITE_RECURSION = YES;
206208
CLANG_WARN_INT_CONVERSION = YES;
209+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
210+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
207211
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
212+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
213+
CLANG_WARN_STRICT_PROTOTYPES = YES;
208214
CLANG_WARN_SUSPICIOUS_MOVE = YES;
209215
CLANG_WARN_UNREACHABLE_CODE = YES;
210216
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -228,7 +234,7 @@
228234
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
229235
GCC_WARN_UNUSED_FUNCTION = YES;
230236
GCC_WARN_UNUSED_VARIABLE = YES;
231-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
237+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
232238
MTL_ENABLE_DEBUG_INFO = YES;
233239
ONLY_ACTIVE_ARCH = YES;
234240
SDKROOT = iphoneos;
@@ -247,14 +253,20 @@
247253
CLANG_CXX_LIBRARY = "libc++";
248254
CLANG_ENABLE_MODULES = YES;
249255
CLANG_ENABLE_OBJC_ARC = YES;
256+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
250257
CLANG_WARN_BOOL_CONVERSION = YES;
258+
CLANG_WARN_COMMA = YES;
251259
CLANG_WARN_CONSTANT_CONVERSION = YES;
252260
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
253261
CLANG_WARN_EMPTY_BODY = YES;
254262
CLANG_WARN_ENUM_CONVERSION = YES;
255263
CLANG_WARN_INFINITE_RECURSION = YES;
256264
CLANG_WARN_INT_CONVERSION = YES;
265+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
266+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
257267
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
268+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
269+
CLANG_WARN_STRICT_PROTOTYPES = YES;
258270
CLANG_WARN_SUSPICIOUS_MOVE = YES;
259271
CLANG_WARN_UNREACHABLE_CODE = YES;
260272
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -272,7 +284,7 @@
272284
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273285
GCC_WARN_UNUSED_FUNCTION = YES;
274286
GCC_WARN_UNUSED_VARIABLE = YES;
275-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
287+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
276288
MTL_ENABLE_DEBUG_INFO = NO;
277289
SDKROOT = iphoneos;
278290
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -292,19 +304,15 @@
292304
DYLIB_COMPATIBILITY_VERSION = 1;
293305
DYLIB_CURRENT_VERSION = 1;
294306
DYLIB_INSTALL_NAME_BASE = "@rpath";
295-
FRAMEWORK_SEARCH_PATHS = (
296-
"$(inherited)",
297-
"$(PROJECT_DIR)/Carthage/Build/iOS",
298-
);
299307
INFOPLIST_FILE = "$(SRCROOT)/BarcodeScanner/Info-iOS.plist";
300308
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
301-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
309+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
302310
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
303311
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.BarcodeScanner-iOS";
304312
PRODUCT_NAME = BarcodeScanner;
305313
SKIP_INSTALL = YES;
306314
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
307-
SWIFT_VERSION = 3.0;
315+
SWIFT_VERSION = 4.0;
308316
};
309317
name = Debug;
310318
};
@@ -317,18 +325,14 @@
317325
DYLIB_COMPATIBILITY_VERSION = 1;
318326
DYLIB_CURRENT_VERSION = 1;
319327
DYLIB_INSTALL_NAME_BASE = "@rpath";
320-
FRAMEWORK_SEARCH_PATHS = (
321-
"$(inherited)",
322-
"$(PROJECT_DIR)/Carthage/Build/iOS",
323-
);
324328
INFOPLIST_FILE = "$(SRCROOT)/BarcodeScanner/Info-iOS.plist";
325329
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
326-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
330+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
327331
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
328332
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.BarcodeScanner-iOS";
329333
PRODUCT_NAME = BarcodeScanner;
330334
SKIP_INSTALL = YES;
331-
SWIFT_VERSION = 3.0;
335+
SWIFT_VERSION = 4.0;
332336
};
333337
name = Release;
334338
};

BarcodeScanner.xcodeproj/xcshareddata/xcschemes/BarcodeScanner-iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Example/BarcodeScannerExample/BarcodeScannerExample.xcodeproj/project.pbxproj

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,11 @@
118118
isa = PBXProject;
119119
attributes = {
120120
LastSwiftUpdateCheck = 0720;
121-
LastUpgradeCheck = 0800;
121+
LastUpgradeCheck = 0900;
122122
ORGANIZATIONNAME = "Hyper Interaktiv AS";
123123
TargetAttributes = {
124124
D50BE3F41C9FE8870000A34C = {
125125
CreatedOnToolsVersion = 7.2.1;
126-
DevelopmentTeam = LG4DBY4QF9;
127126
LastSwiftMigration = 0800;
128127
};
129128
};
@@ -210,13 +209,16 @@
210209
files = (
211210
);
212211
inputPaths = (
212+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
213+
"${PODS_ROOT}/Manifest.lock",
213214
);
214215
name = "[CP] Check Pods Manifest.lock";
215216
outputPaths = (
217+
"$(DERIVED_FILE_DIR)/Pods-BarcodeScannerExample-checkManifestLockResult.txt",
216218
);
217219
runOnlyForDeploymentPostprocessing = 0;
218220
shellPath = /bin/sh;
219-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
221+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
220222
showEnvVarsInLog = 0;
221223
};
222224
C6637BE832A43C8F49FCF84D /* 📦 Embed Pods Frameworks */ = {
@@ -240,9 +242,12 @@
240242
files = (
241243
);
242244
inputPaths = (
245+
"${SRCROOT}/Pods/Target Support Files/Pods-BarcodeScannerExample/Pods-BarcodeScannerExample-frameworks.sh",
246+
"${BUILT_PRODUCTS_DIR}/BarcodeScanner/BarcodeScanner.framework",
243247
);
244248
name = "[CP] Embed Pods Frameworks";
245249
outputPaths = (
250+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BarcodeScanner.framework",
246251
);
247252
runOnlyForDeploymentPostprocessing = 0;
248253
shellPath = /bin/sh;
@@ -284,14 +289,20 @@
284289
CLANG_CXX_LIBRARY = "libc++";
285290
CLANG_ENABLE_MODULES = YES;
286291
CLANG_ENABLE_OBJC_ARC = YES;
292+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
287293
CLANG_WARN_BOOL_CONVERSION = YES;
294+
CLANG_WARN_COMMA = YES;
288295
CLANG_WARN_CONSTANT_CONVERSION = YES;
289296
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
290297
CLANG_WARN_EMPTY_BODY = YES;
291298
CLANG_WARN_ENUM_CONVERSION = YES;
292299
CLANG_WARN_INFINITE_RECURSION = YES;
293300
CLANG_WARN_INT_CONVERSION = YES;
301+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
302+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
294303
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
304+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
305+
CLANG_WARN_STRICT_PROTOTYPES = YES;
295306
CLANG_WARN_SUSPICIOUS_MOVE = YES;
296307
CLANG_WARN_UNREACHABLE_CODE = YES;
297308
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -314,12 +325,12 @@
314325
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
315326
GCC_WARN_UNUSED_FUNCTION = YES;
316327
GCC_WARN_UNUSED_VARIABLE = YES;
317-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
328+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
318329
MTL_ENABLE_DEBUG_INFO = YES;
319330
ONLY_ACTIVE_ARCH = YES;
320331
SDKROOT = iphoneos;
321332
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
322-
SWIFT_VERSION = 3.0;
333+
SWIFT_VERSION = 4.0;
323334
};
324335
name = Debug;
325336
};
@@ -332,14 +343,20 @@
332343
CLANG_CXX_LIBRARY = "libc++";
333344
CLANG_ENABLE_MODULES = YES;
334345
CLANG_ENABLE_OBJC_ARC = YES;
346+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
335347
CLANG_WARN_BOOL_CONVERSION = YES;
348+
CLANG_WARN_COMMA = YES;
336349
CLANG_WARN_CONSTANT_CONVERSION = YES;
337350
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
338351
CLANG_WARN_EMPTY_BODY = YES;
339352
CLANG_WARN_ENUM_CONVERSION = YES;
340353
CLANG_WARN_INFINITE_RECURSION = YES;
341354
CLANG_WARN_INT_CONVERSION = YES;
355+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
356+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
342357
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
358+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
359+
CLANG_WARN_STRICT_PROTOTYPES = YES;
343360
CLANG_WARN_SUSPICIOUS_MOVE = YES;
344361
CLANG_WARN_UNREACHABLE_CODE = YES;
345362
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -356,11 +373,11 @@
356373
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
357374
GCC_WARN_UNUSED_FUNCTION = YES;
358375
GCC_WARN_UNUSED_VARIABLE = YES;
359-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
376+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
360377
MTL_ENABLE_DEBUG_INFO = NO;
361378
SDKROOT = iphoneos;
362379
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
363-
SWIFT_VERSION = 3.0;
380+
SWIFT_VERSION = 4.0;
364381
VALIDATE_PRODUCT = YES;
365382
};
366383
name = Release;
@@ -373,12 +390,15 @@
373390
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
374391
CODE_SIGN_IDENTITY = "iPhone Developer";
375392
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
393+
DEVELOPMENT_TEAM = "";
376394
INFOPLIST_FILE = BarcodeScannerExample/Info.plist;
395+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
377396
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
378397
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample2;
379398
PRODUCT_NAME = "$(TARGET_NAME)";
380399
PROVISIONING_PROFILE = "";
381-
SWIFT_VERSION = 3.0;
400+
SWIFT_VERSION = 4.0;
401+
TARGETED_DEVICE_FAMILY = "1,2";
382402
};
383403
name = Debug;
384404
};
@@ -390,12 +410,15 @@
390410
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
391411
CODE_SIGN_IDENTITY = "iPhone Developer";
392412
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
413+
DEVELOPMENT_TEAM = "";
393414
INFOPLIST_FILE = BarcodeScannerExample/Info.plist;
415+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
394416
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
395417
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample2;
396418
PRODUCT_NAME = "$(TARGET_NAME)";
397419
PROVISIONING_PROFILE = "";
398-
SWIFT_VERSION = 3.0;
420+
SWIFT_VERSION = 4.0;
421+
TARGETED_DEVICE_FAMILY = "1,2";
399422
};
400423
name = Release;
401424
};

Example/BarcodeScannerExample/BarcodeScannerExample/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
22
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
313
{
414
"idiom" : "iphone",
515
"size" : "29x29",
@@ -29,6 +39,11 @@
2939
"idiom" : "iphone",
3040
"size" : "60x60",
3141
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"size" : "1024x1024",
46+
"scale" : "1x"
3247
}
3348
],
3449
"info" : {

Example/BarcodeScannerExample/BarcodeScannerExample/Info.plist

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
25-
<key>NSPhotoLibraryUsageDescription</key>
26-
<string>This app uses the library for testing purposes</string>
27-
<key>NSCameraUsageDescription</key>
28-
<string>This app uses the camera for testing purposes</string>
25+
<key>NSCameraUsageDescription</key>
26+
<string>This app uses the camera for testing purposes</string>
27+
<key>NSPhotoLibraryUsageDescription</key>
28+
<string>This app uses the library for testing purposes</string>
2929
<key>UILaunchStoryboardName</key>
3030
<string>LaunchScreen</string>
3131
<key>UIRequiredDeviceCapabilities</key>
@@ -39,6 +39,9 @@
3939
<key>UISupportedInterfaceOrientations</key>
4040
<array>
4141
<string>UIInterfaceOrientationPortrait</string>
42+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
43+
<string>UIInterfaceOrientationLandscapeLeft</string>
44+
<string>UIInterfaceOrientationLandscapeRight</string>
4245
</array>
4346
</dict>
4447
</plist>

0 commit comments

Comments
 (0)