Skip to content

Commit b0a33c5

Browse files
committed
Add Dependency
1 parent 7b47055 commit b0a33c5

File tree

90 files changed

+6712
-334
lines changed

Some content is hidden

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

90 files changed

+6712
-334
lines changed

APIKitExt.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Pod::Spec.new do |s|
1010
s.name = 'APIKitExt'
1111
s.version = '0.0.1'
1212
s.summary = 'Useful extensions for APIKit'
13+
s.dependency 'ObjectMapper', '2.2.2'
1314

1415
# This description is used to generate tags and improve search results.
1516
# * Think: What does it do? Why did you write it? What is the focus?
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//
2+
// APIKit+ObjectMapper.swift
3+
// mercari
4+
//
5+
// Created by DTVD on 11/12/16.
6+
// Copyright © 2016 DTVD. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import ObjectMapper
11+
12+
enum MapError: Error {
13+
case Unmatchable(Any)
14+
}
15+
16+
extension Mappable {
17+
18+
public static func mapObject(_ object: Any) throws -> Self {
19+
guard let result = Mapper<Self>().map(JSONObject: object) else {
20+
throw MapError.Unmatchable(object)
21+
}
22+
return result
23+
}
24+
25+
public static func mapArray(_ object: Any) throws -> [Self] {
26+
guard let dictionaryArray = object as? [[String: Any]],
27+
let objects = Mapper<Self>().mapArray(JSONArray: dictionaryArray)
28+
else {
29+
throw MapError.Unmatchable(object)
30+
}
31+
return objects
32+
}
33+
}
34+
35+
extension ImmutableMappable {
36+
37+
public static func mapObject(_ object: Any) throws -> Self {
38+
return try Mapper<Self>().map(JSONObject: object)
39+
}
40+
41+
public static func mapArray(_ object: Any) throws -> [Self] {
42+
guard let dictionaryArray = object as? [[String: Any]] else {
43+
return []
44+
}
45+
return try Mapper<Self>().mapArray(JSONArray: dictionaryArray)
46+
}
47+
}

APIKitExt/Classes/ReplaceMe.swift

Whitespace-only changes.

Example/APIKitExt.xcodeproj/project.pbxproj

Lines changed: 5 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,9 @@
1212
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
1313
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
1414
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
15-
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
1615
97BA591F6D0710A806541BEE /* Pods_APIKitExt_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A75DCD734D3B06DAC6668A /* Pods_APIKitExt_Example.framework */; };
17-
B70CB6A2A1C6EA941A77232D /* Pods_APIKitExt_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A26930F936FFE51EF59D7B /* Pods_APIKitExt_Tests.framework */; };
1816
/* End PBXBuildFile section */
1917

20-
/* Begin PBXContainerItemProxy section */
21-
607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = {
22-
isa = PBXContainerItemProxy;
23-
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
24-
proxyType = 1;
25-
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
26-
remoteInfo = APIKitExt;
27-
};
28-
/* End PBXContainerItemProxy section */
29-
3018
/* Begin PBXFileReference section */
3119
04A0643B4B1FD2845CC52587 /* Pods-APIKitExt_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIKitExt_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIKitExt_Tests/Pods-APIKitExt_Tests.debug.xcconfig"; sourceTree = "<group>"; };
3220
06F2A2D5B02D2A6357233AEA /* Pods-APIKitExt_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIKitExt_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-APIKitExt_Example/Pods-APIKitExt_Example.debug.xcconfig"; sourceTree = "<group>"; };
@@ -38,7 +26,6 @@
3826
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3927
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
4028
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
41-
607FACE51AFB9204008FA782 /* APIKitExt_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APIKitExt_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4229
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4330
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
4431
71290121E9D27C33A61E770F /* Pods-APIKitExt_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIKitExt_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-APIKitExt_Tests/Pods-APIKitExt_Tests.release.xcconfig"; sourceTree = "<group>"; };
@@ -58,14 +45,6 @@
5845
);
5946
runOnlyForDeploymentPostprocessing = 0;
6047
};
61-
607FACE21AFB9204008FA782 /* Frameworks */ = {
62-
isa = PBXFrameworksBuildPhase;
63-
buildActionMask = 2147483647;
64-
files = (
65-
B70CB6A2A1C6EA941A77232D /* Pods_APIKitExt_Tests.framework in Frameworks */,
66-
);
67-
runOnlyForDeploymentPostprocessing = 0;
68-
};
6948
/* End PBXFrameworksBuildPhase section */
7049

