Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit e4b2ae0

Browse files
authored
Merge pull request #2 from PCAPredict/Swift-4.2
Swift 4.2
2 parents 1755d0f + 72a5b18 commit e4b2ae0

File tree

64 files changed

+2081
-2535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2081
-2535
lines changed

PCA-iOS-Lib.xcodeproj/project.pbxproj

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
AF6B36B41EFD93140016207D /* Frameworks */,
137137
AF6B36B51EFD93140016207D /* Headers */,
138138
AF6B36B61EFD93140016207D /* Resources */,
139-
59461ED7B36E3D406058B465 /* [CP] Copy Pods Resources */,
140139
);
141140
buildRules = (
142141
);
@@ -153,7 +152,7 @@
153152
AF6B36AF1EFD93140016207D /* Project object */ = {
154153
isa = PBXProject;
155154
attributes = {
156-
LastUpgradeCheck = 0830;
155+
LastUpgradeCheck = 1010;
157156
ORGANIZATIONNAME = Henrik;
158157
TargetAttributes = {
159158
AF6B36B71EFD93140016207D = {
@@ -192,34 +191,22 @@
192191
/* End PBXResourcesBuildPhase section */
193192

194193
/* Begin PBXShellScriptBuildPhase section */
195-
59461ED7B36E3D406058B465 /* [CP] Copy Pods Resources */ = {
196-
isa = PBXShellScriptBuildPhase;
197-
buildActionMask = 2147483647;
198-
files = (
199-
);
200-
inputPaths = (
201-
);
202-
name = "[CP] Copy Pods Resources";
203-
outputPaths = (
204-
);
205-
runOnlyForDeploymentPostprocessing = 0;
206-
shellPath = /bin/sh;
207-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PCA-iOS-Lib/Pods-PCA-iOS-Lib-resources.sh\"\n";
208-
showEnvVarsInLog = 0;
209-
};
210194
ADB11F31DF4B9C27280D27E5 /* [CP] Check Pods Manifest.lock */ = {
211195
isa = PBXShellScriptBuildPhase;
212196
buildActionMask = 2147483647;
213197
files = (
214198
);
215199
inputPaths = (
200+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
201+
"${PODS_ROOT}/Manifest.lock",
216202
);
217203
name = "[CP] Check Pods Manifest.lock";
218204
outputPaths = (
205+
"$(DERIVED_FILE_DIR)/Pods-PCA-iOS-Lib-checkManifestLockResult.txt",
219206
);
220207
runOnlyForDeploymentPostprocessing = 0;
221208
shellPath = /bin/sh;
222-
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";
209+
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";
223210
showEnvVarsInLog = 0;
224211
};
225212
/* End PBXShellScriptBuildPhase section */
@@ -253,15 +240,23 @@
253240
CLANG_CXX_LIBRARY = "libc++";
254241
CLANG_ENABLE_MODULES = YES;
255242
CLANG_ENABLE_OBJC_ARC = YES;
243+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
256244
CLANG_WARN_BOOL_CONVERSION = YES;
245+
CLANG_WARN_COMMA = YES;
257246
CLANG_WARN_CONSTANT_CONVERSION = YES;
247+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
258248
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
259249
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
260250
CLANG_WARN_EMPTY_BODY = YES;
261251
CLANG_WARN_ENUM_CONVERSION = YES;
262252
CLANG_WARN_INFINITE_RECURSION = YES;
263253
CLANG_WARN_INT_CONVERSION = YES;
254+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
255+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
256+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
264257
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
258+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
259+
CLANG_WARN_STRICT_PROTOTYPES = YES;
265260
CLANG_WARN_SUSPICIOUS_MOVE = YES;
266261
CLANG_WARN_UNREACHABLE_CODE = YES;
267262
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -291,6 +286,7 @@
291286
SDKROOT = iphoneos;
292287
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
293288
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
289+
SWIFT_VERSION = 4.2;
294290
TARGETED_DEVICE_FAMILY = "1,2";
295291
VERSIONING_SYSTEM = "apple-generic";
296292
VERSION_INFO_PREFIX = "";
@@ -307,15 +303,23 @@
307303
CLANG_CXX_LIBRARY = "libc++";
308304
CLANG_ENABLE_MODULES = YES;
309305
CLANG_ENABLE_OBJC_ARC = YES;
306+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
310307
CLANG_WARN_BOOL_CONVERSION = YES;
308+
CLANG_WARN_COMMA = YES;
311309
CLANG_WARN_CONSTANT_CONVERSION = YES;
310+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
312311
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
313312
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
314313
CLANG_WARN_EMPTY_BODY = YES;
315314
CLANG_WARN_ENUM_CONVERSION = YES;
316315
CLANG_WARN_INFINITE_RECURSION = YES;
317316
CLANG_WARN_INT_CONVERSION = YES;
317+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
318+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
319+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
318320
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
321+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
322+
CLANG_WARN_STRICT_PROTOTYPES = YES;
319323
CLANG_WARN_SUSPICIOUS_MOVE = YES;
320324
CLANG_WARN_UNREACHABLE_CODE = YES;
321325
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -337,6 +341,7 @@
337341
MTL_ENABLE_DEBUG_INFO = NO;
338342
SDKROOT = iphoneos;
339343
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
344+
SWIFT_VERSION = 4.2;
340345
TARGETED_DEVICE_FAMILY = "1,2";
341346
VALIDATE_PRODUCT = YES;
342347
VERSIONING_SYSTEM = "apple-generic";
@@ -362,7 +367,7 @@
362367
PRODUCT_NAME = PCAiOSLib;
363368
SKIP_INSTALL = YES;
364369
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
365-
SWIFT_VERSION = 3.0;
370+
SWIFT_VERSION = 4.2;
366371
};
367372
name = Debug;
368373
};
@@ -383,7 +388,7 @@
383388
PRODUCT_BUNDLE_IDENTIFIER = "com.pcapredict.captureplus.PCA-iOS-Lib";
384389
PRODUCT_NAME = PCAiOSLib;
385390
SKIP_INSTALL = YES;
386-
SWIFT_VERSION = 3.0;
391+
SWIFT_VERSION = 4.2;
387392
};
388393
name = Release;
389394
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

PCA-iOS-Lib/PCALookupViewController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public class PCALookupViewController: UIViewController, UITableViewDataSource, U
2525
}
2626

