Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Bos authored and Johan Bos committed Oct 6, 2018
2 parents 4c2a0ed + 2429cf7 commit 8cc4377
Show file tree
Hide file tree
Showing 26 changed files with 563 additions and 489 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
4.2
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode7.3
language: objective-c
osx_image: xcode10
language: swift
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -workspace DynamicAppConfigIOS/Example/DynamicAppConfig.xcworkspace -scheme DynamicAppConfig-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- set -o pipefail && xcodebuild test -workspace DynamicAppConfigIOS/Example/DynamicAppConfig.xcworkspace -scheme DynamicAppConfig-Example -sdk iphonesimulator12.0 -destination 'platform=iOS Simulator,name=iPhone X,OS=12.0' ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
2 changes: 1 addition & 1 deletion DynamicAppConfig.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'DynamicAppConfig'
s.version = '1.2.0'
s.version = '1.2.1'
s.summary = 'A useful library to support multiple build configurations in one application build.'

# This description is used to generate tags and improve search results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AppConfigViewUtility {
// --

@discardableResult
static func addPinSuperViewEdgeConstraint(view: UIView, parentView: UIView, edge: NSLayoutAttribute, constant: CGFloat = 0) -> NSLayoutConstraint? {
static func addPinSuperViewEdgeConstraint(view: UIView, parentView: UIView, edge: NSLayoutConstraint.Attribute, constant: CGFloat = 0) -> NSLayoutConstraint? {
if edge == .left || edge == .right || edge == .top || edge == .bottom {
let constraint = NSLayoutConstraint(item: view,
attribute: edge,
Expand Down Expand Up @@ -66,7 +66,7 @@ class AppConfigViewUtility {
addPinSuperViewEdgeConstraint(view: view, parentView: parentView, edge: .bottom)
}

static func addSizeAxisConstraint(view: UIView, axisSize: CGFloat, axis: NSLayoutAttribute) {
static func addSizeAxisConstraint(view: UIView, axisSize: CGFloat, axis: NSLayoutConstraint.Attribute) {
if axis == .width || axis == .height {
let constraint = NSLayoutConstraint(item: view,
attribute: axis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ class AppConfigEditViewController : UIViewController, AppConfigEditTableDelegate
// Add cancel button
let cancelButton = UIButton()
cancelButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
cancelButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_CANCEL"), for: UIControlState())
cancelButton.setTitleColor(tintColor, for: UIControlState())
cancelButton.setTitleColor(highlightColor, for: UIControlState.highlighted)
cancelButton.setTitleColor(highlightColor, for: UIControlState.disabled)
cancelButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_CANCEL"), for: UIControl.State())
cancelButton.setTitleColor(tintColor, for: UIControl.State())
cancelButton.setTitleColor(highlightColor, for: UIControl.State.highlighted)
cancelButton.setTitleColor(highlightColor, for: UIControl.State.disabled)
let cancelButtonSize = cancelButton.sizeThatFits(CGSize.zero)
cancelButton.frame = CGRect(x: 0, y: 0, width: cancelButtonSize.width, height: cancelButtonSize.height)
cancelButton.addTarget(self, action: #selector(cancelButtonPressed), for: UIControlEvents.touchUpInside)
cancelButton.addTarget(self, action: #selector(cancelButtonPressed), for: UIControl.Event.touchUpInside)

// Wrap in bar button item
let cancelButtonWrapper = UIBarButtonItem.init(customView: cancelButton)
Expand All @@ -68,13 +68,13 @@ class AppConfigEditViewController : UIViewController, AppConfigEditTableDelegate
// Create button
let saveButton = UIButton()
saveButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
saveButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_SAVE"), for: UIControlState())
saveButton.setTitleColor(tintColor, for: UIControlState())
saveButton.setTitleColor(highlightColor, for: UIControlState.highlighted)
saveButton.setTitleColor(highlightColor, for: UIControlState.disabled)
saveButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_SAVE"), for: UIControl.State())
saveButton.setTitleColor(tintColor, for: UIControl.State())
saveButton.setTitleColor(highlightColor, for: UIControl.State.highlighted)
saveButton.setTitleColor(highlightColor, for: UIControl.State.disabled)
let saveButtonSize = saveButton.sizeThatFits(CGSize.zero)
saveButton.frame = CGRect(x: 0, y: 0, width: saveButtonSize.width, height: saveButtonSize.height)
saveButton.addTarget(self, action: #selector(saveButtonPressed), for: UIControlEvents.touchUpInside)
saveButton.addTarget(self, action: #selector(saveButtonPressed), for: UIControl.Event.touchUpInside)

// Wrap in bar button item
let saveButtonWrapper = UIBarButtonItem.init(customView: saveButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class AppConfigEditTable : UIView, UITableViewDataSource, UITableViewDelegate, A
AppConfigViewUtility.addPinSuperViewEdgesConstraints(view: table, parentView: self)

// Set table view properties
table.rowHeight = UITableViewAutomaticDimension
table.rowHeight = UITableView.automaticDimension
table.estimatedRowHeight = 40
table.dataSource = self
table.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ public class AppConfigManageViewController : UIViewController, AppConfigManageTa
// Create button
let doneButton = UIButton()
doneButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
doneButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_DONE"), for: UIControlState())
doneButton.setTitleColor(tintColor, for: UIControlState())
doneButton.setTitleColor(highlightColor, for: UIControlState.highlighted)
doneButton.setTitle(AppConfigBundle.localizedString(key: "CFLAC_SHARED_DONE"), for: UIControl.State())
doneButton.setTitleColor(tintColor, for: UIControl.State())
doneButton.setTitleColor(highlightColor, for: UIControl.State.highlighted)
let size = doneButton.sizeThatFits(CGSize.zero)
doneButton.frame = CGRect(x: 0, y: 0, width: size.width, height: size.height)
doneButton.addTarget(self, action: #selector(doneButtonPressed), for: UIControlEvents.touchUpInside)
doneButton.addTarget(self, action: #selector(doneButtonPressed), for: UIControl.Event.touchUpInside)

// Wrap in bar button item
let doneButtonWrapper = UIBarButtonItem.init(customView: doneButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AppConfigManageTable : UIView, UITableViewDataSource, UITableViewDelegate,
AppConfigViewUtility.addPinSuperViewEdgesConstraints(view: table, parentView: self)

// Set table view properties
table.rowHeight = UITableViewAutomaticDimension
table.rowHeight = UITableView.automaticDimension
table.estimatedRowHeight = 40
table.dataSource = self
table.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppConfigTableCell : UITableViewCell {
// MARK: Initialize
// --

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupView()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protocol AppConfigSelectionPopupViewDelegate: class {
_tableView.tableFooterView = tableFooter

// Set table view properties
_tableView.rowHeight = UITableViewAutomaticDimension
_tableView.rowHeight = UITableView.automaticDimension
_tableView.estimatedRowHeight = 40
_tableView.dataSource = self
_tableView.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
04EB15531D0DA9A300D5E380 /* ExampleAppConfigRunType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EB15501D0DA9A300D5E380 /* ExampleAppConfigRunType.swift */; };
04EB15551D0DAA1100D5E380 /* AppConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = 04EB15541D0DAA1100D5E380 /* AppConfig.plist */; };
343136A6C445D20ECD32A714 /* Pods_DynamicAppConfig_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4030E709494F9DE7881FC1EF /* Pods_DynamicAppConfig_Example.framework */; };
4266B45F7A8BE94CE9FBEC08 /* Pods_AppConfigSwift_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2AD9183BF0F91E271AEAEE1 /* Pods_AppConfigSwift_Tests.framework */; };
50BAFA0856DBE481F07AA924 /* Pods_DynamicAppConfig_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2EFAF6B7FD9271A250CEEB1 /* Pods_DynamicAppConfig_Tests.framework */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
607FACEC1AFB9204008FA782 /* AppConfigBaseModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* AppConfigBaseModelTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -70,7 +69,7 @@
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
607FACE51AFB9204008FA782 /* DynamicAppConfig_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DynamicAppConfig_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
607FACEB1AFB9204008FA782 /* AppConfigBaseModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConfigBaseModelTests.swift; sourceTree = "<group>"; };
6386DE2A7899A9DCC4BC13DB /* Pods-AppConfigSwift_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppConfigSwift_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AppConfigSwift_Tests/Pods-AppConfigSwift_Tests.release.xcconfig"; sourceTree = "<group>"; };
8A62596554929964A18EA2CF /* Pods-AppConfigSwift_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppConfigSwift_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-AppConfigSwift_Example/Pods-AppConfigSwift_Example.release.xcconfig"; sourceTree = "<group>"; };
8F73B6A0D6924DF3701994DF /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
Expand All @@ -95,7 +94,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4266B45F7A8BE94CE9FBEC08 /* Pods_AppConfigSwift_Tests.framework in Frameworks */,
50BAFA0856DBE481F07AA924 /* Pods_DynamicAppConfig_Tests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -185,7 +183,7 @@
607FACE81AFB9204008FA782 /* Tests */ = {
isa = PBXGroup;
children = (
607FACEB1AFB9204008FA782 /* Tests.swift */,
607FACEB1AFB9204008FA782 /* AppConfigBaseModelTests.swift */,
607FACE91AFB9204008FA782 /* Supporting Files */,
);
path = Tests;
Expand Down Expand Up @@ -293,11 +291,11 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -423,7 +421,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */,
607FACEC1AFB9204008FA782 /* AppConfigBaseModelTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -525,8 +523,7 @@
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-D\" \"QA\"";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = QA;
};
Expand All @@ -542,8 +539,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DynamicAppConfig_Example.app/DynamicAppConfig_Example";
};
name = QA;
Expand Down Expand Up @@ -665,8 +661,7 @@
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-D\" \"DEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -683,8 +678,7 @@
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-D\" \"RELEASE\"";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -704,8 +698,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DynamicAppConfig_Example.app/DynamicAppConfig_Example";
};
name = Debug;
Expand All @@ -722,8 +715,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DynamicAppConfig_Example.app/DynamicAppConfig_Example";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ import UIKit
import DynamicAppConfig

// Enum definition using string raw values for storage
enum ExampleAppConfigLogLevel: String {
enum ExampleAppConfigLogLevel: String, CaseIterable {

case logDisabled = "logDisabled"
case logNormal = "logNormal"
case logVerbose = "logVerbose"

static func allValues() -> [ExampleAppConfigLogLevel] {
return [logDisabled, logNormal, logVerbose]
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class ExampleAppConfigModel : AppConfigBaseModel {
mapper.map(key: "apiUrl", value: &apiUrl, category: "API related")
mapper.map(key: "networkTimeoutSec", value: &networkTimeoutSec, category: "API related")
mapper.map(key: "acceptAllSSL", value: &acceptAllSSL, category: "API related")
mapper.map(key: "runType", value: &runType, fallback: .runNormally, allValues: ExampleAppConfigRunType.allValues())
mapper.map(key: "runType", value: &runType, fallback: .runNormally, allValues: ExampleAppConfigRunType.allCases)

// Global serialization
mapper.map(key: "consoleUrl", value: &consoleUrl, category: "Console related", global: true)
mapper.map(key: "consoleTimeoutSec", value: &consoleTimeoutSec, category: "Console related", global: true)
mapper.map(key: "consoleEnabled", value: &consoleEnabled, category: "Console related", global: true)
mapper.map(key: "logLevel", value: &logLevel, fallback: .logDisabled, allValues: ExampleAppConfigLogLevel.allValues(), global: true)
mapper.map(key: "logLevel", value: &logLevel, fallback: .logDisabled, allValues: ExampleAppConfigLogLevel.allCases, global: true)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ import UIKit
import DynamicAppConfig

// Enum definition using string raw values for storage
enum ExampleAppConfigRunType: String {
enum ExampleAppConfigRunType: String, CaseIterable {

case runNormally = "runNormally"
case runQuickly = "runQuickly"
case runStrictly = "runStrictly"

static func allValues() -> [ExampleAppConfigRunType] {
return [runNormally, runQuickly, runStrictly]
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// MARK: Lifecycle callbacks
// --

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
#if RELEASE
// Disable library
#else
Expand Down
5 changes: 1 addition & 4 deletions DynamicAppConfigIOS/Example/DynamicAppConfig/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import UIKit

_ = UIApplicationMain(
CommandLine.argc,
UnsafeMutableRawPointer(CommandLine.unsafeArgv)
.bindMemory(
to: UnsafeMutablePointer<Int8>.self,
capacity: Int(CommandLine.argc)),
CommandLine.unsafeArgv,
NSStringFromClass(Application.self),
NSStringFromClass(AppDelegate.self)
)
2 changes: 2 additions & 0 deletions DynamicAppConfigIOS/Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use_frameworks!

platform :ios, '8.0'

target 'DynamicAppConfig_Example' do
pod 'DynamicAppConfig', :path => '../../'

Expand Down
6 changes: 3 additions & 3 deletions DynamicAppConfigIOS/Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- DynamicAppConfig (1.2.0)
- DynamicAppConfig (1.2.1)

DEPENDENCIES:
- DynamicAppConfig (from `../../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
DynamicAppConfig: fd1db85e1b294aa7faacce8bdc50a888efd405a4
DynamicAppConfig: a4f4e23b48148c99ef0dda744fd4fa811bcad8ac

PODFILE CHECKSUM: bd8d7527006aac0815d1773127b8a71dc167f62a
PODFILE CHECKSUM: cb373a2b4314e0581791a6d5de43643c6092c08d

COCOAPODS: 1.5.3

0 comments on commit 8cc4377

Please sign in to comment.