From d6cae68a5616127beaaad5c78f5669ef913d84e3 Mon Sep 17 00:00:00 2001 From: JagCesar Date: Fri, 29 Mar 2019 23:07:20 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Swift=205!=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/Plots/Plot.swift | 2 +- Classes/Reference/LabelPool.swift | 2 +- GraphView/GraphView.xcodeproj/project.pbxproj | 7 ++++--- GraphView/GraphViewCode/ViewController.swift | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Classes/Plots/Plot.swift b/Classes/Plots/Plot.swift index 580bbe8..7b34420 100644 --- a/Classes/Plots/Plot.swift +++ b/Classes/Plots/Plot.swift @@ -103,7 +103,7 @@ open class Plot { } private func dequeue(animation: GraphPointAnimation) { - if let index = currentAnimations.index(of: animation) { + if let index = currentAnimations.firstIndex(of: animation) { currentAnimations.remove(at: index) } diff --git a/Classes/Reference/LabelPool.swift b/Classes/Reference/LabelPool.swift index 9dde79c..de07ac9 100644 --- a/Classes/Reference/LabelPool.swift +++ b/Classes/Reference/LabelPool.swift @@ -29,7 +29,7 @@ internal class LabelPool { else { label = UILabel() labels.append(label) - let newLabelIndex = labels.index(of: label)! + let newLabelIndex = labels.firstIndex(of: label)! relations[pointIndex] = newLabelIndex } diff --git a/GraphView/GraphView.xcodeproj/project.pbxproj b/GraphView/GraphView.xcodeproj/project.pbxproj index e2372b3..caadaaf 100644 --- a/GraphView/GraphView.xcodeproj/project.pbxproj +++ b/GraphView/GraphView.xcodeproj/project.pbxproj @@ -287,7 +287,7 @@ TargetAttributes = { 2918399D1C72E6A400753A45 = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; }; }; @@ -296,6 +296,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -512,7 +513,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ios.GraphViewCode; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -529,7 +530,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ios.GraphViewCode; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/GraphView/GraphViewCode/ViewController.swift b/GraphView/GraphViewCode/ViewController.swift index 264bd31..830e426 100644 --- a/GraphView/GraphViewCode/ViewController.swift +++ b/GraphView/GraphViewCode/ViewController.swift @@ -43,10 +43,10 @@ class ViewController: UIViewController { self.graphView.translatesAutoresizingMaskIntoConstraints = false graphConstraints.removeAll() - let topConstraint = NSLayoutConstraint(item: self.graphView, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: 0) - let rightConstraint = NSLayoutConstraint(item: self.graphView, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 0) - let bottomConstraint = NSLayoutConstraint(item: self.graphView, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0) - let leftConstraint = NSLayoutConstraint(item: self.graphView, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 0) + let topConstraint = NSLayoutConstraint(item: self.graphView!, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: 0) + let rightConstraint = NSLayoutConstraint(item: self.graphView!, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 0) + let bottomConstraint = NSLayoutConstraint(item: self.graphView!, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0) + let leftConstraint = NSLayoutConstraint(item: self.graphView!, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 0) //let heightConstraint = NSLayoutConstraint(item: self.graphView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Height, multiplier: 1, constant: 0) From 5a615d9a43f3a688c6f3724df3ed7efc85c983bd Mon Sep 17 00:00:00 2001 From: JagCesar Date: Tue, 19 Nov 2019 20:02:49 +0100 Subject: [PATCH 2/3] Remove warnings --- GraphView/GraphView.xcodeproj/project.pbxproj | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/GraphView/GraphView.xcodeproj/project.pbxproj b/GraphView/GraphView.xcodeproj/project.pbxproj index caadaaf..97ad013 100644 --- a/GraphView/GraphView.xcodeproj/project.pbxproj +++ b/GraphView/GraphView.xcodeproj/project.pbxproj @@ -283,20 +283,22 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1120; TargetAttributes = { 2918399D1C72E6A400753A45 = { CreatedOnToolsVersion = 7.2.1; LastSwiftMigration = 1020; }; + E10847832129DC60009A9586 = { + LastSwiftMigration = 1120; + }; }; }; buildConfigurationList = 291839991C72E6A400753A45 /* Build configuration list for PBXProject "GraphView" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); @@ -402,6 +404,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -456,6 +459,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -547,7 +551,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ios.GraphViewIB; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -564,7 +568,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ios.GraphViewIB; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; From ba579e2e01eb4fffe6f1f92f2d9ae090409d5bb2 Mon Sep 17 00:00:00 2001 From: JagCesar Date: Thu, 26 Mar 2020 23:39:06 +0100 Subject: [PATCH 3/3] Fix warnings --- .../ScrollableGraphView.xcodeproj/project.pbxproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/carthage/ScrollableGraphView/ScrollableGraphView.xcodeproj/project.pbxproj b/carthage/ScrollableGraphView/ScrollableGraphView.xcodeproj/project.pbxproj index b8ef492..35edb91 100644 --- a/carthage/ScrollableGraphView/ScrollableGraphView.xcodeproj/project.pbxproj +++ b/carthage/ScrollableGraphView/ScrollableGraphView.xcodeproj/project.pbxproj @@ -198,16 +198,18 @@ TargetAttributes = { 298BFD251F121BA10062F5C8 = { CreatedOnToolsVersion = 8.3.3; + LastSwiftMigration = 1140; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 298BFD201F121BA10062F5C8 /* Build configuration list for PBXProject "ScrollableGraphView" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 298BFD1C1F121BA10062F5C8; productRefGroup = 298BFD271F121BA10062F5C8 /* Products */; @@ -389,7 +391,7 @@ PRODUCT_BUNDLE_IDENTIFIER = SGV.ScrollableGraphView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -407,7 +409,7 @@ PRODUCT_BUNDLE_IDENTIFIER = SGV.ScrollableGraphView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; };