Explorar o código

Update Pod Libraries

Jon Fawcett %!s(int64=4) %!d(string=hai) anos
pai
achega
52fd7fa1e3

+ 5 - 5
Podfile.lock

@@ -2,7 +2,7 @@ PODS:
   - Charts (3.6.0):
   - Charts (3.6.0):
     - Charts/Core (= 3.6.0)
     - Charts/Core (= 3.6.0)
   - Charts/Core (3.6.0)
   - Charts/Core (3.6.0)
-  - Eureka (5.3.0)
+  - Eureka (5.3.4)
   - ShareClient (1.2)
   - ShareClient (1.2)
 
 
 DEPENDENCIES:
 DEPENDENCIES:
@@ -23,16 +23,16 @@ EXTERNAL SOURCES:
 
 
 CHECKOUT OPTIONS:
 CHECKOUT OPTIONS:
   Eureka:
   Eureka:
-    :commit: e1bb4d668cb5b2280133709f47119eb34c2b65df
+    :commit: 94475e83a6965320283b8b39986e7481ad675ab9
     :git: https://github.com/xmartlabs/Eureka.git
     :git: https://github.com/xmartlabs/Eureka.git
   ShareClient:
   ShareClient:
-    :commit: bcc9cf9ab35b9a6d3b198507cb057f58b5df1ff0
+    :commit: 2dfaf101ed528e2a92f3791f5384ed368dc7144a
     :git: https://github.com/jonfawcett/dexcom-share-client-swift.git
     :git: https://github.com/jonfawcett/dexcom-share-client-swift.git
 
 
 SPEC CHECKSUMS:
 SPEC CHECKSUMS:
   Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af
   Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af
-  Eureka: 49239596c9d2eed9ab523990c34de62b6feac9f0
-  ShareClient: 8d60bcd3fd106ca42c6e71e8bcae24deb173fb9e
+  Eureka: 60cf058f86a8fb3ed26165ba5292b9850361b0a6
+  ShareClient: 08a3e6b9889b41172b98c4e386d23084bafbeec4
 
 
 PODFILE CHECKSUM: 084f5ab2f55c59ed2c2fa3cdaaa9590c99a95408
 PODFILE CHECKSUM: 084f5ab2f55c59ed2c2fa3cdaaa9590c99a95408
 
 

+ 1 - 1
Pods/Eureka/README.md

@@ -1075,7 +1075,7 @@ $ pod install
 After you set up your `Package.swift` manifest file, you can add Eureka as a dependency by adding it to the dependencies value of your `Package.swift`.
 After you set up your `Package.swift` manifest file, you can add Eureka as a dependency by adding it to the dependencies value of your `Package.swift`.
 
 
 dependencies: [
 dependencies: [
-    .package(url: "https://github.com/xmartlabs/Eureka.git", from: "5.3.0")
+    .package(url: "https://github.com/xmartlabs/Eureka.git", from: "5.3.4")
 ]
 ]
 
 
 
 

+ 3 - 2
Pods/Eureka/Source/Core/Cell.swift

@@ -26,6 +26,7 @@ import Foundation
 import UIKit
 import UIKit
 
 
 /// Base class for the Eureka cells
 /// Base class for the Eureka cells
