From a7f130a1a8b9797cb3342b1eddac560f5f758d57 Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 16:23:06 -0400
Subject: [PATCH 1/7] Swift 5 analyzer
---
SwiftSVG.xcodeproj/project.pbxproj | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/SwiftSVG.xcodeproj/project.pbxproj b/SwiftSVG.xcodeproj/project.pbxproj
index 967be56..ebd24f2 100644
--- a/SwiftSVG.xcodeproj/project.pbxproj
+++ b/SwiftSVG.xcodeproj/project.pbxproj
@@ -572,7 +572,7 @@
};
39B8D88B1B3C3283009DAF60 = {
CreatedOnToolsVersion = 6.3.2;
- LastSwiftMigration = 1000;
+ LastSwiftMigration = 1020;
};
};
};
@@ -581,6 +581,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
+ English,
en,
Base,
);
@@ -836,8 +837,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator appletvsimulator appletvos iphoneos macosx";
- SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.2;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -864,8 +864,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator appletvsimulator appletvos iphoneos macosx";
- SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.2;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
From 82c16a628a2e327d7b89b794d20bc87ea8993103 Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 16:27:44 -0400
Subject: [PATCH 2/7] Compiler now reconizes scope declared in parent extension
---
SwiftSVG.xcodeproj/project.pbxproj | 4 ++-
.../xcshareddata/xcschemes/SwiftSVG.xcscheme | 2 +-
SwiftSVG/SVG Extensions/CALayer+SVG.swift | 4 +--
.../SVG Extensions/CAShapeLayer+SVG.swift | 2 +-
SwiftSVG/SVG Extensions/SVGLayer.swift | 4 +--
.../SVG Extensions/UIBezierPath+SVG.swift | 4 +--
SwiftSVG/SVG Extensions/UIView+SVG.swift | 8 ++---
SwiftSVG/SVG/Elements/SVGGroup.swift | 16 +++++-----
SwiftSVG/SVG/Helpers/UIColor+Extensions.swift | 2 +-
SwiftSVG/SVG/Iterators/PathCommand.swift | 8 ++---
.../project.pbxproj | 31 +++++++++++++++----
11 files changed, 53 insertions(+), 32 deletions(-)
diff --git a/SwiftSVG.xcodeproj/project.pbxproj b/SwiftSVG.xcodeproj/project.pbxproj
index ebd24f2..af89839 100644
--- a/SwiftSVG.xcodeproj/project.pbxproj
+++ b/SwiftSVG.xcodeproj/project.pbxproj
@@ -563,7 +563,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
- LastUpgradeCheck = 1010;
+ LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Strauss LLC";
TargetAttributes = {
176BC98F1EE474D100F7B54C = {
@@ -875,6 +875,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;
@@ -936,6 +937,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;
diff --git a/SwiftSVG.xcodeproj/xcshareddata/xcschemes/SwiftSVG.xcscheme b/SwiftSVG.xcodeproj/xcshareddata/xcschemes/SwiftSVG.xcscheme
index 06ad43d..bada58c 100644
--- a/SwiftSVG.xcodeproj/xcshareddata/xcschemes/SwiftSVG.xcscheme
+++ b/SwiftSVG.xcodeproj/xcshareddata/xcschemes/SwiftSVG.xcscheme
@@ -1,6 +1,6 @@
()) {
+ convenience init(SVGURL: URL, parser: SVGParser? = nil, completion: @escaping (SVGLayer) -> ()) {
do {
let svgData = try Data(contentsOf: SVGURL)
self.init(SVGData: svgData, parser: parser, completion: completion)
@@ -67,7 +67,7 @@ public extension CALayer {
- Parameter completion: A required completion block to execute once the SVG has completed parsing. You must add the passed `SVGLayer` to a sublayer to display it.
*/
@discardableResult
- public convenience init(SVGData: Data, parser: SVGParser? = nil, completion: @escaping (SVGLayer) -> ()) {
+ convenience init(SVGData: Data, parser: SVGParser? = nil, completion: @escaping (SVGLayer) -> ()) {
self.init()
if let cached = SVGCache.default[SVGData.cacheKey] {
diff --git a/SwiftSVG/SVG Extensions/CAShapeLayer+SVG.swift b/SwiftSVG/SVG Extensions/CAShapeLayer+SVG.swift
index 35514ba..2f29d6f 100644
--- a/SwiftSVG/SVG Extensions/CAShapeLayer+SVG.swift
+++ b/SwiftSVG/SVG Extensions/CAShapeLayer+SVG.swift
@@ -42,7 +42,7 @@ public extension CAShapeLayer {
Convenience initalizer that synchronously parses a single path string and returns a `CAShapeLayer`
- Parameter pathString: The path `d` string to parse.
*/
- public convenience init(pathString: String) {
+ convenience init(pathString: String) {
self.init()
let singlePath = SVGPath(singlePathString: pathString)
self.path = singlePath.svgLayer.path
diff --git a/SwiftSVG/SVG Extensions/SVGLayer.swift b/SwiftSVG/SVG Extensions/SVGLayer.swift
index 13ca15d..2a348da 100644
--- a/SwiftSVG/SVG Extensions/SVGLayer.swift
+++ b/SwiftSVG/SVG Extensions/SVGLayer.swift
@@ -49,7 +49,7 @@ public extension SVGLayerType where Self: CALayer {
- TODO: Should eventually support different content modes
*/
@discardableResult
- public func resizeToFit(_ rect: CGRect) -> Self {
+ func resizeToFit(_ rect: CGRect) -> Self {
let boundingBoxAspectRatio = self.boundingBox.width / self.boundingBox.height
let viewAspectRatio = rect.width / rect.height
@@ -86,7 +86,7 @@ public extension SVGLayer {
/**
Returns a copy of the given SVGLayer
*/
- public var svgLayerCopy: SVGLayer? {
+ var svgLayerCopy: SVGLayer? {
let tmp = NSKeyedArchiver.archivedData(withRootObject: self)
let copiedLayer = NSKeyedUnarchiver.unarchiveObject(with: tmp) as? SVGLayer
copiedLayer?.boundingBox = self.boundingBox
diff --git a/SwiftSVG/SVG Extensions/UIBezierPath+SVG.swift b/SwiftSVG/SVG Extensions/UIBezierPath+SVG.swift
index cf421e0..745a37b 100644
--- a/SwiftSVG/SVG Extensions/UIBezierPath+SVG.swift
+++ b/SwiftSVG/SVG Extensions/UIBezierPath+SVG.swift
@@ -44,7 +44,7 @@ public extension UIBezierPath {
Parses a single path string. Parses synchronously.
- Parameter pathString: The path `d` string to parse.
*/
- public convenience init(pathString: String) {
+ convenience init(pathString: String) {
let singlePath = SVGPath(singlePathString: pathString)
guard let cgPath = singlePath.svgLayer.path else {
self.init()
@@ -59,7 +59,7 @@ public extension UIBezierPath {
@available(*, deprecated, message: "This method is deprecated. If you want to parse a single path, instantiate a new instance of SVGPath using the SVGPath(singlePathString:) initializer and pass the path string.")
- public class func pathWithSVGURL(_ SVGURL: URL) -> UIBezierPath? {
+ class func pathWithSVGURL(_ SVGURL: URL) -> UIBezierPath? {
assert(false, "This method is deprecated")
return nil
}
diff --git a/SwiftSVG/SVG Extensions/UIView+SVG.swift b/SwiftSVG/SVG Extensions/UIView+SVG.swift
index 1176b17..d04a2ed 100644
--- a/SwiftSVG/SVG Extensions/UIView+SVG.swift
+++ b/SwiftSVG/SVG Extensions/UIView+SVG.swift
@@ -48,7 +48,7 @@ public extension UIView {
```
- Parameter pathString: The path `d` string to parse.
*/
- public convenience init(pathString: String) {
+ convenience init(pathString: String) {
self.init()
let svgLayer = SVGLayer()
let pathPath = UIBezierPath(pathString: pathString)
@@ -69,7 +69,7 @@ public extension UIView {
- Parameter parser: The optional parser to use to parse the SVG file
- Parameter completion: A required completion block to execute once the SVG has completed parsing. The passed `SVGLayer` will be added to this view's sublayers before executing the completion block
*/
- public convenience init(SVGNamed: String, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
+ convenience init(SVGNamed: String, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
// TODO: This is too many guards to really make any sense. Also approaching on the
// pyramid of death Refactor this at some point to be able to work cross-platform.
@@ -129,7 +129,7 @@ public extension UIView {
- Parameter parser: The optional parser to use to parse the SVG file
- Parameter completion: A required completion block to execute once the SVG has completed parsing. The passed `SVGLayer` will be added to this view's sublayers before executing the completion block
*/
- public convenience init(SVGURL: URL, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
+ convenience init(SVGURL: URL, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
do {
let svgData = try Data(contentsOf: SVGURL)
self.init(SVGData: svgData, parser: parser, completion: completion)
@@ -150,7 +150,7 @@ public extension UIView {
- Parameter parser: The optional parser to use to parse the SVG file
- Parameter completion: A required completion block to execute once the SVG has completed parsing. The passed `SVGLayer` will be added to this view's sublayers before executing the completion block
*/
- public convenience init(SVGData svgData: Data, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
+ convenience init(SVGData svgData: Data, parser: SVGParser? = nil, completion: ((SVGLayer) -> ())? = nil) {
self.init()
CALayer(SVGData: svgData, parser: parser) { [weak self] (svgLayer) in
diff --git a/SwiftSVG/SVG/Elements/SVGGroup.swift b/SwiftSVG/SVG/Elements/SVGGroup.swift
index b62a026..a73b478 100644
--- a/SwiftSVG/SVG/Elements/SVGGroup.swift
+++ b/SwiftSVG/SVG/Elements/SVGGroup.swift
@@ -100,7 +100,7 @@ fileprivate extension SVGGroup {
/**
Function that applies the fill color on all of this group's subelements
*/
- fileprivate func fillGroup(_ fillColor: String, on layer: CAShapeLayer) {
+ func fillGroup(_ fillColor: String, on layer: CAShapeLayer) {
guard let fillColor = UIColor(svgString: fillColor) else {
return
}
@@ -110,7 +110,7 @@ fileprivate extension SVGGroup {
/**
Function that applies the fill rule on all of this group's subelements
*/
- fileprivate func fillRuleGroup(_ fillRule: String, on layer: CAShapeLayer) {
+ func fillRuleGroup(_ fillRule: String, on layer: CAShapeLayer) {
guard fillRule == "evenodd" else {
return
}
@@ -120,7 +120,7 @@ fileprivate extension SVGGroup {
/**
Function that applies the fill opacity on all of this group's subelements
*/
- fileprivate func fillOpacityGroup(_ opacity: String, on layer: CAShapeLayer) {
+ func fillOpacityGroup(_ opacity: String, on layer: CAShapeLayer) {
guard let opacity = Float(opacity) else {
return
}
@@ -134,14 +134,14 @@ fileprivate extension SVGGroup {
/**
Function that applies the stroke line cap on all of this group's subelements
*/
- fileprivate func strokeLineCapGroup(lineCap: String, on layer: CAShapeLayer) {
+ func strokeLineCapGroup(lineCap: String, on layer: CAShapeLayer) {
layer.lineCap = CAShapeLayerLineCap(rawValue: lineCap)
}
/**
Function that applies the stroke color on all of this group's subelements
*/
- fileprivate func strokeColorGroup(strokeColor: String, on layer: CAShapeLayer) {
+ func strokeColorGroup(strokeColor: String, on layer: CAShapeLayer) {
guard let strokeColor = UIColor(svgString: strokeColor) else {
return
}
@@ -151,14 +151,14 @@ fileprivate extension SVGGroup {
/**
Function that applies the stroke line join on all of this group's subelements
*/
- fileprivate func strokeLineJoinGroup(lineJoin: String, on layer: CAShapeLayer) {
+ func strokeLineJoinGroup(lineJoin: String, on layer: CAShapeLayer) {
layer.lineJoin = CAShapeLayerLineJoin(rawValue: lineJoin)
}
/**
Function that applies the miter limit on all of this group's subelements
*/
- fileprivate func strokeMiterLimitGroup(miterLimit: String, on layer: CAShapeLayer) {
+ func strokeMiterLimitGroup(miterLimit: String, on layer: CAShapeLayer) {
guard let miterLimit = CGFloat(miterLimit) else {
return
}
@@ -168,7 +168,7 @@ fileprivate extension SVGGroup {
/**
Function that applies the streoke width on all of this group's subelements
*/
- fileprivate func strokeWidthGroup(strokeWidth: String, on layer: CAShapeLayer) {
+ func strokeWidthGroup(strokeWidth: String, on layer: CAShapeLayer) {
guard let strokeWidth = CGFloat(strokeWidth) else {
return
}
diff --git a/SwiftSVG/SVG/Helpers/UIColor+Extensions.swift b/SwiftSVG/SVG/Helpers/UIColor+Extensions.swift
index 13bc994..ad46a98 100644
--- a/SwiftSVG/SVG/Helpers/UIColor+Extensions.swift
+++ b/SwiftSVG/SVG/Helpers/UIColor+Extensions.swift
@@ -164,7 +164,7 @@ public extension UIColor {
Convenience initializer that creates a new UIColor from a CSS3 named color
- SeeAlso: See here for all the colors: [https://www.w3.org/TR/css3-color/#svg-color](https://www.w3.org/TR/css3-color/#svg-color)
*/
- public convenience init?(named: String) {
+ convenience init?(named: String) {
guard let namedColor = CGColor.named[named] else {
return nil
}
diff --git a/SwiftSVG/SVG/Iterators/PathCommand.swift b/SwiftSVG/SVG/Iterators/PathCommand.swift
index 536fc7b..9e918b5 100644
--- a/SwiftSVG/SVG/Iterators/PathCommand.swift
+++ b/SwiftSVG/SVG/Iterators/PathCommand.swift
@@ -93,7 +93,7 @@ internal extension PathCommand {
/**
Default implementation for any `PathCommand` indicating where there are enough coordinates stored to be able to process the `SVGElement`
*/
- internal var canPushCommand: Bool {
+ var canPushCommand: Bool {
if self.numberOfRequiredParameters == 0 {
return true
}
@@ -109,21 +109,21 @@ internal extension PathCommand {
/**
Function that clears the current number buffer
*/
- internal mutating func clearBuffer() {
+ mutating func clearBuffer() {
self.coordinateBuffer.removeAll()
}
/**
Adds a new coordinate to the buffer
*/
- internal mutating func pushCoordinate(_ coordinate: Double) {
+ mutating func pushCoordinate(_ coordinate: Double) {
self.coordinateBuffer.append(coordinate)
}
/**
Based on the `PathType` of this PathCommand, this function returns the relative or absolute point
*/
- internal func pointForPathType(_ point: CGPoint, relativeTo: CGPoint) -> CGPoint {
+ func pointForPathType(_ point: CGPoint, relativeTo: CGPoint) -> CGPoint {
switch self.pathType {
case .absolute:
return point
diff --git a/SwiftSVGExamples/SwiftSVGExamples.xcodeproj/project.pbxproj b/SwiftSVGExamples/SwiftSVGExamples.xcodeproj/project.pbxproj
index 26534d8..8dbc277 100644
--- a/SwiftSVGExamples/SwiftSVGExamples.xcodeproj/project.pbxproj
+++ b/SwiftSVGExamples/SwiftSVGExamples.xcodeproj/project.pbxproj
@@ -412,7 +412,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
- LastUpgradeCheck = 0810;
+ LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Michael Choe";
TargetAttributes = {
388215751F1309A800C192A3 = {
@@ -421,9 +421,8 @@
};
8AC4DBBC1CB37DB800137DC9 = {
CreatedOnToolsVersion = 7.3;
- DevelopmentTeam = L2JNG48FS5;
LastSwiftMigration = 1000;
- ProvisioningStyle = Automatic;
+ ProvisioningStyle = Manual;
};
8AC4DBD21CB37DC600137DC9 = {
CreatedOnToolsVersion = 7.3;
@@ -433,7 +432,7 @@
};
buildConfigurationList = 8AC4DB9F1CB37D9600137DC9 /* Build configuration list for PBXProject "SwiftSVGExamples" */;
compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
+ developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -637,19 +636,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -685,19 +693,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -728,7 +745,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- DEVELOPMENT_TEAM = L2JNG48FS5;
+ CODE_SIGN_STYLE = Manual;
+ DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftSVGExampleiOS/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.straussmade.SwiftSVGExampleiOS;
@@ -744,7 +762,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- DEVELOPMENT_TEAM = L2JNG48FS5;
+ CODE_SIGN_STYLE = Manual;
+ DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftSVGExampleiOS/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.straussmade.SwiftSVGExampleiOS;
From 9e8fb0860c2a0fe24d8bd29514ffdfcce651e0de Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 21:52:13 -0400
Subject: [PATCH 3/7] Podspec bump
---
SwiftSVG.podspec | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/SwiftSVG.podspec b/SwiftSVG.podspec
index fa3d87c..c771988 100644
--- a/SwiftSVG.podspec
+++ b/SwiftSVG.podspec
@@ -3,16 +3,16 @@
Pod::Spec.new do |s|
s.name = "SwiftSVG"
- s.version = "2.2.0"
+ s.version = "2.3.0"
s.summary = "A simple, performant, single pass SVG parser"
s.description = "A simple, performant, single pass SVG parser. Optimized for extension and developer joy."
s.homepage = "https://github.com/mchoe/SwiftSVG"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Michael Choe" => "michael@straussmade.com" }
s.social_media_url = "http://twitter.com/_mchoe"
- s.osx.deployment_target = "10.10"
+ s.osx.deployment_target = "10.11"
s.ios.deployment_target = '8.0'
s.source = { :git => "https://github.com/mchoe/SwiftSVG.git", :tag => "v#{s.version}" }
s.source_files = "SwiftSVG", "SwiftSVG/**/*.{h,swift}"
- s.swift_version = "4.2"
+ s.swift_version = "5.0"
end
From 21495b341996fa8b9390ed898993ef5a21b47c84 Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 21:56:21 -0400
Subject: [PATCH 4/7] Added version information in readme
---
README.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/README.md b/README.md
index 9ae392d..c79ff62 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,11 @@ Table of Contents
Install
=======
+| Swift version | SwiftSVG version |
+| ------------- | ----------------------------------------------------------- |
+| Swift 5.0 | v2.3.0 |
+| Swift 4.2 | v2.2.1 |
+
Cocoapods:
pod 'SwiftSVG', '~> 2.0'
From 9ef541e582217bec812a5b8bc56b25fc5ac7bd4a Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 22:00:47 -0400
Subject: [PATCH 5/7] Removed .swift-version file
---
.swift-version | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 .swift-version
diff --git a/.swift-version b/.swift-version
deleted file mode 100644
index bf77d54..0000000
--- a/.swift-version
+++ /dev/null
@@ -1 +0,0 @@
-4.2
From 9282ae7e54fda3c64b5c3e1a2e2993253a1c9a87 Mon Sep 17 00:00:00 2001
From: Michael Choe
Date: Sat, 30 Mar 2019 22:02:41 -0400
Subject: [PATCH 6/7] Reran jazzy to update docs
---
docs/badge.svg | 16 +-
docs/css/jazzy.css | 10 +-
.../Resources/Documents/css/jazzy.css | 10 +-
.../Contents/Resources/Documents/index.html | 250 ++---------
.../Resources/Documents/js/jazzy.search.js | 3 +-
.../Contents/Resources/Documents/search.json | 2 +-
.../Resources/Documents/undocumented.json | 14 +
.../Contents/Resources/docSet.dsidx | Bin 61440 -> 12288 bytes
docs/docsets/SwiftSVG.tgz | Bin 266263 -> 245965 bytes
docs/index.html | 250 ++---------
docs/js/jazzy.search.js | 3 +-
docs/search.json | 2 +-
docs/undocumented.json | 395 +-----------------
13 files changed, 108 insertions(+), 847 deletions(-)
diff --git a/docs/badge.svg b/docs/badge.svg
index b5adf50..a5d7e55 100644
--- a/docs/badge.svg
+++ b/docs/badge.svg
@@ -1,15 +1,15 @@
-
+
-
+
-
-
+
+
@@ -18,11 +18,11 @@
documentation
-
- 81%
+
+ 0%
-
- 81%
+
+ 0%
diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css
index c83db5b..24cfe4a 100644
--- a/docs/css/jazzy.css
+++ b/docs/css/jazzy.css
@@ -63,6 +63,10 @@ a {
a:hover, a:focus {
outline: 0;
text-decoration: underline; }
+ a.discouraged {
+ text-decoration: line-through; }
+ a.discouraged:hover, a.discouraged:focus {
+ text-decoration: underline line-through; }
table {
background: #fff;
@@ -225,7 +229,7 @@ pre code {
.item a[name]:before {
content: "";
display: block; }
- .item .token {
+ .item .token, .item .direct-link {
padding-left: 3px;
margin-left: 0px;
font-size: 1rem; }
@@ -287,9 +291,9 @@ pre code {
.language .aside-title {
color: #4183c4; }
-.aside-warning {
+.aside-warning, .aside-deprecated, .aside-unavailable {
border-left: 5px solid #ff6666; }
- .aside-warning .aside-title {
+ .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
color: #ff0000; }
.graybox {
diff --git a/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/css/jazzy.css
index c83db5b..24cfe4a 100644
--- a/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/css/jazzy.css
+++ b/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/css/jazzy.css
@@ -63,6 +63,10 @@ a {
a:hover, a:focus {
outline: 0;
text-decoration: underline; }
+ a.discouraged {
+ text-decoration: line-through; }
+ a.discouraged:hover, a.discouraged:focus {
+ text-decoration: underline line-through; }
table {
background: #fff;
@@ -225,7 +229,7 @@ pre code {
.item a[name]:before {
content: "";
display: block; }
- .item .token {
+ .item .token, .item .direct-link {
padding-left: 3px;
margin-left: 0px;
font-size: 1rem; }
@@ -287,9 +291,9 @@ pre code {
.language .aside-title {
color: #4183c4; }
-.aside-warning {
+.aside-warning, .aside-deprecated, .aside-unavailable {
border-left: 5px solid #ff6666; }
- .aside-warning .aside-title {
+ .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
color: #ff0000; }
.graybox {
diff --git a/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/index.html b/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/index.html
index 6513d35..70f6d00 100644
--- a/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/index.html
+++ b/docs/docsets/SwiftSVG.docset/Contents/Resources/Documents/index.html
@@ -22,7 +22,7 @@
- (81% documented)
+ (0% documented)
@@ -280,21 +78,37 @@ Who Should Use SwiftSVG
Table of Contents
Install
+
+
+Swift version
+SwiftSVG version
+
+
+
+Swift 5.0
+v2.3.0
+
+
+Swift 4.2
+v2.2.1
+
+
+
Cocoapods:
pod 'SwiftSVG', '~> 2.0'
@@ -333,7 +147,7 @@ Output:
svgLayer . fillColor = UIColor ( red : 0.52 , green : 0.16 , blue : 0.32 , alpha : 1.00 ) . cgColor
svgLayer . resizeToFit ( self . view . bounds )
}
-self . view . layer . addSublayer ( hammock )
+self . view . addSubview ( hammock )
Output:
@@ -345,9 +159,9 @@ Output:
convenience init ( SVGData : Data , parser : SVGParser ? = nil , completion : (( SVGLayer ) -> ())? = nil )
-All of these initializers will parse a file located in the main bundle, a bundle of your own choosing, or on the web. It will parse the file asynchronously and optionally takes a completion block, passing a SVGLayer
after parsing has been completed. Whether you pass a completion block or not, SwiftSVG will add it to the view’s sublayers. If you want to change one of the layer’s attributes, such as the fill color or resize it to fit a view, you can do that in the completion block
+All of these initializers will parse a file located in the main bundle, a bundle of your own choosing, or on the web. It will parse the file asynchronously and optionally takes a completion block, passing a SVGLayer
after parsing has been completed. Whether you pass a completion block or not, SwiftSVG will add it to the view’s sublayers. If you want to change one of the layer’s attributes, such as the fill color or resize it to fit a view, you can do that in the completion block
-You can optionally pass an SVGParser
object if you want to reuse the same parser for various SVG files or want to roll your own using a third-party XML parser. By default, SwiftSVG uses a subclass of Foundation’s XMLParser
using all the supported elements and attributes called NSXMLSVGParser
. You can also optionally setup your own NSXMLSVGParser
passing a SVGParserSupportedElements
struct that will parse only the elements and attributes of your choosing.
+You can optionally pass an SVGParser
object if you want to reuse the same parser for various SVG files or want to roll your own using a third-party XML parser. By default, SwiftSVG uses a subclass of Foundation’s XMLParser
using all the supported elements and attributes called NSXMLSVGParser
. You can also optionally setup your own NSXMLSVGParser
passing a SVGParserSupportedElements
struct that will parse only the elements and attributes of your choosing.
There is also a convenience initializer to parse a single path string, which parses synchronously:
// Declaration
@@ -383,12 +197,12 @@ Output:
SVGLayer
-The layer that is passed in the UIView
and CALayer
completion blocks is an instance of SVGLayer
which is a subclass of CAShapeLayer
. Currently, SVGLayer
adds the following capabilities:
+The layer that is passed in the UIView
and CALayer
completion blocks is an instance of SVGLayer
which is a subclass of CAShapeLayer
. Currently, SVGLayer
adds the following capabilities:
A boundingBox
property that is the minimum CGRect
that encloses all subpaths. Good for scaling the layer to fit a view.
Overrides on some properties like the fill color, stroke color, and stroke width that applies that value on all sublayers.
-An ability to create a copy of the SVGLayer
, which is useful for caching.
+An ability to create a copy of the SVGLayer
, which is useful for caching.
Other Interfaces
CAShapeLayer & UIBezierPath Single Paths
@@ -438,7 +252,7 @@ License