7150
/* Begin PBXGroup section */
@@ -85,7 +64,6 @@
8564
isa = PBXGroup;
8665
children = (
8766
607FACD01AFB9204008FA782 /* APIKitExt_Example.app */,
88-
607FACE51AFB9204008FA782 /* APIKitExt_Tests.xctest */,
8967
);
9068
name = Products;
9169
sourceTree = "<group>";
@@ -182,27 +160,6 @@
182160
productReference = 607FACD01AFB9204008FA782 /* APIKitExt_Example.app */;
183161
productType = "com.apple.product-type.application";
184162
};
185-
607FACE41AFB9204008FA782 /* APIKitExt_Tests */ = {
186-
isa = PBXNativeTarget;
187-
buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "APIKitExt_Tests" */;
188-
buildPhases = (
189-
FD2A18E3BB9C9F6E3FF4F5F4 /* [CP] Check Pods Manifest.lock */,
190-
607FACE11AFB9204008FA782 /* Sources */,
191-
607FACE21AFB9204008FA782 /* Frameworks */,
192-
607FACE31AFB9204008FA782 /* Resources */,
193-
4B25DB3CEDC8550842969C15 /* [CP] Embed Pods Frameworks */,
194-
88E5BA572992DE412B656D45 /* [CP] Copy Pods Resources */,
195-
);
196-
buildRules = (
197-
);
198-
dependencies = (
199-
607FACE71AFB9204008FA782 /* PBXTargetDependency */,
200-
);
201-
name = APIKitExt_Tests;
202-
productName = Tests;
203-
productReference = 607FACE51AFB9204008FA782 /* APIKitExt_Tests.xctest */;
204-
productType = "com.apple.product-type.bundle.unit-test";
205-
};
206163
/* End PBXNativeTarget section */
207164

208165
/* Begin PBXProject section */
@@ -215,13 +172,9 @@
215172
TargetAttributes = {
216173
607FACCF1AFB9204008FA782 = {
217174
CreatedOnToolsVersion = 6.3.1;
175+
DevelopmentTeam = UNN39U2ELX;
218176
LastSwiftMigration = 0820;
219177
};
220-
607FACE41AFB9204008FA782 = {
221-
CreatedOnToolsVersion = 6.3.1;
222-
LastSwiftMigration = 0820;
223-
TestTargetID = 607FACCF1AFB9204008FA782;
224-
};
225178
};
226179
};
227180
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "APIKitExt" */;
@@ -238,7 +191,6 @@
238191
projectRoot = "";
239192
targets = (
240193
607FACCF1AFB9204008FA782 /* APIKitExt_Example */,
241-
607FACE41AFB9204008FA782 /* APIKitExt_Tests */,
242194
);
243195
};
244196
/* End PBXProject section */
@@ -254,13 +206,6 @@
254206
);
255207
runOnlyForDeploymentPostprocessing = 0;
256208
};
257-
607FACE31AFB9204008FA782 /* Resources */ = {
258-
isa = PBXResourcesBuildPhase;
259-
buildActionMask = 2147483647;
260-
files = (
261-
);
262-
runOnlyForDeploymentPostprocessing = 0;
263-
};
264209
/* End PBXResourcesBuildPhase section */
265210