+@objc(EurekaBaseCell)
 open class BaseCell: UITableViewCell, BaseCellType {
 open class BaseCell: UITableViewCell, BaseCellType {
 
 
     /// Untyped row associated to this cell.
     /// Untyped row associated to this cell.
@@ -46,12 +47,12 @@ open class BaseCell: UITableViewCell, BaseCellType {
      Function that returns the FormViewController this cell belongs to.
      Function that returns the FormViewController this cell belongs to.
      */
      */
     public func formViewController() -> FormViewController? {
     public func formViewController() -> FormViewController? {
-        var responder: AnyObject? = self
+        var responder: UIResponder? = self
         while responder != nil {
         while responder != nil {
             if let formVC = responder as? FormViewController {
             if let formVC = responder as? FormViewController {
               return formVC
               return formVC
             }
             }
-            responder = responder?.next
+            responder = (responder as? UIResponder)?.next
         }
         }
         return nil
         return nil
     }
     }

+ 1 - 1
Pods/Eureka/Source/Core/CellType.swift

@@ -27,7 +27,7 @@ import UIKit
 
 
 // MARK: Cell Protocols
 // MARK: Cell Protocols
 
 
-public protocol BaseCellType : class {
+public protocol BaseCellType : AnyObject {
 
 
     /// Method that will return the height of the cell
     /// Method that will return the height of the cell
     var height : (() -> CGFloat)? { get }
     var height : (() -> CGFloat)? { get }

+ 6 - 2
Pods/Eureka/Source/Core/Core.swift

@@ -392,6 +392,7 @@ public struct InlineRowHideOptions: OptionSet {
 }
 }
 
 
 /// View controller that shows a form.
 /// View controller that shows a form.
+@objc(EurekaFormViewController)
 open class FormViewController: UIViewController, FormViewControllerProtocol, FormDelegate {
 open class FormViewController: UIViewController, FormViewControllerProtocol, FormDelegate {
 
 
     @IBOutlet public var tableView: UITableView!
     @IBOutlet public var tableView: UITableView!
@@ -421,6 +422,9 @@ open class FormViewController: UIViewController, FormViewControllerProtocol, For
 
 
     /// Enables animated scrolling on row navigation
     /// Enables animated scrolling on row navigation
     open var animateScroll = false
     open var animateScroll = false
+    
+    /// The default scroll position on the focussed cell when keyboard appears
+    open var defaultScrollPosition = UITableView.ScrollPosition.none
 
 
     /// Accessory view that is responsible for the navigation between rows
     /// Accessory view that is responsible for the navigation between rows
     private var navigationAccessoryView: (UIView & NavigationAccessory)!
     private var navigationAccessoryView: (UIView & NavigationAccessory)!
@@ -432,7 +436,7 @@ open class FormViewController: UIViewController, FormViewControllerProtocol, For
 
 
     /// Defines the behaviour of the navigation between rows
     /// Defines the behaviour of the navigation between rows
     public var navigationOptions: RowNavigationOptions?
     public var navigationOptions: RowNavigationOptions?
-    private var tableViewStyle: UITableView.Style = .grouped
+    public var tableViewStyle: UITableView.Style = .grouped
 
 
     public init(style: UITableView.Style) {
     public init(style: UITableView.Style) {
         super.init(nibName: nil, bundle: nil)
         super.init(nibName: nil, bundle: nil)
@@ -1039,7 +1043,7 @@ extension FormViewController {
                     let rect = table.rectForRow(at: selectedRow)
                     let rect = table.rectForRow(at: selectedRow)
                     table.scrollRectToVisible(rect, animated: animateScroll)
                     table.scrollRectToVisible(rect, animated: animateScroll)
                 } else {
                 } else {
-                    table.scrollToRow(at: selectedRow, at: .none, animated: animateScroll)
+                    table.scrollToRow(at: selectedRow, at: defaultScrollPosition, animated: animateScroll)
                 }
                 }
             }
             }
             UIView.commitAnimations()
             UIView.commitAnimations()

+ 45 - 4
Pods/Eureka/Source/Core/Form.swift

@@ -25,7 +25,7 @@
 import Foundation
 import Foundation
 
 
 /// The delegate of the Eureka form.
 /// The delegate of the Eureka form.
-public protocol FormDelegate : class {
+public protocol FormDelegate : AnyObject {
     func sectionsHaveBeenAdded(_ sections: [Section], at: IndexSet)
     func sectionsHaveBeenAdded(_ sections: [Section], at: IndexSet)
     func sectionsHaveBeenRemoved(_ sections: [Section], at: IndexSet)
     func sectionsHaveBeenRemoved(_ sections: [Section], at: IndexSet)
     func sectionsHaveBeenReplaced(oldSections: [Section], newSections: [Section], at: IndexSet)
     func sectionsHaveBeenReplaced(oldSections: [Section], newSections: [Section], at: IndexSet)
@@ -213,15 +213,20 @@ extension Form : RangeReplaceableCollection {
         }
         }
     }
     }
 
 
-    public func replaceSubrange<C: Collection>(_ subRange: Range<Int>, with newElements: C) where C.Iterator.Element == Section {
+    public func replaceSubrange<C: Collection>(
+        _ subRange: Range<Int>,
+        with newElements: C
+    ) where C.Iterator.Element == Section {
         for i in subRange.lowerBound..<subRange.upperBound {
         for i in subRange.lowerBound..<subRange.upperBound {
             if let section = kvoWrapper.sections.object(at: i) as? Section {
             if let section = kvoWrapper.sections.object(at: i) as? Section {
                 section.willBeRemovedFromForm()
                 section.willBeRemovedFromForm()
                 kvoWrapper._allSections.remove(at: kvoWrapper._allSections.firstIndex(of: section)!)
                 kvoWrapper._allSections.remove(at: kvoWrapper._allSections.firstIndex(of: section)!)
             }
             }
         }
         }
-        kvoWrapper.sections.replaceObjects(in: NSRange(location: subRange.lowerBound, length: subRange.upperBound - subRange.lowerBound),
-                                           withObjectsFrom: newElements.map { $0 })
+        kvoWrapper.sections.replaceObjects(
+            in: NSRange(location: subRange.lowerBound, length: subRange.upperBound - subRange.lowerBound),
+            withObjectsFrom: newElements.map { $0 }
+        )
         kvoWrapper._allSections.insert(contentsOf: newElements, at: indexForInsertion(at: subRange.lowerBound))
         kvoWrapper._allSections.insert(contentsOf: newElements, at: indexForInsertion(at: subRange.lowerBound))
 
 
         for section in newElements {
         for section in newElements {
@@ -229,6 +234,29 @@ extension Form : RangeReplaceableCollection {
         }
         }
     }
     }
 
 
+    public func replaceSubrangeInAllSections<C: Collection>(
+        _ subRange: Range<Int>,
+        with newElements: C
+    ) where C.Iterator.Element == Section {
+        // Remove subrange in all sections
+        for i in subRange.reversed() where kvoWrapper._allSections.count > i {
+            let removed = kvoWrapper._allSections.remove(at: i)
+            removed.willBeRemovedFromForm()
+        }
+
+        kvoWrapper._allSections.insert(contentsOf: newElements, at: indexForInsertion(at: subRange.lowerBound))
+
+        // Replace all visible sections by `kvoWrapper._allSections`, as hidden ones are being removed later anyway
+        kvoWrapper.sections.replaceObjects(
+            in: NSRange(location: 0, length: kvoWrapper.sections.count),
+            withObjectsFrom: kvoWrapper._allSections
+        )
+
+        for section in newElements {
+            section.wasAddedTo(form: self)
+        }
+    }
+
     public func removeAll(keepingCapacity keepCapacity: Bool = false) {
     public func removeAll(keepingCapacity keepCapacity: Bool = false) {
         // not doing anything with capacity
         // not doing anything with capacity
 
 
@@ -238,7 +266,20 @@ extension Form : RangeReplaceableCollection {
         for section in sections {
         for section in sections {
             section.willBeRemovedFromForm()
             section.willBeRemovedFromForm()
         }
         }
+    }
+
+    public func removeAll(where shouldBeRemoved: (Section) throws -> Bool) rethrows {
+        let indices = try kvoWrapper._allSections.enumerated()
+            .filter { try shouldBeRemoved($0.element)}
+            .map { $0.offset }
+
+        var removedSections = [Section]()
+        for index in indices.reversed() {
+            removedSections.append(kvoWrapper._allSections.remove(at: index))
+        }
+        kvoWrapper.sections.removeObjects(in: removedSections)
 
 
+        removedSections.forEach { $0.willBeRemovedFromForm() }
     }
     }
 
 
     private func indexForInsertion(at index: Int) -> Int {
     private func indexForInsertion(at index: Int) -> Int {

+ 1 - 0
Pods/Eureka/Source/Core/NavigationAccessoryView.swift

@@ -35,6 +35,7 @@ public protocol NavigationAccessory {
 }
 }
 
 
 /// Class for the navigation accessory view used in FormViewController
 /// Class for the navigation accessory view used in FormViewController
+@objc(EurekaNavigationAccessoryView)
 open class NavigationAccessoryView: UIToolbar, NavigationAccessory {
 open class NavigationAccessoryView: UIToolbar, NavigationAccessory {
     open var previousButton: UIBarButtonItem!
     open var previousButton: UIBarButtonItem!
     open var nextButton: UIBarButtonItem!
     open var nextButton: UIBarButtonItem!

+ 15 - 1
Pods/Eureka/Source/Core/Section.swift

@@ -26,7 +26,7 @@ import Foundation
 import UIKit
 import UIKit
 
 
 /// The delegate of the Eureka sections.
 /// The delegate of the Eureka sections.
-public protocol SectionDelegate: class {
+public protocol SectionDelegate: AnyObject {
     func rowsHaveBeenAdded(_ rows: [BaseRow], at: IndexSet)
     func rowsHaveBeenAdded(_ rows: [BaseRow], at: IndexSet)
     func rowsHaveBeenRemoved(_ rows: [BaseRow], at: IndexSet)
     func rowsHaveBeenRemoved(_ rows: [BaseRow], at: IndexSet)
     func rowsHaveBeenReplaced(oldRows: [BaseRow], newRows: [BaseRow], at: IndexSet)
     func rowsHaveBeenReplaced(oldRows: [BaseRow], newRows: [BaseRow], at: IndexSet)
@@ -324,6 +324,20 @@ extension Section: RangeReplaceableCollection {
         }
         }
     }
     }
 
 
+    public func removeAll(where shouldBeRemoved: (BaseRow) throws -> Bool) rethrows {
+        let indices = try kvoWrapper._allRows.enumerated()
+            .filter { try shouldBeRemoved($0.element)}
+            .map { $0.offset }
+        
+        var removedRows = [BaseRow]()
+        for index in indices.reversed() {
+            removedRows.append(kvoWrapper._allRows.remove(at: index))
+        }
+        kvoWrapper.rows.removeObjects(in: removedRows)
+
+        removedRows.forEach { $0.willBeRemovedFromSection() }
+    }
+
     @discardableResult
     @discardableResult
     public func remove(at position: Int) -> BaseRow {
     public func remove(at position: Int) -> BaseRow {
         let row = kvoWrapper.rows.object(at: position) as! BaseRow
         let row = kvoWrapper.rows.object(at: position) as! BaseRow

+ 1 - 1
Pods/Eureka/Source/Core/Validation.swift

@@ -66,7 +66,7 @@ public struct ValidationOptions: OptionSet {
 
 
 public struct ValidationRuleHelper<T> where T: Equatable {
 public struct ValidationRuleHelper<T> where T: Equatable {
     let validateFn: ((T?) -> ValidationError?)
     let validateFn: ((T?) -> ValidationError?)
-    let rule: BaseRuleType
+    public let rule: BaseRuleType
 }
 }
 
 
 public struct RuleSet<T: Equatable> {
 public struct RuleSet<T: Equatable> {

+ 8 - 2
Pods/Eureka/Source/Rows/Common/DateFieldRow.swift

@@ -25,7 +25,7 @@
 import Foundation
 import Foundation
 import UIKit
 import UIKit
 
 
-public protocol DatePickerRowProtocol: class {
+public protocol DatePickerRowProtocol: AnyObject {
     var minimumDate: Date? { get set }
     var minimumDate: Date? { get set }
     var maximumDate: Date? { get set }
     var maximumDate: Date? { get set }
     var minuteInterval: Int? { get set }
     var minuteInterval: Int? { get set }
@@ -51,6 +51,12 @@ open class DateCell: Cell<Date>, CellType {
         editingAccessoryType =  .none
         editingAccessoryType =  .none
         datePicker.datePickerMode = datePickerMode()
         datePicker.datePickerMode = datePickerMode()
         datePicker.addTarget(self, action: #selector(DateCell.datePickerValueChanged(_:)), for: .valueChanged)
         datePicker.addTarget(self, action: #selector(DateCell.datePickerValueChanged(_:)), for: .valueChanged)
+
+        #if swift(>=5.2)
+            if #available(iOS 13.4, *) {
+                datePicker.preferredDatePickerStyle = .wheels
+            }
+        #endif
     }
     }
 
 
     deinit {
     deinit {
@@ -83,7 +89,7 @@ open class DateCell: Cell<Date>, CellType {
         return datePicker
         return datePicker
     }
     }
 
 
-    @objc func datePickerValueChanged(_ sender: UIDatePicker) {
+    @objc(pickerDateChanged:) func datePickerValueChanged(_ sender: UIDatePicker) {
         row.value = sender.date
         row.value = sender.date
         detailTextLabel?.text = row.displayValueFor?(row.value)
         detailTextLabel?.text = row.displayValueFor?(row.value)
     }
     }

+ 2 - 0
Pods/Eureka/Source/Rows/Common/FieldRow.swift

@@ -372,6 +372,8 @@ open class _FieldCell<T> : Cell<T>, UITextFieldDelegate, TextFieldCell where T:
     }
     }
 
 
     @objc open func textFieldDidChange(_ textField: UITextField) {
     @objc open func textFieldDidChange(_ textField: UITextField) {
+        
+        guard textField.markedTextRange == nil else { return }
 
 
         guard let textValue = textField.text else {
         guard let textValue = textField.text else {
             row.value = nil
             row.value = nil

+ 2 - 2
Pods/Eureka/Source/Rows/Common/Protocols.swift

@@ -24,12 +24,12 @@
 
 
 import Foundation
 import Foundation
 
 
-public protocol FormatterConformance: class {
+public protocol FormatterConformance: AnyObject {
     var formatter: Formatter? { get set }
     var formatter: Formatter? { get set }
     var useFormatterDuringInput: Bool { get set }
     var useFormatterDuringInput: Bool { get set }
     var useFormatterOnDidBeginEditing: Bool? { get set }
     var useFormatterOnDidBeginEditing: Bool? { get set }
 }
 }
 
 
-public protocol NoValueDisplayTextConformance: class {
+public protocol NoValueDisplayTextConformance: AnyObject {
     var noValueDisplayText: String? { get set }
     var noValueDisplayText: String? { get set }
 }
 }

+ 1 - 1
Pods/Eureka/Source/Rows/Controllers/SelectorViewController.swift

@@ -172,7 +172,7 @@ open class _SelectorViewController<Row: SelectableRowType, OptionsRow: OptionsPr
                                  footer: sectionFooterTitleForKey?(sectionKey))
                                  footer: sectionFooterTitleForKey?(sectionKey))
             }
             }
         } else {
         } else {
-            form +++ section(with: options, header: row.title, footer: nil)
+            form +++ section(with: options, header: nil, footer: nil)
         }
         }
     }
     }
     
     

+ 15 - 1
Pods/Eureka/Source/Rows/DatePickerRow.swift

@@ -53,6 +53,20 @@ open class DatePickerCell: Cell<Date>, CellType {
         height = { UITableView.automaticDimension }
         height = { UITableView.automaticDimension }
         datePicker.datePickerMode = datePickerMode()
         datePicker.datePickerMode = datePickerMode()
         datePicker.addTarget(self, action: #selector(DatePickerCell.datePickerValueChanged(_:)), for: .valueChanged)
         datePicker.addTarget(self, action: #selector(DatePickerCell.datePickerValueChanged(_:)), for: .valueChanged)
+
+        if datePicker.datePickerMode != .countDownTimer {
+            #if swift(>=5.2)
+                if #available(iOS 14.0, *) {
+                    #if swift(>=5.3) && !(os(OSX) || (os(iOS) && targetEnvironment(macCatalyst)))
+                        datePicker.preferredDatePickerStyle = .inline
+                    #else
+                        datePicker.preferredDatePickerStyle = .wheels
+                    #endif
+                } else if #available(iOS 13.4, *) {
+                    datePicker.preferredDatePickerStyle = .wheels
+                }
+             #endif
+        }
     }
     }
 
 
     deinit {
     deinit {
@@ -73,7 +87,7 @@ open class DatePickerCell: Cell<Date>, CellType {
         }
         }
     }
     }
 
 
-    @objc func datePickerValueChanged(_ sender: UIDatePicker) {
+    @objc(pickerDateChanged:) func datePickerValueChanged(_ sender: UIDatePicker) {
         row?.value = sender.date
         row?.value = sender.date
         
         
         // workaround for UIDatePicker bug when it doesn't trigger "value changed" event after trying to pick 00:00 value
         // workaround for UIDatePicker bug when it doesn't trigger "value changed" event after trying to pick 00:00 value

+ 3 - 0
Pods/Eureka/Source/Rows/FieldsRow.swift

@@ -138,6 +138,9 @@ open class PasswordCell: _FieldCell<String>, CellType {
         textField.autocapitalizationType = .none
         textField.autocapitalizationType = .none
         textField.keyboardType = .asciiCapable
         textField.keyboardType = .asciiCapable
         textField.isSecureTextEntry = true
         textField.isSecureTextEntry = true
+        if let textLabel = textLabel {
+            textField.setContentHuggingPriority(textLabel.contentHuggingPriority(for: .horizontal) - 1, for: .horizontal)
+        }
         if #available(iOS 11,*) {
         if #available(iOS 11,*) {
             textField.textContentType = .password
             textField.textContentType = .password
         }
         }

+ 4 - 4
Pods/Eureka/Source/Rows/SegmentedRow.swift

@@ -114,8 +114,8 @@ open class SegmentedCell<T: Equatable> : Cell<T>, CellType {
         segmentedControl.isEnabled = !row.isDisabled
         segmentedControl.isEnabled = !row.isDisabled
     }
     }
 
 
-    @objc func valueChanged() {
-        row.value = (row as! SegmentedRow<T>).options?[segmentedControl.selectedSegmentIndex]
+    @objc (valueDidChange) func valueChanged() {
+        row.value = (row as! OptionsRow<Self>).options?[segmentedControl.selectedSegmentIndex]
     }
     }
 
 
     open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
     open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
@@ -131,7 +131,7 @@ open class SegmentedCell<T: Equatable> : Cell<T>, CellType {
     func updateSegmentedControl() {
     func updateSegmentedControl() {
         segmentedControl.removeAllSegments()
         segmentedControl.removeAllSegments()
 
 
-        (row as! SegmentedRow<T>).options?.reversed().forEach {
+        (row as! OptionsRow<Self>).options?.reversed().forEach {
             if let image = $0 as? UIImage {
             if let image = $0 as? UIImage {
                 segmentedControl.insertSegment(with: image, at: 0, animated: false)
                 segmentedControl.insertSegment(with: image, at: 0, animated: false)
             } else {
             } else {
@@ -180,7 +180,7 @@ open class SegmentedCell<T: Equatable> : Cell<T>, CellType {
 
 
     func selectedIndex() -> Int? {
     func selectedIndex() -> Int? {
         guard let value = row.value else { return nil }
         guard let value = row.value else { return nil }
-        return (row as! SegmentedRow<T>).options?.firstIndex(of: value)
+        return (row as! OptionsRow<Self>).options?.firstIndex(of: value)
     }
     }
 }
 }
 
 

+ 2 - 3
Pods/Eureka/Source/Rows/SliderRow.swift

@@ -98,14 +98,13 @@ open class SliderCell: Cell<Float>, CellType {
         super.update()
         super.update()
         titleLabel.text = row.title
         titleLabel.text = row.title
         titleLabel.isHidden = !shouldShowTitle
         titleLabel.isHidden = !shouldShowTitle
-        valueLabel.text = row.displayValueFor?(row.value)
+        valueLabel.text = row.displayValueFor?(row.value ?? slider.minimumValue)
         valueLabel.isHidden = sliderRow.shouldHideValue
         valueLabel.isHidden = sliderRow.shouldHideValue
         slider.value = row.value ?? slider.minimumValue
         slider.value = row.value ?? slider.minimumValue
         slider.isEnabled = !row.isDisabled
         slider.isEnabled = !row.isDisabled
-        
     }
     }
 
 
-    @objc func valueChanged() {
+    @objc (valueDidChange) func valueChanged() {
         let roundedValue: Float
         let roundedValue: Float
         let steps = Float(sliderRow.steps)
         let steps = Float(sliderRow.steps)
         if steps > 0 {
         if steps > 0 {

+ 1 - 1
Pods/Eureka/Source/Rows/StepperRow.swift

@@ -84,7 +84,7 @@ open class StepperCell: Cell<Double>, CellType {
         valueLabel?.text = row.displayValueFor?(row.value)
         valueLabel?.text = row.displayValueFor?(row.value)
     }
     }
 
 
-    @objc func valueChanged() {
+    @objc(valueDidChange) func valueChanged() {
         row.value = stepper.value
         row.value = stepper.value
         row.updateCell()
         row.updateCell()
     }
     }

+ 1 - 1
Pods/Eureka/Source/Rows/SwitchRow.swift

@@ -59,7 +59,7 @@ open class SwitchCell: Cell<Bool>, CellType {
         switchControl.isEnabled = !row.isDisabled
         switchControl.isEnabled = !row.isDisabled
     }
     }
 
 
-    @objc func valueChanged() {
+    @objc (valueDidChange) func valueChanged() {
         row.value = switchControl?.isOn ?? false
         row.value = switchControl?.isOn ?? false
     }
     }
 }
 }

+ 1 - 1
Pods/Eureka/Source/Validations/RuleRegExp.swift

@@ -25,7 +25,7 @@
 import Foundation
 import Foundation
 
 
 public enum RegExprPattern: String {
 public enum RegExprPattern: String {
-    case EmailAddress = "^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-+]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z‌​]{2,})$"
+    case EmailAddress = "^[_A-Za-z0-9-+!?#$%'`*/=~^{}|]+(\\.[_A-Za-z0-9-+!?#$%'`*/=~^{}|]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z‌​]{2,})$"
     case URL = "((https|http)://)((\\w|-)+)(([.]|[/])((\\w|-)+))+([/?#]\\S*)?"
     case URL = "((https|http)://)((\\w|-)+)(([.]|[/])((\\w|-)+))+([/?#]\\S*)?"
     case ContainsNumber = ".*\\d.*"
     case ContainsNumber = ".*\\d.*"
     case ContainsCapital = "^.*?[A-Z].*?$"
     case ContainsCapital = "^.*?[A-Z].*?$"

+ 2 - 2
Pods/Local Podspecs/Eureka.podspec.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "Eureka",
   "name": "Eureka",
-  "version": "5.3.0",
+  "version": "5.3.4",
   "license": "MIT",
   "license": "MIT",
   "summary": "Elegant iOS Forms in pure Swift",
   "summary": "Elegant iOS Forms in pure Swift",
   "homepage": "https://github.com/xmartlabs/Eureka",
   "homepage": "https://github.com/xmartlabs/Eureka",
@@ -11,7 +11,7 @@
   },
   },
   "source": {
   "source": {
     "git": "https://github.com/xmartlabs/Eureka.git",
     "git": "https://github.com/xmartlabs/Eureka.git",
-    "tag": "5.3.0"
+    "tag": "5.3.4"
   },
   },
   "platforms": {
   "platforms": {
     "ios": "9.0"
     "ios": "9.0"

+ 3 - 5
Pods/Local Podspecs/ShareClient.podspec.json

@@ -7,15 +7,13 @@
   "license": "MIT",
   "license": "MIT",
   "authors": "jonfawcett",
   "authors": "jonfawcett",
   "platforms": {
   "platforms": {
-    "ios": "13"
+    "ios": "10.0",
+    "watchos": "6.0"
   },
   },
   "source": {
   "source": {
     "git": "https://github.com/jonfawcett/dexcom-share-client-swift.git",
     "git": "https://github.com/jonfawcett/dexcom-share-client-swift.git",
     "tag": "v1.2"
     "tag": "v1.2"
   },
   },
-  "source_files": [
-    "ShareClient/ShareClient.h",
-    "ShareClient/ShareClient.swift"
-  ],
+  "source_files": "ShareClient/ShareClient.{h,swift}",
   "swift_version": "5.0"
   "swift_version": "5.0"
 }
 }

+ 5 - 5
Pods/Manifest.lock

@@ -2,7 +2,7 @@ PODS:
   - Charts (3.6.0):
   - Charts (3.6.0):
     - Charts/Core (= 3.6.0)
     - Charts/Core (= 3.6.0)
   - Charts/Core (3.6.0)
   - Charts/Core (3.6.0)
-  - Eureka (5.3.0)
+  - Eureka (5.3.4)
   - ShareClient (1.2)
   - ShareClient (1.2)
 
 
 DEPENDENCIES:
 DEPENDENCIES:
@@ -23,16 +23,16 @@ EXTERNAL SOURCES:
 
 
 CHECKOUT OPTIONS:
 CHECKOUT OPTIONS:
   Eureka:
   Eureka:
-    :commit: e1bb4d668cb5b2280133709f47119eb34c2b65df
+    :commit: 94475e83a6965320283b8b39986e7481ad675ab9
     :git: https://github.com/xmartlabs/Eureka.git
     :git: https://github.com/xmartlabs/Eureka.git
   ShareClient:
   ShareClient:
-    :commit: bcc9cf9ab35b9a6d3b198507cb057f58b5df1ff0
+    :commit: 2dfaf101ed528e2a92f3791f5384ed368dc7144a
     :git: https://github.com/jonfawcett/dexcom-share-client-swift.git
     :git: https://github.com/jonfawcett/dexcom-share-client-swift.git
 
 
 SPEC CHECKSUMS:
 SPEC CHECKSUMS:
   Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af
   Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af
-  Eureka: 49239596c9d2eed9ab523990c34de62b6feac9f0
-  ShareClient: 8d60bcd3fd106ca42c6e71e8bcae24deb173fb9e
+  Eureka: 60cf058f86a8fb3ed26165ba5292b9850361b0a6
+  ShareClient: 08a3e6b9889b41172b98c4e386d23084bafbeec4
 
 
 PODFILE CHECKSUM: 084f5ab2f55c59ed2c2fa3cdaaa9590c99a95408
 PODFILE CHECKSUM: 084f5ab2f55c59ed2c2fa3cdaaa9590c99a95408
 
 

+ 64 - 64
Pods/Pods.xcodeproj/project.pbxproj

@@ -1376,6 +1376,43 @@
 			};
 			};
 			name = Release;
 			name = Release;
 		};
 		};
+		5114137E124F7AC49DAB83B911505792 /* Release */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = E085DDC030F8EC270DBA2B97E1CBF58D /* ShareClient.release.xcconfig */;
+			buildSettings = {
+				CLANG_ENABLE_OBJC_WEAK = NO;
+				CODE_SIGN_IDENTITY = "";
+				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
+				CURRENT_PROJECT_VERSION = 1;
+				DEFINES_MODULE = YES;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				DYLIB_INSTALL_NAME_BASE = "@rpath";
+				GCC_PREFIX_HEADER = "Target Support Files/ShareClient/ShareClient-prefix.pch";
+				INFOPLIST_FILE = "Target Support Files/ShareClient/ShareClient-Info.plist";
+				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+					"@loader_path/Frameworks",
+				);
+				MODULEMAP_FILE = "Target Support Files/ShareClient/ShareClient.modulemap";
+				PRODUCT_MODULE_NAME = ShareClient;
+				PRODUCT_NAME = ShareClient;
+				SDKROOT = iphoneos;
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
+				VERSIONING_SYSTEM = "apple-generic";
+				VERSION_INFO_PREFIX = "";
+			};
+			name = Release;
+		};
 		5C5AE90EAE3122F9FC1AA606EA47ACFE /* Debug */ = {
 		5C5AE90EAE3122F9FC1AA606EA47ACFE /* Debug */ = {
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 017205CE9DD9404E68FC3A813A5BC6A4 /* Charts.debug.xcconfig */;
 			baseConfigurationReference = 017205CE9DD9404E68FC3A813A5BC6A4 /* Charts.debug.xcconfig */;
@@ -1475,43 +1512,6 @@
 			};
 			};
 			name = Debug;
 			name = Debug;
 		};
 		};
-		7445CE2DA3D731E7CC7B9F0E82576D87 /* Release */ = {
-			isa = XCBuildConfiguration;
-			baseConfigurationReference = E085DDC030F8EC270DBA2B97E1CBF58D /* ShareClient.release.xcconfig */;
-			buildSettings = {
-				CLANG_ENABLE_OBJC_WEAK = NO;
-				CODE_SIGN_IDENTITY = "";
-				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
-				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
-				CURRENT_PROJECT_VERSION = 1;
-				DEFINES_MODULE = YES;
-				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 1;
-				DYLIB_INSTALL_NAME_BASE = "@rpath";
-				GCC_PREFIX_HEADER = "Target Support Files/ShareClient/ShareClient-prefix.pch";
-				INFOPLIST_FILE = "Target Support Files/ShareClient/ShareClient-Info.plist";
-				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-				IPHONEOS_DEPLOYMENT_TARGET = 13;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-					"@loader_path/Frameworks",
-				);
-				MODULEMAP_FILE = "Target Support Files/ShareClient/ShareClient.modulemap";
-				PRODUCT_MODULE_NAME = ShareClient;
-				PRODUCT_NAME = ShareClient;
-				SDKROOT = iphoneos;
-				SKIP_INSTALL = YES;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
-				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1,2";
-				VALIDATE_PRODUCT = YES;
-				VERSIONING_SYSTEM = "apple-generic";
-				VERSION_INFO_PREFIX = "";
-			};
-			name = Release;
-		};
 		7DC5F11AFBEAE473E8D3C24A2D11338D /* Release */ = {
 		7DC5F11AFBEAE473E8D3C24A2D11338D /* Release */ = {
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 			buildSettings = {
@@ -1572,10 +1572,11 @@
 			};
 			};
 			name = Release;
 			name = Release;
 		};
 		};
-		872B91677D6C5E98109D15A182CD805F /* Debug */ = {
+		A57D7F46620CEA8E6010E60F37AA1C40 /* Release */ = {
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 27E029128823B9D672A01E4BB4DAD95B /* ShareClient.debug.xcconfig */;
+			baseConfigurationReference = EBE2A8C176CC9C76279BE195BDA90B7F /* Pods-LoopFollow.release.xcconfig */;
 			buildSettings = {
 			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				CLANG_ENABLE_OBJC_WEAK = NO;
 				CLANG_ENABLE_OBJC_WEAK = NO;
 				CODE_SIGN_IDENTITY = "";
 				CODE_SIGN_IDENTITY = "";
 				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
 				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
@@ -1586,33 +1587,34 @@
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
-				GCC_PREFIX_HEADER = "Target Support Files/ShareClient/ShareClient-prefix.pch";
-				INFOPLIST_FILE = "Target Support Files/ShareClient/ShareClient-Info.plist";
+				INFOPLIST_FILE = "Target Support Files/Pods-LoopFollow/Pods-LoopFollow-Info.plist";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-				IPHONEOS_DEPLOYMENT_TARGET = 13;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.4;
 				LD_RUNPATH_SEARCH_PATHS = (
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 					"@loader_path/Frameworks",
 					"@loader_path/Frameworks",
 				);
 				);
-				MODULEMAP_FILE = "Target Support Files/ShareClient/ShareClient.modulemap";
-				PRODUCT_MODULE_NAME = ShareClient;
-				PRODUCT_NAME = ShareClient;
+				MACH_O_TYPE = staticlib;
+				MODULEMAP_FILE = "Target Support Files/Pods-LoopFollow/Pods-LoopFollow.modulemap";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOLFLAGS = "";
+				PODS_ROOT = "$(SRCROOT)";
+				PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
+				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
 				SDKROOT = iphoneos;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				SKIP_INSTALL = YES;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
-				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
 				VERSIONING_SYSTEM = "apple-generic";
 				VERSION_INFO_PREFIX = "";
 				VERSION_INFO_PREFIX = "";
 			};
 			};
-			name = Debug;
+			name = Release;
 		};
 		};
-		A57D7F46620CEA8E6010E60F37AA1C40 /* Release */ = {
+		C6F17C30F319BDC6C3ACEC3D71396607 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = EBE2A8C176CC9C76279BE195BDA90B7F /* Pods-LoopFollow.release.xcconfig */;
+			baseConfigurationReference = 27E029128823B9D672A01E4BB4DAD95B /* ShareClient.debug.xcconfig */;
 			buildSettings = {
 			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				CLANG_ENABLE_OBJC_WEAK = NO;
 				CLANG_ENABLE_OBJC_WEAK = NO;
 				CODE_SIGN_IDENTITY = "";
 				CODE_SIGN_IDENTITY = "";
 				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
 				"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
@@ -1623,29 +1625,27 @@
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
-				INFOPLIST_FILE = "Target Support Files/Pods-LoopFollow/Pods-LoopFollow-Info.plist";
+				GCC_PREFIX_HEADER = "Target Support Files/ShareClient/ShareClient-prefix.pch";
+				INFOPLIST_FILE = "Target Support Files/ShareClient/ShareClient-Info.plist";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-				IPHONEOS_DEPLOYMENT_TARGET = 13.4;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 					"@loader_path/Frameworks",
 					"@loader_path/Frameworks",
 				);
 				);
-				MACH_O_TYPE = staticlib;
-				MODULEMAP_FILE = "Target Support Files/Pods-LoopFollow/Pods-LoopFollow.modulemap";
-				OTHER_LDFLAGS = "";
-				OTHER_LIBTOOLFLAGS = "";
-				PODS_ROOT = "$(SRCROOT)";
-				PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
-				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+				MODULEMAP_FILE = "Target Support Files/ShareClient/ShareClient.modulemap";
+				PRODUCT_MODULE_NAME = ShareClient;
+				PRODUCT_NAME = ShareClient;
 				SDKROOT = iphoneos;
 				SDKROOT = iphoneos;
 				SKIP_INSTALL = YES;
 				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
+				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				TARGETED_DEVICE_FAMILY = "1,2";
-				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
 				VERSIONING_SYSTEM = "apple-generic";
 				VERSION_INFO_PREFIX = "";
 				VERSION_INFO_PREFIX = "";
 			};
 			};