2727
@IBAction func searchValueChanged(_ sender: Any) {
28-
var newText: String = searchField.text!;
28+
let newText: String = searchField.text!;
2929

30-
let isBackspace = ((lastText ?? "").characters.count) > newText.characters.count;
30+
let isBackspace = ((lastText ?? "").count) > newText.count;
3131
if(isBackspace){
3232
currentItem = nil;
3333
}
@@ -51,8 +51,8 @@ public class PCALookupViewController: UIViewController, UITableViewDataSource, U
5151

5252
func bolden(text: NSString, highlight: NSString, isDescription: Bool)->NSAttributedString{
5353
//Create the new string and bold attribute to apply
54-
let attributedString = NSMutableAttributedString(string: text as String, attributes: [NSFontAttributeName:UIFont.systemFont(ofSize: 15.0)])
55-
let boldFontAttribute = [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 15.0)]
54+
let attributedString = NSMutableAttributedString(string: text as String, attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 15.0)])
55+
let boldFontAttribute = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15.0)]
5656

5757
//seperate the highlight array by semicolon first
5858
let highlightSeperateArr = highlight.components(separatedBy: ";");
@@ -70,7 +70,7 @@ public class PCALookupViewController: UIViewController, UITableViewDataSource, U
7070
//Loop though the highlights
7171
for h in highlightArr {
7272
//Seperate the highlights into start and end numbers, converting them to int
73-
let highlightNumbers = h.components(separatedBy: "-").flatMap { Int($0.trimmingCharacters(in: .whitespaces)) }
73+
let highlightNumbers = h.components(separatedBy: "-").compactMap { Int($0.trimmingCharacters(in: .whitespaces)) }
7474

7575
if (highlightNumbers.count == 2) {
7676
//Location is where the highlight should start from
@@ -265,23 +265,23 @@ public class PCALookupViewController: UIViewController, UITableViewDataSource, U
265265
}
266266
}
267267

