diff --git a/Podfile b/Podfile index a8cb3e6..7d89501 100644 --- a/Podfile +++ b/Podfile @@ -5,7 +5,7 @@ target 'iOSBaseProject' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! - pod 'Alamofire', '~> 4.5' + pod 'Alamofire', '~> 4.7.2' pod 'MBProgressHUD', '~> 1.1.0' pod 'EVReflection/Alamofire' pod 'IQKeyboardManagerSwift' diff --git a/Podfile.lock b/Podfile.lock index 5e59a07..171a254 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - Alamofire (4.7.1) + - Alamofire (4.7.2) - EVReflection/Alamofire (5.6.0): - Alamofire - EVReflection/Core @@ -9,14 +9,14 @@ PODS: - Toast-Swift (3.0.1) DEPENDENCIES: - - Alamofire (~> 4.5) + - Alamofire (~> 4.7.2) - EVReflection/Alamofire - IQKeyboardManagerSwift - MBProgressHUD (~> 1.1.0) - Toast-Swift (~> 3.0.1) SPEC REPOS: - https://github.com/CocoaPods/Specs.git: + https://github.com/cocoapods/specs.git: - Alamofire - EVReflection - IQKeyboardManagerSwift @@ -24,12 +24,12 @@ SPEC REPOS: - Toast-Swift SPEC CHECKSUMS: - Alamofire: 68d7d521118d49c615a8d2214d87cdf525599d30 + Alamofire: e4fa87002c137ba2d8d634d2c51fabcda0d5c223 EVReflection: 5c9443fd3d9b71eaab8c2321e3a2aca155ac352e IQKeyboardManagerSwift: 624f128983eec795deacd50c1cd2f72664d13f08 MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9 Toast-Swift: ba0b01b095aada709d915f9beb1d38184a2721c3 -PODFILE CHECKSUM: 9c5678be6821ed4683423a2062cf41be1ee458eb +PODFILE CHECKSUM: aa397becf82a8878769e5e41d98e6967228fc3d2 -COCOAPODS: 1.5.0 +COCOAPODS: 1.5.2 diff --git a/iOSBaseProject.xcodeproj/project.pbxproj b/iOSBaseProject.xcodeproj/project.pbxproj index 70bc930..635da62 100644 --- a/iOSBaseProject.xcodeproj/project.pbxproj +++ b/iOSBaseProject.xcodeproj/project.pbxproj @@ -3,11 +3,12 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 48; objects = { /* Begin PBXBuildFile section */ 621DCA89DAB6FBEE1EB1894F /* Pods_iOSBaseProject.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50F749E4A9A58FEF4728587C /* Pods_iOSBaseProject.framework */; }; + 91FEBC5420BDAF090069B3F3 /* StringPrimitiveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91FEBC5320BDAF090069B3F3 /* StringPrimitiveTests.swift */; }; C89F1C04208389F50089E306 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89F1C03208389F50089E306 /* AppDelegate.swift */; }; C89F1C06208389F50089E306 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89F1C05208389F50089E306 /* ViewController.swift */; }; C89F1C09208389F50089E306 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C89F1C07208389F50089E306 /* Main.storyboard */; }; @@ -28,9 +29,22 @@ C89F1C8B208392230089E306 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89F1C88208392230089E306 /* BaseViewController.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 91FEBC5620BDAF090069B3F3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C89F1BF8208389F50089E306 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C89F1BFF208389F50089E306; + remoteInfo = iOSBaseProject; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 0053CF8518D9F46A01537914 /* Pods-iOSBaseProject.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSBaseProject.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOSBaseProject/Pods-iOSBaseProject.debug.xcconfig"; sourceTree = ""; }; 50F749E4A9A58FEF4728587C /* Pods_iOSBaseProject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iOSBaseProject.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 91FEBC5120BDAF090069B3F3 /* iOSBaseProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOSBaseProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 91FEBC5320BDAF090069B3F3 /* StringPrimitiveTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringPrimitiveTests.swift; sourceTree = ""; }; + 91FEBC5520BDAF090069B3F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C89F1C00208389F50089E306 /* iOSBaseProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSBaseProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; C89F1C03208389F50089E306 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C89F1C05208389F50089E306 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -55,6 +69,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 91FEBC4E20BDAF090069B3F3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; C89F1BFD208389F50089E306 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -83,10 +104,20 @@ name = Frameworks; sourceTree = ""; }; + 91FEBC5220BDAF090069B3F3 /* iOSBaseProjectTests */ = { + isa = PBXGroup; + children = ( + 91FEBC5320BDAF090069B3F3 /* StringPrimitiveTests.swift */, + 91FEBC5520BDAF090069B3F3 /* Info.plist */, + ); + path = iOSBaseProjectTests; + sourceTree = ""; + }; C89F1BF7208389F50089E306 = { isa = PBXGroup; children = ( C89F1C02208389F50089E306 /* iOSBaseProject */, + 91FEBC5220BDAF090069B3F3 /* iOSBaseProjectTests */, C89F1C01208389F50089E306 /* Products */, 0F0899E790D10003085E92B8 /* Pods */, 79E06ECEE5665E70C0EDA902 /* Frameworks */, @@ -97,6 +128,7 @@ isa = PBXGroup; children = ( C89F1C00208389F50089E306 /* iOSBaseProject.app */, + 91FEBC5120BDAF090069B3F3 /* iOSBaseProjectTests.xctest */, ); name = Products; sourceTree = ""; @@ -145,8 +177,8 @@ C89F1C2120838E9E0089E306 /* Extensions */ = { isa = PBXGroup; children = ( - C89F1C74208390AA0089E306 /* Date.swift */, C89F1C78208390AB0089E306 /* PrimitiveTypes.swift */, + C89F1C74208390AA0089E306 /* Date.swift */, C89F1C71208390AA0089E306 /* UIImage.swift */, C89F1C77208390AB0089E306 /* UILabel.swift */, C89F1C7A208390AB0089E306 /* UITextView.swift */, @@ -242,6 +274,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 91FEBC5020BDAF090069B3F3 /* iOSBaseProjectTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 91FEBC5A20BDAF090069B3F3 /* Build configuration list for PBXNativeTarget "iOSBaseProjectTests" */; + buildPhases = ( + 91FEBC4D20BDAF090069B3F3 /* Sources */, + 91FEBC4E20BDAF090069B3F3 /* Frameworks */, + 91FEBC4F20BDAF090069B3F3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 91FEBC5720BDAF090069B3F3 /* PBXTargetDependency */, + ); + name = iOSBaseProjectTests; + productName = iOSBaseProjectTests; + productReference = 91FEBC5120BDAF090069B3F3 /* iOSBaseProjectTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; C89F1BFF208389F50089E306 /* iOSBaseProject */ = { isa = PBXNativeTarget; buildConfigurationList = C89F1C12208389FF0089E306 /* Build configuration list for PBXNativeTarget "iOSBaseProject" */; @@ -271,13 +321,19 @@ LastUpgradeCheck = 0930; ORGANIZATIONNAME = "Cotta & Cush"; TargetAttributes = { + 91FEBC5020BDAF090069B3F3 = { + CreatedOnToolsVersion = 9.3.1; + ProvisioningStyle = Automatic; + TestTargetID = C89F1BFF208389F50089E306; + }; C89F1BFF208389F50089E306 = { CreatedOnToolsVersion = 9.3; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = C89F1BFB208389F50089E306 /* Build configuration list for PBXProject "iOSBaseProject" */; - compatibilityVersion = "Xcode 9.3"; + compatibilityVersion = "Xcode 8.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -290,11 +346,19 @@ projectRoot = ""; targets = ( C89F1BFF208389F50089E306 /* iOSBaseProject */, + 91FEBC5020BDAF090069B3F3 /* iOSBaseProjectTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 91FEBC4F20BDAF090069B3F3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; C89F1BFE208389F50089E306 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -355,6 +419,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 91FEBC4D20BDAF090069B3F3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 91FEBC5420BDAF090069B3F3 /* StringPrimitiveTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C89F1BFC208389F50089E306 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -379,6 +451,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 91FEBC5720BDAF090069B3F3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C89F1BFF208389F50089E306 /* iOSBaseProject */; + targetProxy = 91FEBC5620BDAF090069B3F3 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ C89F1C07208389F50089E306 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -399,6 +479,38 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 91FEBC5820BDAF090069B3F3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = VNTMDT5LW2; + INFOPLIST_FILE = iOSBaseProjectTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.cottacush.sample.iOSBaseProjectTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSBaseProject.app/iOSBaseProject"; + }; + name = Debug; + }; + 91FEBC5920BDAF090069B3F3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = VNTMDT5LW2; + INFOPLIST_FILE = iOSBaseProjectTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.cottacush.sample.iOSBaseProjectTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSBaseProject.app/iOSBaseProject"; + }; + name = Release; + }; C89F1C10208389FF0089E306 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -450,10 +562,10 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; + SDKROOT = iphoneos11.2; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -504,9 +616,9 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; + SDKROOT = iphoneos11.2; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; @@ -519,14 +631,12 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 44WM7BTB59; + DEVELOPMENT_TEAM = VNTMDT5LW2; INFOPLIST_FILE = iOSBaseProject/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cottacush.iOSBaseProject; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos11.2; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -538,12 +648,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 44WM7BTB59; + DEVELOPMENT_TEAM = VNTMDT5LW2; INFOPLIST_FILE = iOSBaseProject/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cottacush.iOSBaseProject; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.0; @@ -554,6 +661,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 91FEBC5A20BDAF090069B3F3 /* Build configuration list for PBXNativeTarget "iOSBaseProjectTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 91FEBC5820BDAF090069B3F3 /* Debug */, + 91FEBC5920BDAF090069B3F3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C89F1BFB208389F50089E306 /* Build configuration list for PBXProject "iOSBaseProject" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/iOSBaseProject/AppDelegate.swift b/iOSBaseProject/AppDelegate.swift index cd20c66..9f15c47 100644 --- a/iOSBaseProject/AppDelegate.swift +++ b/iOSBaseProject/AppDelegate.swift @@ -1,10 +1,3 @@ -// -// AppDelegate.swift -// iOSBaseProject -// -// Created by codedentwickler on 4/15/18. -// Copyright © 2018 Cotta & Cush. All rights reserved. -// import UIKit diff --git a/iOSBaseProject/Extensions/PrimitiveTypes.swift b/iOSBaseProject/Extensions/PrimitiveTypes.swift index 1dbbc54..e459f44 100644 --- a/iOSBaseProject/Extensions/PrimitiveTypes.swift +++ b/iOSBaseProject/Extensions/PrimitiveTypes.swift @@ -12,7 +12,6 @@ extension String { } var intValue : Int? { - return Int(self) } diff --git a/iOSBaseProject/Utils/Identifiers.swift b/iOSBaseProject/Utils/Identifiers.swift index ebdaf42..895fc65 100644 --- a/iOSBaseProject/Utils/Identifiers.swift +++ b/iOSBaseProject/Utils/Identifiers.swift @@ -1,16 +1,11 @@ -// -// Identifiers.swift -// iOSBaseProject -// -// Created by codedentwickler on 4/15/18. -// Copyright © 2018 Cotta & Cush. All rights reserved. -// import Foundation struct StringIDs { struct SegueIdentfiers {} + + struct StoryBoardIdentifiers { static let MAIN = "Main" diff --git a/iOSBaseProject/ViewController.swift b/iOSBaseProject/ViewController.swift index 5399d37..7c150aa 100644 --- a/iOSBaseProject/ViewController.swift +++ b/iOSBaseProject/ViewController.swift @@ -1,10 +1,3 @@ -// -// ViewController.swift -// iOSBaseProject -// -// Created by codedentwickler on 4/15/18. -// Copyright © 2018 Cotta & Cush. All rights reserved. -// import UIKit diff --git a/iOSBaseProjectTests/Info.plist b/iOSBaseProjectTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/iOSBaseProjectTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/iOSBaseProjectTests/StringPrimitiveTests.swift b/iOSBaseProjectTests/StringPrimitiveTests.swift new file mode 100644 index 0000000..3363910 --- /dev/null +++ b/iOSBaseProjectTests/StringPrimitiveTests.swift @@ -0,0 +1,95 @@ +// iOSBaseProjectTests.swift +// iOSBaseProjectTests +// + +import XCTest +import Foundation +@testable import iOSBaseProject +class StringPrimitiveTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + + func test_replacing_string() { + let number = "080354647849" + let replacedNumber = number.replacing(range: 2...6, with: "*") + XCTAssertEqual(replacedNumber, "08*47849") + XCTAssertNotEqual(replacedNumber, "080***47849") + } + + func test_trim_string() { + let actual = "trimmedString " + let expected = "trimmedString" + XCTAssertEqual(actual.trim(), expected) + XCTAssertNotEqual(actual.trim(), actual) + } + + func test_intValue_string() { + XCTAssertEqual("234".intValue, 234) + } + + func test_doubleValue_string() { + XCTAssertEqual("234.34".doubleValue, 234.34) + XCTAssertNotEqual("234.34".doubleValue, 234) + } + + func test_string_to_date() { + let givenDate = "2018-01-12" + XCTAssertEqual(givenDate.asDate, "12 January 2018") + XCTAssertNotEqual(givenDate.asDate, "January 12 2018") + } + + +} + +class DoublePrimitiveTests: XCTestCase { + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + + func test_double_short_currency_decription() { + let givenMillion:Double = 1000000.00 + let givenThousand: Double = 900000.00 + let givenBillion: Double = 1000000000.00 + XCTAssertEqual(givenThousand.shortCurrencyDecription,"₦900K") + XCTAssertEqual(givenMillion.shortCurrencyDecription,"₦1M") + XCTAssertEqual(givenBillion.shortCurrencyDecription, "₦1B") + } +}