266211
/* Begin PBXShellScriptBuildPhase section */
@@ -279,36 +224,6 @@
279224
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIKitExt_Example/Pods-APIKitExt_Example-frameworks.sh\"\n";
280225
showEnvVarsInLog = 0;
281226
};
282-
4B25DB3CEDC8550842969C15 /* [CP] Embed Pods Frameworks */ = {
283-
isa = PBXShellScriptBuildPhase;
284-
buildActionMask = 2147483647;
285-
files = (
286-
);
287-
inputPaths = (
288-
);
289-
name = "[CP] Embed Pods Frameworks";
290-
outputPaths = (
291-
);
292-
runOnlyForDeploymentPostprocessing = 0;
293-
shellPath = /bin/sh;
294-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIKitExt_Tests/Pods-APIKitExt_Tests-frameworks.sh\"\n";
295-
showEnvVarsInLog = 0;
296-
};
297-
88E5BA572992DE412B656D45 /* [CP] Copy Pods Resources */ = {
298-
isa = PBXShellScriptBuildPhase;
299-
buildActionMask = 2147483647;
300-
files = (
301-
);
302-
inputPaths = (
303-
);
304-
name = "[CP] Copy Pods Resources";
305-
outputPaths = (
306-
);
307-
runOnlyForDeploymentPostprocessing = 0;
308-
shellPath = /bin/sh;
309-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIKitExt_Tests/Pods-APIKitExt_Tests-resources.sh\"\n";
310-
showEnvVarsInLog = 0;
311-
};
312227
C3145D23628836CA1D599CDA /* [CP] Check Pods Manifest.lock */ = {
313228
isa = PBXShellScriptBuildPhase;
314229
buildActionMask = 2147483647;
@@ -339,21 +254,6 @@
339254
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-APIKitExt_Example/Pods-APIKitExt_Example-resources.sh\"\n";
340255
showEnvVarsInLog = 0;
341256
};
342-
FD2A18E3BB9C9F6E3FF4F5F4 /* [CP] Check Pods Manifest.lock */ = {
343-
isa = PBXShellScriptBuildPhase;
344-
buildActionMask = 2147483647;
345-
files = (
346-
);
347-
inputPaths = (
348-
);
349-
name = "[CP] Check Pods Manifest.lock";
350-
outputPaths = (
351-
);
352-
runOnlyForDeploymentPostprocessing = 0;
353-
shellPath = /bin/sh;
354-
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";
355-
showEnvVarsInLog = 0;
356-
};
357257
/* End PBXShellScriptBuildPhase section */
358258

359259
/* Begin PBXSourcesBuildPhase section */
@@ -366,24 +266,8 @@
366266
);
367267
runOnlyForDeploymentPostprocessing = 0;
368268
};
369-
607FACE11AFB9204008FA782 /* Sources */ = {
370-
isa = PBXSourcesBuildPhase;
371-
buildActionMask = 2147483647;
372-
files = (
373-
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */,
374-
);
375-
runOnlyForDeploymentPostprocessing = 0;
376-
};
377269
/* End PBXSourcesBuildPhase section */
378270

379-
/* Begin PBXTargetDependency section */
380-
607FACE71AFB9204008FA782 /* PBXTargetDependency */ = {
381-
isa = PBXTargetDependency;
382-
target = 607FACCF1AFB9204008FA782 /* APIKitExt_Example */;
383-
targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */;
384-
};
385-
/* End PBXTargetDependency section */
386-
387271
/* Begin PBXVariantGroup section */
388272
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
389273
isa = PBXVariantGroup;
@@ -441,7 +325,7 @@
441325
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
442326
GCC_WARN_UNUSED_FUNCTION = YES;
443327
GCC_WARN_UNUSED_VARIABLE = YES;
444-
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
328+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
445329
MTL_ENABLE_DEBUG_INFO = YES;
446330
ONLY_ACTIVE_ARCH = YES;
447331
SDKROOT = iphoneos;
@@ -479,7 +363,7 @@
479363
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
480364
GCC_WARN_UNUSED_FUNCTION = YES;
481365
GCC_WARN_UNUSED_VARIABLE = YES;
482-
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
366+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
483367
MTL_ENABLE_DEBUG_INFO = NO;
484368
SDKROOT = iphoneos;
485369
VALIDATE_PRODUCT = YES;
@@ -491,6 +375,7 @@
491375
baseConfigurationReference = 06F2A2D5B02D2A6357233AEA /* Pods-APIKitExt_Example.debug.xcconfig */;
492376
buildSettings = {
493377
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378+
DEVELOPMENT_TEAM = UNN39U2ELX;
494379
INFOPLIST_FILE = APIKitExt/Info.plist;
495380
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
496381
MODULE_NAME = ExampleApp;
@@ -505,6 +390,7 @@
505390
baseConfigurationReference = 4ED79E5282E370AE85C92245 /* Pods-APIKitExt_Example.release.xcconfig */;
506391
buildSettings = {
507392
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
393+
DEVELOPMENT_TEAM = UNN39U2ELX;
508394
INFOPLIST_FILE = APIKitExt/Info.plist;
509395
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
510396
MODULE_NAME = ExampleApp;
@@ -514,42 +400,6 @@
514400
};
515401
name = Release;
516402
};
517-
607FACF31AFB9204008FA782 /* Debug */ = {
518-
isa = XCBuildConfiguration;
519-
baseConfigurationReference = 04A0643B4B1FD2845CC52587 /* Pods-APIKitExt_Tests.debug.xcconfig */;
520-
buildSettings = {
521-
FRAMEWORK_SEARCH_PATHS = (
522-
"$(SDKROOT)/Developer/Library/Frameworks",
523-
"$(inherited)",
524-
);
525-
GCC_PREPROCESSOR_DEFINITIONS = (
526-
"DEBUG=1",
527-
"$(inherited)",
528-
);
529-
INFOPLIST_FILE = Tests/Info.plist;
530-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
531-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
532-
PRODUCT_NAME = "$(TARGET_NAME)";
533-
SWIFT_VERSION = 3.0;
534-
};
535-
name = Debug;
536-
};
537-
607FACF41AFB9204008FA782 /* Release */ = {
538-
isa = XCBuildConfiguration;
539-
baseConfigurationReference = 71290121E9D27C33A61E770F /* Pods-APIKitExt_Tests.release.xcconfig */;
540-
buildSettings = {
541-
FRAMEWORK_SEARCH_PATHS = (
542-
"$(SDKROOT)/Developer/Library/Frameworks",
543-
"$(inherited)",
544-
);
545-
INFOPLIST_FILE = Tests/Info.plist;
546-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
547-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
548-
PRODUCT_NAME = "$(TARGET_NAME)";
549-
SWIFT_VERSION = 3.0;
550-
};
551-
name = Release;
552-
};
553403
/* End XCBuildConfiguration section */
554404

