diff --git a/.swift-version b/.swift-version index a3ec5a4..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.2 +4.0 diff --git a/Cartfile b/Cartfile index 050c3a5..78f0101 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "danielgindi/Charts" == 3.0.3 +github "danielgindi/Charts" == 3.0.4 github "realm/realm-cocoa" ~> 2.10 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index bdf5975..2aeac6b 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "danielgindi/Charts" "v3.0.3" -github "realm/realm-cocoa" "v2.10.1" +github "danielgindi/Charts" "v3.0.4" +github "realm/realm-cocoa" "v2.10.2" diff --git a/ChartsRealm.podspec b/ChartsRealm.podspec index a3af1ee..be94b14 100644 --- a/ChartsRealm.podspec +++ b/ChartsRealm.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ChartsRealm" - s.version = "3.0.3" + s.version = "3.0.4" s.summary = "A Realm.io module for Charts" s.homepage = "https://github.com/danielgindi/ChartsRealm" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" } @@ -10,6 +10,6 @@ Pod::Spec.new do |s| s.osx.deployment_target = "10.11" s.source = { :git => "https://github.com/danielgindi/ChartsRealm.git", :tag => "v#{s.version}" } s.source_files = "ChartsRealm/Classes/**/*.swift" - s.dependency "Charts", "3.0.3" + s.dependency "Charts", "3.0.4" s.dependency "RealmSwift", "~> 2.10" end diff --git a/ChartsRealm.xcodeproj/project.pbxproj b/ChartsRealm.xcodeproj/project.pbxproj index 7c8d331..f5416e6 100644 --- a/ChartsRealm.xcodeproj/project.pbxproj +++ b/ChartsRealm.xcodeproj/project.pbxproj @@ -155,6 +155,7 @@ TargetAttributes = { 06B120D41D811E6200D14B02 = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0900; }; }; }; @@ -360,6 +361,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsRealm; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -380,6 +382,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsRealm; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/ChartsRealm/Classes/Data/RealmBarDataSet.swift b/ChartsRealm/Classes/Data/RealmBarDataSet.swift index 4c2b2e8..2ef433b 100644 --- a/ChartsRealm/Classes/Data/RealmBarDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmBarDataSet.swift @@ -33,7 +33,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat super.init(results: results, xValueField: xValueField, yValueField: yValueField, label: label) } - public init(results: RLMResults?, xValueField: String?, yValueField: String, stackValueField: String, label: String?) + @objc public init(results: RLMResults?, xValueField: String?, yValueField: String, stackValueField: String, label: String?) { _stackValueField = stackValueField @@ -52,7 +52,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(results: converted, xValueField: xValueField, yValueField: yValueField, stackValueField: stackValueField, label: label) } - public convenience init(results: RLMResults?, xValueField: String?, yValueField: String, stackValueField: String) + @objc public convenience init(results: RLMResults?, xValueField: String?, yValueField: String, stackValueField: String) { self.init(results: results, xValueField: xValueField, yValueField: yValueField, stackValueField: stackValueField, label: "DataSet") } @@ -69,7 +69,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(results: converted, xValueField: xValueField, yValueField: yValueField, stackValueField: stackValueField, label: "DataSet") } - public convenience init(results: RLMResults?, yValueField: String, stackValueField: String, label: String) + @objc public convenience init(results: RLMResults?, yValueField: String, stackValueField: String, label: String) { self.init(results: results, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField, label: label) } @@ -86,7 +86,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(results: converted, yValueField: yValueField, stackValueField: stackValueField, label: label) } - public convenience init(results: RLMResults?, yValueField: String, stackValueField: String) + @objc public convenience init(results: RLMResults?, yValueField: String, stackValueField: String) { self.init(results: results, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField) } @@ -108,7 +108,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat super.init(realm: realm, modelName: modelName, resultsWhere: resultsWhere, xValueField: xValueField, yValueField: yValueField, label: label) } - public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, stackValueField: String, label: String?) + @objc public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, stackValueField: String, label: String?) { _stackValueField = stackValueField @@ -127,7 +127,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(realm: converted, modelName: modelName, resultsWhere: resultsWhere, xValueField: xValueField, yValueField: yValueField, label: label) } - public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, stackValueField: String) + @objc public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, stackValueField: String) { self.init(realm: realm, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField) } @@ -144,7 +144,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(realm: converted, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField) } - public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, stackValueField: String, label: String?) + @objc public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, stackValueField: String, label: String?) { self.init(realm: realm, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField, label: label) } @@ -161,7 +161,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat self.init(realm: converted, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField, label: label) } - public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, stackValueField: String) + @objc public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, stackValueField: String) { self.init(realm: realm, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, stackValueField: stackValueField, label: nil) } @@ -186,7 +186,7 @@ open class RealmBarDataSet: RealmBarLineScatterCandleBubbleDataSet, IBarChartDat // MARK: - Data functions and accessors - internal var _stackValueField: String? + @objc internal var _stackValueField: String? /// the maximum number of bars that are stacked upon each other, this value /// is calculated from the Entries that are added to the DataSet diff --git a/ChartsRealm/Classes/Data/RealmBaseDataSet.swift b/ChartsRealm/Classes/Data/RealmBaseDataSet.swift index e519048..c4118f8 100644 --- a/ChartsRealm/Classes/Data/RealmBaseDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmBaseDataSet.swift @@ -17,7 +17,7 @@ import Realm.Dynamic open class RealmBaseDataSet: ChartBaseDataSet { - open func initialize() + @objc open func initialize() { fatalError("RealmBaseDataSet is an abstract class, you must inherit from it. Also please do not call super.initialize().") } @@ -44,7 +44,7 @@ open class RealmBaseDataSet: ChartBaseDataSet initialize() } - public init(results: RLMResults?, xValueField: String?, yValueField: String, label: String?) + @objc public init(results: RLMResults?, xValueField: String?, yValueField: String, label: String?) { super.init() @@ -79,7 +79,7 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(results: converted, xValueField: xValueField, yValueField: yValueField, label: label) } - public convenience init(results: RLMResults?, yValueField: String, label: String?) + @objc public convenience init(results: RLMResults?, yValueField: String, label: String?) { self.init(results: results, xValueField: nil, yValueField: yValueField, label: label) } @@ -96,7 +96,7 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(results: converted, yValueField: yValueField, label: label) } - public convenience init(results: RLMResults?, xValueField: String?, yValueField: String) + @objc public convenience init(results: RLMResults?, xValueField: String?, yValueField: String) { self.init(results: results, xValueField: xValueField, yValueField: yValueField, label: "DataSet") } @@ -113,7 +113,7 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(results: converted, xValueField: xValueField, yValueField: yValueField) } - public convenience init(results: RLMResults?, yValueField: String) + @objc public convenience init(results: RLMResults?, yValueField: String) { self.init(results: results, yValueField: yValueField) } @@ -130,7 +130,7 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(results: converted, yValueField: yValueField) } - public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, label: String?) + @objc public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String?, yValueField: String, label: String?) { super.init() @@ -162,7 +162,7 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(realm: converted, modelName: modelName, resultsWhere: resultsWhere, xValueField: xValueField, yValueField: yValueField, label: label) } - public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, label: String?) + @objc public convenience init(realm: RLMRealm?, modelName: String, resultsWhere: String, yValueField: String, label: String?) { self.init(realm: realm, modelName: modelName, resultsWhere: resultsWhere, xValueField: nil, yValueField: yValueField, label: label) } @@ -179,12 +179,12 @@ open class RealmBaseDataSet: ChartBaseDataSet self.init(realm: converted, modelName: modelName, resultsWhere: resultsWhere, yValueField: yValueField, label: label) } - open func loadResults(realm: RLMRealm, modelName: String) + @objc open func loadResults(realm: RLMRealm, modelName: String) { loadResults(realm: realm, modelName: modelName, predicate: nil) } - open func loadResults(realm: RLMRealm, modelName: String, predicate: NSPredicate?) + @objc open func loadResults(realm: RLMRealm, modelName: String, predicate: NSPredicate?) { if predicate == nil { @@ -217,19 +217,19 @@ open class RealmBaseDataSet: ChartBaseDataSet // MARK: - Data functions and accessors - internal var _results: RLMResults? - internal var _yValueField: String? - internal var _xValueField: String? - internal var _cache = [ChartDataEntry]() + @objc internal var _results: RLMResults? + @objc internal var _yValueField: String? + @objc internal var _xValueField: String? + @objc internal var _cache = [ChartDataEntry]() - internal var _yMax: Double = -Double.greatestFiniteMagnitude - internal var _yMin: Double = Double.greatestFiniteMagnitude + @objc internal var _yMax: Double = -Double.greatestFiniteMagnitude + @objc internal var _yMin: Double = Double.greatestFiniteMagnitude - internal var _xMax: Double = -Double.greatestFiniteMagnitude - internal var _xMin: Double = Double.greatestFiniteMagnitude + @objc internal var _xMax: Double = -Double.greatestFiniteMagnitude + @objc internal var _xMin: Double = Double.greatestFiniteMagnitude /// Makes sure that the cache is populated for the specified range - internal func buildCache() + @objc internal func buildCache() { guard let results = _results else { return } @@ -246,7 +246,7 @@ open class RealmBaseDataSet: ChartBaseDataSet } } - internal func buildEntryFromResultObject(_ object: RLMObject, x: Double) -> ChartDataEntry + @objc internal func buildEntryFromResultObject(_ object: RLMObject, x: Double) -> ChartDataEntry { let entry = ChartDataEntry(x: _xValueField == nil ? x : object[_xValueField!] as! Double, y: object[_yValueField!] as! Double) @@ -254,7 +254,7 @@ open class RealmBaseDataSet: ChartBaseDataSet } /// Makes sure that the cache is populated for the specified range - internal func clearCache() + @objc internal func clearCache() { _cache.removeAll() } @@ -287,7 +287,7 @@ open class RealmBaseDataSet: ChartBaseDataSet /// Updates the min and max x and y value of this DataSet based on the given Entry. /// /// - parameter e: - internal func calcMinMax(entry e: ChartDataEntry) + @objc internal func calcMinMax(entry e: ChartDataEntry) { if e.y < _yMin { @@ -606,7 +606,7 @@ open class RealmBaseDataSet: ChartBaseDataSet } /// - returns: The fieldname that represents the "y-values" in the realm-data. - open var yValueField: String? + @objc open var yValueField: String? { get { @@ -615,7 +615,7 @@ open class RealmBaseDataSet: ChartBaseDataSet } /// - returns: The fieldname that represents the "x-values" in the realm-data. - open var xValueField: String? + @objc open var xValueField: String? { get { diff --git a/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift b/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift index 9e12448..06b23ae 100644 --- a/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift @@ -27,7 +27,7 @@ open class RealmBubbleDataSet: RealmBarLineScatterCandleBubbleDataSet, IBubbleCh super.init() } - public init(results: RLMResults?, xValueField: String, yValueField: String, sizeField: String, label: String?) + @objc public init(results: RLMResults?, xValueField: String, yValueField: String, sizeField: String, label: String?) { _sizeField = sizeField @@ -46,7 +46,7 @@ open class RealmBubbleDataSet: RealmBarLineScatterCandleBubbleDataSet, IBubbleCh self.init(results: converted, xValueField: xValueField, yValueField: yValueField, sizeField: sizeField, label: label) } - public convenience init(results: RLMResults?, xValueField: String, yValueField: String, sizeField: String) + @objc public convenience init(results: RLMResults?, xValueField: String, yValueField: String, sizeField: String) { self.init(results: results, xValueField: xValueField, yValueField: yValueField, sizeField: sizeField, label: "DataSet") } @@ -63,7 +63,7 @@ open class RealmBubbleDataSet: RealmBarLineScatterCandleBubbleDataSet, IBubbleCh self.init(results: converted, xValueField: xValueField, yValueField: yValueField, sizeField: sizeField) } - public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String, yValueField: String, sizeField: String, label: String?) + @objc public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String, yValueField: String, sizeField: String, label: String?) { _sizeField = sizeField @@ -84,12 +84,12 @@ open class RealmBubbleDataSet: RealmBarLineScatterCandleBubbleDataSet, IBubbleCh // MARK: - Data functions and accessors - internal var _sizeField: String? + @objc internal var _sizeField: String? - internal var _maxSize = CGFloat(0.0) + @objc internal var _maxSize = CGFloat(0.0) open var maxSize: CGFloat { return _maxSize } - open var normalizeSizeEnabled: Bool = true + @objc open var normalizeSizeEnabled: Bool = true open var isNormalizeSizeEnabled: Bool { return normalizeSizeEnabled } internal override func buildEntryFromResultObject(_ object: RLMObject, x: Double) -> ChartDataEntry diff --git a/ChartsRealm/Classes/Data/RealmCandleDataSet.swift b/ChartsRealm/Classes/Data/RealmCandleDataSet.swift index 43a2302..a2577e0 100644 --- a/ChartsRealm/Classes/Data/RealmCandleDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmCandleDataSet.swift @@ -28,7 +28,7 @@ open class RealmCandleDataSet: RealmLineScatterCandleRadarDataSet, ICandleChartD super.init() } - public init(results: RLMResults?, xValueField: String, highField: String, lowField: String, openField: String, closeField: String, label: String?) + @objc public init(results: RLMResults?, xValueField: String, highField: String, lowField: String, openField: String, closeField: String, label: String?) { _highField = highField _lowField = lowField @@ -50,7 +50,7 @@ open class RealmCandleDataSet: RealmLineScatterCandleRadarDataSet, ICandleChartD self.init(results: converted, xValueField: xValueField, highField: highField, lowField: lowField, openField: openField, closeField: closeField, label: label) } - public convenience init(results: RLMResults?, xValueField: String, highField: String, lowField: String, openField: String, closeField: String) + @objc public convenience init(results: RLMResults?, xValueField: String, highField: String, lowField: String, openField: String, closeField: String) { self.init(results: results, xValueField: xValueField, highField: highField, lowField: lowField, openField: openField, closeField: closeField, label: "DataSet") } @@ -67,7 +67,7 @@ open class RealmCandleDataSet: RealmLineScatterCandleRadarDataSet, ICandleChartD self.init(results: converted, xValueField: xValueField, highField: highField, lowField: lowField, openField: openField, closeField: closeField) } - public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String, highField: String, lowField: String, openField: String, closeField: String, label: String?) + @objc public init(realm: RLMRealm?, modelName: String, resultsWhere: String, xValueField: String, highField: String, lowField: String, openField: String, closeField: String, label: String?) { _highField = highField _lowField = lowField @@ -91,10 +91,10 @@ open class RealmCandleDataSet: RealmLineScatterCandleRadarDataSet, ICandleChartD // MARK: - Data functions and accessors - internal var _highField: String? - internal var _lowField: String? - internal var _openField: String? - internal var _closeField: String? + @objc internal var _highField: String? + @objc internal var _lowField: String? + @objc internal var _openField: String? + @objc internal var _closeField: String? internal override func buildEntryFromResultObject(_ object: RLMObject, x: Double) -> ChartDataEntry { diff --git a/ChartsRealm/Classes/Data/RealmPieDataSet.swift b/ChartsRealm/Classes/Data/RealmPieDataSet.swift index 751d56d..8b33c36 100644 --- a/ChartsRealm/Classes/Data/RealmPieDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmPieDataSet.swift @@ -29,7 +29,7 @@ open class RealmPieDataSet: RealmBaseDataSet, IPieChartDataSet super.init() } - public init(results: RLMResults?, yValueField: String, labelField: String?) + @objc public init(results: RLMResults?, yValueField: String, labelField: String?) { _labelField = labelField @@ -50,7 +50,7 @@ open class RealmPieDataSet: RealmBaseDataSet, IPieChartDataSet // MARK: - Data functions and accessors - internal var _labelField: String? + @objc internal var _labelField: String? internal override func buildEntryFromResultObject(_ object: RLMObject, x: Double) -> ChartDataEntry { diff --git a/ChartsRealm/Classes/Data/RealmScatterDataSet.swift b/ChartsRealm/Classes/Data/RealmScatterDataSet.swift index e5c5d69..c71ee75 100644 --- a/ChartsRealm/Classes/Data/RealmScatterDataSet.swift +++ b/ChartsRealm/Classes/Data/RealmScatterDataSet.swift @@ -31,7 +31,7 @@ open class RealmScatterDataSet: RealmLineScatterCandleRadarDataSet, IScatterChar /// Sets the ScatterShape this DataSet should be drawn with. /// This will search for an available IShapeRenderer and set this renderer for the DataSet - open func setScatterShape(_ shape: ScatterChartDataSet.Shape) + @objc open func setScatterShape(_ shape: ScatterChartDataSet.Shape) { self.shapeRenderer = ScatterChartDataSet.renderer(forShape: shape) } diff --git a/ChartsRealm/Supporting Files/Info.plist b/ChartsRealm/Supporting Files/Info.plist index 4c2f2e9..a32f246 100644 --- a/ChartsRealm/Supporting Files/Info.plist +++ b/ChartsRealm/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.3 + 3.0.4 CFBundleSignature ???? CFBundleVersion diff --git a/README.md b/README.md index efa31b2..c3a8301 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Version 3.0.3** +**Version 3.0.4** ![alt tag](https://raw.github.com/danielgindi/Charts/master/Assets/feature_graphic.png) ![Supported Platforms](https://img.shields.io/cocoapods/p/ChartsRealm.svg) [![Releases](https://img.shields.io/github/release/danielgindi/ChartsRealm.svg)](https://github.com/danielgindi/ChartsRealm/releases) [![Latest pod release](https://img.shields.io/cocoapods/v/ChartsRealm.svg)](http://cocoapods.org/pods/chartsrealm) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/danielgindi/ChartsRealm.svg?branch=master)](https://travis-ci.org/danielgindi/ChartsRealm) [![codecov](https://codecov.io/gh/danielgindi/ChartsRealm/branch/master/graph/badge.svg)](https://codecov.io/gh/danielgindi/ChartsRealm) @@ -68,7 +68,7 @@ Add both `pod 'Charts'` and `pod 'ChartsRealm'` to your Podfile. Charts now include Carthage prebuilt binaries. ```carthage -github "danielgindi/ChartsRealm" ~> 3.0.3 +github "danielgindi/ChartsRealm" ~> 3.0.4 ``` In order to build the binaries for a new release, use `carthage build --no-skip-current && carthage archive ChartsRealm`.