From 82d2dfbc50f6b9f4af5f2425ff25b2287220a998 Mon Sep 17 00:00:00 2001 From: alextud Date: Tue, 24 Jul 2018 10:20:25 +0300 Subject: [PATCH] Revert "Auto init" --- netfox.xcodeproj/project.pbxproj | 57 +++++++-------------- netfox/Core/NFXClientConnection.swift | 2 +- netfox/Core/NSURLSessionConfiguration+NFX.h | 17 ------ netfox/Core/NSURLSessionConfiguration+NFX.m | 18 ------- netfox_ios_demo/AppDelegate.swift | 3 ++ 5 files changed, 23 insertions(+), 74 deletions(-) delete mode 100644 netfox/Core/NSURLSessionConfiguration+NFX.h delete mode 100644 netfox/Core/NSURLSessionConfiguration+NFX.m diff --git a/netfox.xcodeproj/project.pbxproj b/netfox.xcodeproj/project.pbxproj index a1ce6039..36a905ea 100755 --- a/netfox.xcodeproj/project.pbxproj +++ b/netfox.xcodeproj/project.pbxproj @@ -7,10 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 17CAEF312106422000F3F22F /* NSURLSessionConfiguration+NFX.h in Headers */ = {isa = PBXBuildFile; fileRef = 17CAEF2F2106422000F3F22F /* NSURLSessionConfiguration+NFX.h */; }; - 17CAEF322106422000F3F22F /* NSURLSessionConfiguration+NFX.m in Sources */ = {isa = PBXBuildFile; fileRef = 17CAEF302106422000F3F22F /* NSURLSessionConfiguration+NFX.m */; }; - 17CAEF352106457F00F3F22F /* NSURLSessionConfiguration+NFX.m in Sources */ = {isa = PBXBuildFile; fileRef = 17CAEF302106422000F3F22F /* NSURLSessionConfiguration+NFX.m */; }; - 17CAEF362106459500F3F22F /* NSURLSessionConfiguration+NFX.h in Headers */ = {isa = PBXBuildFile; fileRef = 17CAEF2F2106422000F3F22F /* NSURLSessionConfiguration+NFX.h */; }; 234DBCD61FA33BD90086CB79 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234DBCD51FA33BD90086CB79 /* AppDelegate.swift */; }; 234DBCD81FA33BD90086CB79 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 234DBCD71FA33BD90086CB79 /* Assets.xcassets */; }; 234DBCDB1FA33BD90086CB79 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 234DBCD91FA33BD90086CB79 /* MainMenu.xib */; }; @@ -32,9 +28,6 @@ 8229AD6F1F8FB34300A9D613 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8229AD6D1F8FB34300A9D613 /* LaunchScreen.storyboard */; }; 8229AD771F8FB4B500A9D613 /* netfox_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3BC020F1C09CDA000C17F3A /* netfox_ios.framework */; }; 826C4E9E1F979AB3008B440C /* NFXLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 826C4E9C1F979AB3008B440C /* NFXLoader.h */; }; - 826C4E9F1F979AB3008B440C /* NFXLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 826C4E9D1F979AB3008B440C /* NFXLoader.m */; }; - 82F6E1031F8FD81C002B31BD /* TextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F6E1021F8FD81C002B31BD /* TextViewController.swift */; }; - 82F6E1051F8FF55D002B31BD /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F6E1041F8FF55D002B31BD /* WebViewController.swift */; }; 8F98A4DE202992FE007B2BB1 /* NFXPathNodeListCell_OSX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F98A4D9202992A2007B2BB1 /* NFXPathNodeListCell_OSX.swift */; }; 8F98A4E12029944D007B2BB1 /* NFXPathNodeListCell_OSX.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8F98A4DF20299399007B2BB1 /* NFXPathNodeListCell_OSX.xib */; }; 8F98A4E3202994CB007B2BB1 /* NFXPathNodeListController_OSX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F98A4E2202994CB007B2BB1 /* NFXPathNodeListController_OSX.swift */; }; @@ -46,6 +39,9 @@ 8FBC1A8E2028AF2A00ABDF22 /* NFXPathNodeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FBC1A8A2028ACEB00ABDF22 /* NFXPathNodeManager.swift */; }; 8FD42BA62028A2D20084211A /* NFXPathNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD42BA52028A2D20084211A /* NFXPathNode.swift */; }; 8FD42BA72028A3BB0084211A /* NFXPathNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD42BA52028A2D20084211A /* NFXPathNode.swift */; }; + 826C4E9F1F979AB3008B440C /* NFXLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 826C4E9D1F979AB3008B440C /* NFXLoader.m */; }; + 82F6E1031F8FD81C002B31BD /* TextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F6E1021F8FD81C002B31BD /* TextViewController.swift */; }; + 82F6E1051F8FF55D002B31BD /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F6E1041F8FF55D002B31BD /* WebViewController.swift */; }; B3F8BA821C833ABC00F9FBEA /* NFX.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F8BA711C833ABC00F9FBEA /* NFX.swift */; }; B3F8BA831C833ABC00F9FBEA /* NFX.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F8BA711C833ABC00F9FBEA /* NFX.swift */; }; B3F8BA841C833ABC00F9FBEA /* NFXAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3F8BA721C833ABC00F9FBEA /* NFXAssets.swift */; }; @@ -131,8 +127,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 17CAEF2F2106422000F3F22F /* NSURLSessionConfiguration+NFX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSURLSessionConfiguration+NFX.h"; sourceTree = ""; }; - 17CAEF302106422000F3F22F /* NSURLSessionConfiguration+NFX.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSURLSessionConfiguration+NFX.m"; sourceTree = ""; }; 234DBCD31FA33BD90086CB79 /* netfox_mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = netfox_mac.app; sourceTree = BUILT_PRODUCTS_DIR; }; 234DBCD51FA33BD90086CB79 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 234DBCD71FA33BD90086CB79 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -150,10 +144,6 @@ 8229AD6B1F8FB34300A9D613 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 8229AD6E1F8FB34300A9D613 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 8229AD701F8FB34300A9D613 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 826C4E9C1F979AB3008B440C /* NFXLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFXLoader.h; sourceTree = ""; }; - 826C4E9D1F979AB3008B440C /* NFXLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NFXLoader.m; sourceTree = ""; }; - 82F6E1021F8FD81C002B31BD /* TextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewController.swift; sourceTree = ""; }; - 82F6E1041F8FF55D002B31BD /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; 8F98A4D9202992A2007B2BB1 /* NFXPathNodeListCell_OSX.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFXPathNodeListCell_OSX.swift; sourceTree = ""; }; 8F98A4DF20299399007B2BB1 /* NFXPathNodeListCell_OSX.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NFXPathNodeListCell_OSX.xib; sourceTree = ""; }; 8F98A4E2202994CB007B2BB1 /* NFXPathNodeListController_OSX.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFXPathNodeListController_OSX.swift; sourceTree = ""; }; @@ -163,6 +153,10 @@ 8FBC1A8A2028ACEB00ABDF22 /* NFXPathNodeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFXPathNodeManager.swift; sourceTree = ""; }; 8FBFFB4C20331DD000DF9319 /* NFXJson2Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFXJson2Codable.swift; sourceTree = ""; }; 8FD42BA52028A2D20084211A /* NFXPathNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFXPathNode.swift; sourceTree = ""; }; + 826C4E9C1F979AB3008B440C /* NFXLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFXLoader.h; sourceTree = ""; }; + 826C4E9D1F979AB3008B440C /* NFXLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NFXLoader.m; sourceTree = ""; }; + 82F6E1021F8FD81C002B31BD /* TextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewController.swift; sourceTree = ""; }; + 82F6E1041F8FF55D002B31BD /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; B3BC020F1C09CDA000C17F3A /* netfox_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = netfox_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3F8BA711C833ABC00F9FBEA /* NFX.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NFX.swift; sourceTree = ""; }; B3F8BA721C833ABC00F9FBEA /* NFXAssets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NFXAssets.swift; sourceTree = ""; }; @@ -247,6 +241,17 @@ path = netfox_mac; sourceTree = ""; }; + 8F9DEE92203338F700E76B7E /* Json2Codable */ = { + isa = PBXGroup; + children = ( + 8F9DEE952033393800E76B7E /* NFXCodableClass.swift */, + 8FBFFB4C20331DD000DF9319 /* NFXJson2Codable.swift */, + 8F9DEE932033391800E76B7E /* NFXJsonParser.swift */, + 8F9DEE972033398500E76B7E /* String+CamelCase.swift */, + ); + path = Json2Codable; + sourceTree = ""; + }; 8229AD631F8FB34300A9D613 /* netfox_ios_demo */ = { isa = PBXGroup; children = ( @@ -269,17 +274,6 @@ name = Frameworks; sourceTree = ""; }; - 8F9DEE92203338F700E76B7E /* Json2Codable */ = { - isa = PBXGroup; - children = ( - 8F9DEE952033393800E76B7E /* NFXCodableClass.swift */, - 8FBFFB4C20331DD000DF9319 /* NFXJson2Codable.swift */, - 8F9DEE932033391800E76B7E /* NFXJsonParser.swift */, - 8F9DEE972033398500E76B7E /* String+CamelCase.swift */, - ); - path = Json2Codable; - sourceTree = ""; - }; B3BC02051C09CDA000C17F3A = { isa = PBXGroup; children = ( @@ -331,8 +325,6 @@ 8FBC1A8A2028ACEB00ABDF22 /* NFXPathNodeManager.swift */, 8F9DEE92203338F700E76B7E /* Json2Codable */, B3F8BA811C833ABC00F9FBEA /* NFXWindowController.swift */, - 17CAEF2F2106422000F3F22F /* NSURLSessionConfiguration+NFX.h */, - 17CAEF302106422000F3F22F /* NSURLSessionConfiguration+NFX.m */, ); path = Core; sourceTree = ""; @@ -388,7 +380,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 17CAEF312106422000F3F22F /* NSURLSessionConfiguration+NFX.h in Headers */, 826C4E9E1F979AB3008B440C /* NFXLoader.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -397,7 +388,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 17CAEF362106459500F3F22F /* NSURLSessionConfiguration+NFX.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -591,7 +581,6 @@ buildActionMask = 2147483647; files = ( B3F8BA821C833ABC00F9FBEA /* NFX.swift in Sources */, - 17CAEF322106422000F3F22F /* NSURLSessionConfiguration+NFX.m in Sources */, 8FD42BA62028A2D20084211A /* NFXPathNode.swift in Sources */, B3F8BA8A1C833ABC00F9FBEA /* NFXGenericBodyDetailsController.swift in Sources */, B3F8BA901C833ABC00F9FBEA /* NFXHTTPModel.swift in Sources */, @@ -642,7 +631,6 @@ B3F8D67C1C833B1700F9FBEA /* NFXDetailsController_OSX.swift in Sources */, B3F8BA8F1C833ABC00F9FBEA /* NFXHelper.swift in Sources */, B3F8BA871C833ABC00F9FBEA /* NFXConstants.swift in Sources */, - 17CAEF352106457F00F3F22F /* NSURLSessionConfiguration+NFX.m in Sources */, 8F98A4E3202994CB007B2BB1 /* NFXPathNodeListController_OSX.swift in Sources */, 8F9DEE962033393800E76B7E /* NFXCodableClass.swift in Sources */, B3F8BA9B1C833ABC00F9FBEA /* NFXProtocol.swift in Sources */, @@ -822,7 +810,6 @@ B3BC02151C09CDA000C17F3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -849,7 +836,6 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -880,7 +866,6 @@ B3BC02161C09CDA000C17F3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -907,7 +892,6 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -932,7 +916,6 @@ B3BC02181C09CDA000C17F3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -954,7 +937,6 @@ B3BC02191C09CDA000C17F3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -965,6 +947,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.kasketis.netfox-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; @@ -974,7 +957,6 @@ E20FD2EE1C6912D400DCFF61 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; @@ -1004,7 +986,6 @@ E20FD2EF1C6912D400DCFF61 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; diff --git a/netfox/Core/NFXClientConnection.swift b/netfox/Core/NFXClientConnection.swift index edf875f2..34e1deeb 100644 --- a/netfox/Core/NFXClientConnection.swift +++ b/netfox/Core/NFXClientConnection.swift @@ -172,7 +172,7 @@ extension NFX { } if let jsonModels = json as? [[String: Any]] { - let models: [NFXHTTPModel] = jsonModels.compactMap({ + let models: [NFXHTTPModel] = jsonModels.flatMap({ let model = NFXHTTPModel() model.fromJSON(json: $0) return model diff --git a/netfox/Core/NSURLSessionConfiguration+NFX.h b/netfox/Core/NSURLSessionConfiguration+NFX.h deleted file mode 100644 index 797e5e07..00000000 --- a/netfox/Core/NSURLSessionConfiguration+NFX.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSURLSessionConfiguration+NFX.h -// netfox_ios -// -// Created by Alex Bofu on 23/07/2018. -// Copyright © 2018 kasketis. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSURLSessionConfiguration (NFX) - -@end - -NS_ASSUME_NONNULL_END diff --git a/netfox/Core/NSURLSessionConfiguration+NFX.m b/netfox/Core/NSURLSessionConfiguration+NFX.m deleted file mode 100644 index da4871e4..00000000 --- a/netfox/Core/NSURLSessionConfiguration+NFX.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSURLSessionConfiguration+NFX.m -// netfox_ios -// -// Created by Alex Bofu on 23/07/2018. -// Copyright © 2018 kasketis. All rights reserved. -// - -#import "NSURLSessionConfiguration+NFX.h" -#import - -@implementation NSURLSessionConfiguration (NFX) - -+ (void)load { - [[NFX sharedInstance] start]; -} - -@end diff --git a/netfox_ios_demo/AppDelegate.swift b/netfox_ios_demo/AppDelegate.swift index 04ff2fe9..377bd562 100644 --- a/netfox_ios_demo/AppDelegate.swift +++ b/netfox_ios_demo/AppDelegate.swift @@ -7,6 +7,7 @@ // import UIKit +import netfox_ios @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -17,6 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + NFX.sharedInstance().start() + return true }