555405
/* Begin XCConfigurationList section */
@@ -571,15 +421,6 @@
571421
defaultConfigurationIsVisible = 0;
572422
defaultConfigurationName = Release;
573423
};
574-
607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "APIKitExt_Tests" */ = {
575-
isa = XCConfigurationList;
576-
buildConfigurations = (
577-
607FACF31AFB9204008FA782 /* Debug */,
578-
607FACF41AFB9204008FA782 /* Release */,
579-
);
580-
defaultConfigurationIsVisible = 0;
581-
defaultConfigurationName = Release;
582-
};
583424
/* End XCConfigurationList section */
584425
};
585426
rootObject = 607FACC81AFB9204008FA782 /* Project object */;

Example/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use_frameworks!
22

33
target 'APIKitExt_Example' do
44
pod 'APIKitExt', :path => '../'
5+
pod 'APIKit', '3.1.1'
56

67
target 'APIKitExt_Tests' do
78
inherit! :search_paths
89

9-
10+
1011
end
1112
end

Example/Podfile.lock

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
PODS:
2-
- APIKitExt (0.1.0)
2+
- APIKit (3.1.1):
3+
- Result (~> 3.0)
4+
- APIKitExt (0.0.1):
5+
- ObjectMapper (= 2.2.2)
6+
- ObjectMapper (2.2.2)
7+
- Result (3.1.0)
38

49
DEPENDENCIES:
10+
- APIKit (= 3.1.1)
511
- APIKitExt (from `../`)
612

713
EXTERNAL SOURCES:
814
APIKitExt:
915
:path: "../"
1016

1117
SPEC CHECKSUMS:
12-
APIKitExt: 016b1b7daca56141667b25c20daa1db4d1073817
18+
APIKit: 7460983f490d3bde6aaaaa4164d18c9865a6f91d
19+
APIKitExt: 3cdce4b6945bf3f4c023023ab6ebf4317d39f23d
20+
ObjectMapper: 9e385c2295bcc4e16eabbcfc85db801442bba545
21+
Result: 4e3ed5995ed94d0cd6a09be9a431fce3f3624bbf
1322

14-
PODFILE CHECKSUM: 03fd77c3929903d52ad1376e9df3a5afaa6a7461
23+
PODFILE CHECKSUM: bc19b9d142517d0ed22e7159fa7334134c0edc96
1524

1625
COCOAPODS: 1.1.1

0 commit comments

Comments
 (0)