268-
func keyboardWasShown(notification: NSNotification){
269-
if let keyboardSize = (notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
268+
@objc func keyboardWasShown(notification: NSNotification){
269+
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
270270
let insets = UIEdgeInsets.init(top: 0.0, left: 0.0, bottom: keyboardSize.height, right: 0.0);
271271
self.outputTable.contentInset = insets;
272272
self.outputTable.scrollIndicatorInsets = insets;
273273
}
274274
}
275275

276-
func keyboardWasHidden(notification: NSNotification){
276+
@objc func keyboardWasHidden(notification: NSNotification){
277277
let insets = UIEdgeInsets.zero
278278
self.outputTable.contentInset = insets;
279279
self.outputTable.scrollIndicatorInsets = insets;
280280
}
281281

282282
func registerForKeyboardNotifications(){
283-
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWasShown(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
284-
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWasHidden(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
283+
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWasShown(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil)
284+
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWasHidden(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil)
285285
}
286286

287287

PCAiOSLib.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
1414
s.summary = "The PCAiOSLib Cocoapod is an easy way to use the PCA Predict or Addressy type-ahead search technology within an iOS application."
1515
s.requires_arc = true
1616

17-
s.version = "1.0.3"
17+
s.version = "1.1.1"
1818

1919
s.license = { :type => "BSD", :file => "LICENSE" }
2020

@@ -25,8 +25,8 @@ Pod::Spec.new do |s|
2525
s.source = { :git => "https://github.com/PCAPredict/PCAiOSLib.git", :tag => "#{s.version}"}
2626

2727
s.framework = "UIKit"
28-
s.dependency 'Alamofire', '~> 4.2.0'
29-
s.dependency 'AlamofireObjectMapper', '~> 4.0'
28+
s.dependency 'Alamofire', '~> 4.8.1'
29+
s.dependency 'AlamofireObjectMapper', '~> 5.2.0'
3030

3131
s.source_files = "PCA-iOS-Lib/**/*.{swift}"
3232

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ target 'PCA-iOS-Lib' do
66
use_frameworks!
77

88
# Pods for PCA-iOS-Lib
9-
pod 'Alamofire', '~> 4.2.0'
10-
pod 'AlamofireObjectMapper', '~> 4.0'
9+
pod 'Alamofire', '~> 4.8.1'
10+
pod 'AlamofireObjectMapper', '~> 5.2.0'
1111

1212
end

Podfile.lock

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
PODS:
2-
- Alamofire (4.2.0)
3-
- AlamofireObjectMapper (4.1.0):
4-
- Alamofire (~> 4.1)
5-
- ObjectMapper (~> 2.0)
6-
- ObjectMapper (2.2.7)
2+
- Alamofire (4.8.1)
3+
- AlamofireObjectMapper (5.2.0):
4+
- Alamofire (~> 4.7)
5+
- ObjectMapper (~> 3.4)
6+
- ObjectMapper (3.4.2)
77

88
DEPENDENCIES:
9-
- Alamofire (~> 4.2.0)
10-
- AlamofireObjectMapper (~> 4.0)
9+
- Alamofire (~> 4.8.1)
10+
- AlamofireObjectMapper (~> 5.2.0)
11+
12+
SPEC REPOS:
13+
https://github.com/cocoapods/specs.git:
14+
- Alamofire
15+
- AlamofireObjectMapper
16+
- ObjectMapper
1117

1218
SPEC CHECKSUMS:
13-
Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe
14-
AlamofireObjectMapper: 435adc82f5b367679bd9e71c4974a54efd0b2521
15-
ObjectMapper: 65abcfd9a61cf7396cbd14a4fb22fddfcc46577e
19+
Alamofire: 16ce2c353fb72865124ddae8a57c5942388f4f11
20+
AlamofireObjectMapper: 92b6ce2423a9d159e686f6a1d514a009bf903ddc
21+
ObjectMapper: 0d4402610f4e468903ae64629eec4784531e5c51
1622

17-
PODFILE CHECKSUM: 161f8c410426edfcec71e4ed9f3266479c4af19e
23+
PODFILE CHECKSUM: 3daab7f4bbaaba3bdcb153b175bbb0ab72794b7d
1824

19-
COCOAPODS: 1.2.1
25+
COCOAPODS: 1.5.3

Pods/Alamofire/LICENSE

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)