-			name = Release;
+			name = Debug;
 		};
 		};
 		D27C976E5A2F75B799103220B6FECE18 /* Debug */ = {
 		D27C976E5A2F75B799103220B6FECE18 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
@@ -1780,8 +1780,8 @@
 		7531FF23B45C520CA26A36BB717E6A4A /* Build configuration list for PBXNativeTarget "ShareClient" */ = {
 		7531FF23B45C520CA26A36BB717E6A4A /* Build configuration list for PBXNativeTarget "ShareClient" */ = {
 			isa = XCConfigurationList;
 			isa = XCConfigurationList;
 			buildConfigurations = (
 			buildConfigurations = (
-				872B91677D6C5E98109D15A182CD805F /* Debug */,
-				7445CE2DA3D731E7CC7B9F0E82576D87 /* Release */,
+				C6F17C30F319BDC6C3ACEC3D71396607 /* Debug */,
+				5114137E124F7AC49DAB83B911505792 /* Release */,
 			);
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 			defaultConfigurationName = Release;

+ 11 - 16
Pods/ShareClient/ShareClient/ShareClient.swift

@@ -30,18 +30,7 @@ public enum ShareError: Error {
 public enum KnownShareServers: String {
 public enum KnownShareServers: String {
     case US="https://share2.dexcom.com"
     case US="https://share2.dexcom.com"
     case NON_US="https://shareous1.dexcom.com"
     case NON_US="https://shareous1.dexcom.com"
-    /*
-         To enable Loop to use a custom share server:
-            - remove the comment marker on line 44 and change the value of CUSTOM
-            - remove the comment markers on lines 34 and 35 in ShareClientUI/ShareService+UI.swift
 
 
-         Note: The URL in CUSTOM must start with 'https://' (NOT 'http://')
-
-         You can find installation instructions for one such custom share server at
-         https://github.com/dabear/NightscoutShareServer
-    */
-
-    // case CUSTOM="https://yourusernameshareserver.herokuapp.com"
 }
 }
 
 
 // From the Dexcom Share iOS app, via @bewest and @shanselman:
 // From the Dexcom Share iOS app, via @bewest and @shanselman:
@@ -163,12 +152,9 @@ public class ShareClient {
                 return callback(.fetchError, nil)
                 return callback(.fetchError, nil)
             }
             }
 
 
-            // Dexcom Share only returns up to 24 hrs of data today
-            // Requesting more just in case this changes in the future
-            let minutes = max(1440, n * 5)
             components.queryItems = [
             components.queryItems = [
                 URLQueryItem(name: "sessionId", value: self.token),
                 URLQueryItem(name: "sessionId", value: self.token),
-                URLQueryItem(name: "minutes", value: String(minutes)),
+                URLQueryItem(name: "minutes", value: String(1440)),
                 URLQueryItem(name: "maxCount", value: String(n))
                 URLQueryItem(name: "maxCount", value: String(n))
             ]
             ]
 
 
@@ -197,8 +183,17 @@ public class ShareClient {
                     }
                     }
 
 
                     var transformed: Array<ShareGlucose> = []
                     var transformed: Array<ShareGlucose> = []
+                    // Dec 2021, Dexcom Share modified json encoding of Trend from int to string
+                    let trendmap = ["": 0, "DoubleUp":1, "SingleUp":2, "FortyFiveUp":3, "Flat":4, "FortyFiveDown":5, "SingleDown":6, "DoubleDown": 7, "NotComputable":8, "RateOutOfRange":9]
                     for sgv in sgvs {
                     for sgv in sgvs {
-                        if let glucose = sgv["Value"] as? Int, let trend = sgv["Trend"] as? Int, let wt = sgv["WT"] as? String {
+                        if let glucose = sgv["Value"] as? Int, let strend = sgv["Trend"] as? String, let wt = sgv["WT"] as? String {
+                            let itrend = trendmap[strend, default: 0]
+                            transformed.append(ShareGlucose(
+                                glucose: UInt16(glucose),
+                                trend: UInt8(itrend),
+                                timestamp: try self.parseDate(wt)
+                            ))
+                        } else if let glucose = sgv["Value"] as? Int, let trend = sgv["Trend"] as? Int, let wt = sgv["WT"] as? String {
                             transformed.append(ShareGlucose(
                             transformed.append(ShareGlucose(
                                 glucose: UInt16(glucose),
                                 glucose: UInt16(glucose),
                                 trend: UInt8(trend),
                                 trend: UInt8(trend),

+ 1 - 1
Pods/Target Support Files/Eureka/Eureka-Info.plist

@@ -15,7 +15,7 @@
   <key>CFBundlePackageType</key>
   <key>CFBundlePackageType</key>
   <string>FMWK</string>
   <string>FMWK</string>
   <key>CFBundleShortVersionString</key>
   <key>CFBundleShortVersionString</key>
-  <string>5.3.0</string>
+  <string>5.3.4</string>
   <key>CFBundleSignature</key>
   <key>CFBundleSignature</key>
   <string>????</string>
   <string>????</string>
   <key>CFBundleVersion</key>
   <key>CFBundleVersion</key>