Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Bos authored and Johan Bos committed Oct 4, 2019
2 parents 46a445f + 6492a31 commit 50c7644
Show file tree
Hide file tree
Showing 26 changed files with 732 additions and 708 deletions.
2 changes: 1 addition & 1 deletion DynamicAppConfig.podspec
Expand Up @@ -8,7 +8,7 @@

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

Expand Down
Expand Up @@ -246,8 +246,8 @@ class AppConfigEditTable : UIView, UITableViewDataSource, UITableViewDelegate, A

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Create cell (if needed)
let tableValue = tableValues[(indexPath as NSIndexPath).row]
let nextType = (indexPath as NSIndexPath).row + 1 < tableValues.count ? tableValues[(indexPath as NSIndexPath).row + 1].type : AppConfigEditTableValueType.unknown
let tableValue = tableValues[indexPath.row]
let nextType = indexPath.row + 1 < tableValues.count ? tableValues[indexPath.row + 1].type : AppConfigEditTableValueType.unknown
let cell = tableView.dequeueReusableCell(withIdentifier: tableValue.type.rawValue) as? AppConfigTableCell ?? AppConfigTableCell()

// Set up a loader cell
Expand Down Expand Up @@ -369,7 +369,7 @@ class AppConfigEditTable : UIView, UITableViewDataSource, UITableViewDelegate, A
// --

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let tableValue = tableValues[(indexPath as NSIndexPath).row]
let tableValue = tableValues[indexPath.row]
UIApplication.shared.sendAction(#selector(resignFirstResponder), to: nil, from: nil, for: nil)
if tableValue.type == .action && delegate != nil {
switch tableValue.action {
Expand Down Expand Up @@ -413,7 +413,7 @@ class AppConfigEditTable : UIView, UITableViewDataSource, UITableViewDelegate, A
// Observe buttons and present
alert.addAction(UIAlertAction(title: AppConfigBundle.localizedString(key: "CFLAC_SHARED_OK"), style: .default, handler: { [weak alert] (_) in
let enteredText = alert?.textFields?[0].text ?? ""
self.tableValues[(indexPath as NSIndexPath).row] = AppConfigEditTableValue.valueForTextEntry(configSetting: tableValue.configSetting ?? "", andValue: enteredText, numberOnly: tableValue.limitUsage)
self.tableValues[indexPath.row] = AppConfigEditTableValue.valueForTextEntry(configSetting: tableValue.configSetting ?? "", andValue: enteredText, numberOnly: tableValue.limitUsage)
tableView.reloadRows(at: [indexPath], with: .none)
self.delegate?.configChanged(newSettings: self.obtainNewConfigurationSettings())
}))
Expand Down
Expand Up @@ -60,10 +60,13 @@ public class AppConfigManageViewController : UIViewController, AppConfigManageTa
// MARK: Launching
// --

public static func launch() {
public static func launch(forceFullscreen: Bool = true) {
if AppConfigManageViewController.isOpenCounter == 0 && AppConfigStorage.shared.isActivated() {
let viewController = AppConfigManageViewController()
let navigationController = UINavigationController.init(rootViewController: viewController)
if forceFullscreen {
navigationController.modalPresentationStyle = .overFullScreen
}
ac_topmostViewController?.present(navigationController, animated: true, completion: nil)
}
}
Expand Down
Expand Up @@ -282,8 +282,8 @@ class AppConfigManageTable : UIView, UITableViewDataSource, UITableViewDelegate,

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Create cell (if needed)
let tableValue = tableValues[(indexPath as NSIndexPath).row]
let nextType = (indexPath as NSIndexPath).row + 1 < tableValues.count ? tableValues[(indexPath as NSIndexPath).row + 1].type : AppConfigManageTableValueType.unknown
let tableValue = tableValues[indexPath.row]
let nextType = indexPath.row + 1 < tableValues.count ? tableValues[indexPath.row + 1].type : AppConfigManageTableValueType.unknown
let cell = tableView.dequeueReusableCell(withIdentifier: tableValue.type.rawValue) as? AppConfigTableCell ?? AppConfigTableCell()

// Set up a loader cell
Expand Down Expand Up @@ -434,13 +434,13 @@ class AppConfigManageTable : UIView, UITableViewDataSource, UITableViewDelegate,
}

func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
let tableValue = tableValues[(indexPath as NSIndexPath).row]
let tableValue = tableValues[indexPath.row]
return tableValue.type == .config && tableValue.config != nil
}

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let editAction = UITableViewRowAction.init(style: .normal, title: AppConfigBundle.localizedString(key: "CFLAC_MANAGE_SWIPE_EDIT"), handler: { action, indexPath in
let tableValue = self.tableValues[(indexPath as NSIndexPath).row]
let tableValue = self.tableValues[indexPath.row]
tableView.setEditing(false, animated: true)
if tableValue.config != nil {
self.delegate?.editConfig(configName: tableValue.config!)
Expand All @@ -456,7 +456,7 @@ class AppConfigManageTable : UIView, UITableViewDataSource, UITableViewDelegate,
// --

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let tableValue = tableValues[(indexPath as NSIndexPath).row]
let tableValue = tableValues[indexPath.row]
if delegate != nil {
if tableValue.config != nil {
delegate?.selectedConfig(configName: tableValue.config!)
Expand Down Expand Up @@ -495,7 +495,7 @@ class AppConfigManageTable : UIView, UITableViewDataSource, UITableViewDelegate,
// Observe buttons and present
alert.addAction(UIAlertAction(title: AppConfigBundle.localizedString(key: "CFLAC_SHARED_OK"), style: .default, handler: { [weak alert] (_) in
let enteredText = alert?.textFields?[0].text ?? ""
self.tableValues[(indexPath as NSIndexPath).row] = AppConfigManageTableValue.valueForTextEntry(configSetting: tableValue.configSetting ?? "", andValue: enteredText, numberOnly: tableValue.limitUsage)
self.tableValues[indexPath.row] = AppConfigManageTableValue.valueForTextEntry(configSetting: tableValue.configSetting ?? "", andValue: enteredText, numberOnly: tableValue.limitUsage)
editTextCellView.value = enteredText
tableView.reloadRows(at: [indexPath], with: .none)
}))
Expand Down
Expand Up @@ -35,7 +35,7 @@ enum AppConfigCellSectionLocation: String {

@IBInspectable var dividerLocation: String = "" {
didSet {
location = AppConfigCellSectionLocation.init(rawValue: dividerLocation) ?? .none
location = AppConfigCellSectionLocation.init(rawValue: dividerLocation) ?? AppConfigCellSectionLocation.none
}
}

Expand Down
Expand Up @@ -148,7 +148,7 @@ protocol AppConfigSelectionPopupViewDelegate: class {
let cell = tableView.dequeueReusableCell(withIdentifier: "ignored") as? AppConfigTableCell ?? AppConfigTableCell()

// Regular cell view
if (indexPath as NSIndexPath).row < _tableChoices.count {
if indexPath.row < _tableChoices.count {
// Create view
if cell.cellView == nil {
cell.cellView = AppConfigItemCellView()
Expand All @@ -158,12 +158,12 @@ protocol AppConfigSelectionPopupViewDelegate: class {
// Supply data and return the cell
cell.selectionStyle = .default
cell.accessoryType = .disclosureIndicator
cell.shouldHideDivider = (indexPath as NSIndexPath).row + 1 >= _tableChoices.count
cellView?.label = _tableChoices[(indexPath as NSIndexPath).row]
cell.shouldHideDivider = indexPath.row + 1 >= _tableChoices.count
cellView?.label = _tableChoices[indexPath.row]
}

// Bottom divider
if (indexPath as NSIndexPath).row >= _tableChoices.count {
if indexPath.row >= _tableChoices.count {
// Create view
if cell.cellView == nil {
cell.cellView = AppConfigCellSectionDividerView(location: .bottom)
Expand All @@ -183,11 +183,13 @@ protocol AppConfigSelectionPopupViewDelegate: class {
// --

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if delegate != nil {
delegate?.selectedItem(_tableChoices[(indexPath as NSIndexPath).row], token: token)
}
_tableView.deselectRow(at: indexPath, animated: false)
dismiss()
if indexPath.row < _tableChoices.count {
if delegate != nil {
delegate?.selectedItem(_tableChoices[indexPath.row], token: token)
}
dismiss()
}
}

}
6 changes: 3 additions & 3 deletions DynamicAppConfigIOS/Example/Podfile.lock
@@ -1,5 +1,5 @@
PODS:
- DynamicAppConfig (1.3.2)
- DynamicAppConfig (1.3.3)

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

SPEC CHECKSUMS:
DynamicAppConfig: 57728cfdc8bc08d7e1731d914a413d7ca36a368e
DynamicAppConfig: ff610086de74d1a61be2cb2b0ba94308dd20b411

PODFILE CHECKSUM: 79e308523c8fc52743ffa5d4cef5c6dbd80b623b

COCOAPODS: 1.6.1
COCOAPODS: 1.8.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions DynamicAppConfigIOS/Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 50c7644

Please sign in to comment.