From fbd92a0fd73d12dce2ccebd8113f58d5cf412bf1 Mon Sep 17 00:00:00 2001 From: cp Date: Tue, 31 Oct 2023 09:27:54 -0400 Subject: [PATCH] v2.2.0 (#62) --- .travis.yml | 4 ++-- CHANGELOG.md | 6 ++++++ Demo/Podfile.lock | 2 +- Demo/Pods/Local Podspecs/TouchDraw.podspec.json | 4 ++-- Demo/Pods/Manifest.lock | 2 +- Demo/Pods/Target Support Files/TouchDraw/Info.plist | 2 +- Demo/TouchDrawDemo/ViewController.swift | 8 ++++---- Package.swift | 12 ++++++------ README.md | 2 +- Sources/TouchDrawView.swift | 6 +++--- TouchDraw.podspec | 2 +- TouchDraw.xcodeproj/project.pbxproj | 8 ++++---- TouchDraw/Info.plist | 2 +- 13 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc87987..5cd35f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: objective-c # Xcode version -osx_image: xcode9.2 +osx_image: xcode14.2 # Specify the opening file for the project xcode_workspace: TouchDraw.xcworkspace @@ -18,4 +18,4 @@ install: script: - swiftlint - - set -o pipefail && xcodebuild -workspace $TRAVIS_XCODE_WORKSPACE -scheme $TRAVIS_XCODE_SCHEME -sdk $TRAVIS_XCODE_SDK -destination 'OS=10.1,name=iPhone 6' build test | xcpretty + - set -o pipefail && xcodebuild -workspace $TRAVIS_XCODE_WORKSPACE -scheme $TRAVIS_XCODE_SCHEME -sdk $TRAVIS_XCODE_SDK -destination 'OS=16.2,name=iPhone 14' build test | xcpretty diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b6bdf6..aa2d241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.2.0 + +- Update for Xcode 15 (thanks to @ricsantos!) +- Fix assertion due to zero size (thanks to @ricsantos!) +- Fix [CI](https://app.travis-ci.com/github/dehli/TouchDraw) + # 2.1.3 - Update Package.swift diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 59f88b4..9e589c9 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - TouchDraw (2.1.3) + - TouchDraw (2.2.0) DEPENDENCIES: - TouchDraw (from `../`) diff --git a/Demo/Pods/Local Podspecs/TouchDraw.podspec.json b/Demo/Pods/Local Podspecs/TouchDraw.podspec.json index fb656b3..550502a 100644 --- a/Demo/Pods/Local Podspecs/TouchDraw.podspec.json +++ b/Demo/Pods/Local Podspecs/TouchDraw.podspec.json @@ -1,6 +1,6 @@ { "name": "TouchDraw", - "version": "2.1.3", + "version": "2.2.0", "summary": "TouchDraw is a UIView you can draw on.", "description": "TouchDraw is a subclass of UIView that allows you to draw using touch. It exposes the following functions:\n- `exportDrawing() -> UIImage`\n- `clearDrawing()`\n- `undo()`\n- `redo()`\n- `setColor(color: UIColor?)`\n- `setWidth(width: CGFloat)`\n- `importStack(stack: [Stroke])`\n- `exportStack() -> [Stroke]`", "homepage": "https://github.com/dehli/TouchDraw", @@ -17,7 +17,7 @@ }, "source": { "git": "https://github.com/dehli/TouchDraw.git", - "tag": "2.1.3" + "tag": "2.2.0" }, "source_files": "Sources/**/*.{swift}" } diff --git a/Demo/Pods/Manifest.lock b/Demo/Pods/Manifest.lock index 59f88b4..9e589c9 100644 --- a/Demo/Pods/Manifest.lock +++ b/Demo/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - TouchDraw (2.1.3) + - TouchDraw (2.2.0) DEPENDENCIES: - TouchDraw (from `../`) diff --git a/Demo/Pods/Target Support Files/TouchDraw/Info.plist b/Demo/Pods/Target Support Files/TouchDraw/Info.plist index d6204c0..c054f9c 100644 --- a/Demo/Pods/Target Support Files/TouchDraw/Info.plist +++ b/Demo/Pods/Target Support Files/TouchDraw/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.3 + 2.2.0 CFBundleSignature ???? CFBundleVersion diff --git a/Demo/TouchDrawDemo/ViewController.swift b/Demo/TouchDrawDemo/ViewController.swift index 532251a..4b230ef 100644 --- a/Demo/TouchDrawDemo/ViewController.swift +++ b/Demo/TouchDrawDemo/ViewController.swift @@ -46,11 +46,11 @@ class ViewController: UIViewController, TouchDrawViewDelegate { } @IBAction func randomColor(_ sender: AnyObject) { - let r = CGFloat(arc4random() % 255) / 255 - let g = CGFloat(arc4random() % 255) / 255 - let b = CGFloat(arc4random() % 255) / 255 + let red = CGFloat(arc4random() % 255) / 255 + let green = CGFloat(arc4random() % 255) / 255 + let blue = CGFloat(arc4random() % 255) / 255 - let color = UIColor(red: r, green: g, blue: b, alpha: 1.0) + let color = UIColor(red: red, green: green, blue: blue, alpha: 1.0) drawView.setColor(color) eraserButton.isEnabled = true } diff --git a/Package.swift b/Package.swift index e46dd7f..fd9648e 100644 --- a/Package.swift +++ b/Package.swift @@ -3,14 +3,14 @@ import PackageDescription let package = Package( - name: "TouchDraw", + name: "TouchDraw", platforms: [ .iOS(.v10) ], - products: [ - .library(name: "TouchDraw", targets: ["TouchDraw"]), + products: [ + .library(name: "TouchDraw", targets: ["TouchDraw"]) ], - targets: [ - .target(name: "TouchDraw", path: "Sources"), + targets: [ + .target(name: "TouchDraw", path: "Sources") ] -) \ No newline at end of file +) diff --git a/README.md b/README.md index 5f3994c..d988f37 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The easiest way to include `TouchDraw` is by using `CocoaPods` and adding the fo ``` use_frameworks! -pod 'TouchDraw', '~> 2.1' +pod 'TouchDraw', '~> 2.2' ``` If you're not using CocoaPods, you can add the `TouchDrawView.swift` file to your project. diff --git a/Sources/TouchDrawView.swift b/Sources/TouchDrawView.swift index 03c711c..841a9e1 100644 --- a/Sources/TouchDrawView.swift +++ b/Sources/TouchDrawView.swift @@ -309,9 +309,9 @@ fileprivate extension TouchDrawView { drawLine(fromPoint: point, toPoint: point, properties: properties) } - for i in stride(from: 1, to: points.count, by: 1) { - let point0 = points[i - 1] - let point1 = points[i] + for index in stride(from: 1, to: points.count, by: 1) { + let point0 = points[index - 1] + let point1 = points[index] drawLine(fromPoint: point0, toPoint: point1, properties: properties) } } diff --git a/TouchDraw.podspec b/TouchDraw.podspec index 0d2ce00..2371697 100644 --- a/TouchDraw.podspec +++ b/TouchDraw.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.name = "TouchDraw" - s.version = "2.1.3" + s.version = "2.2.0" s.summary = "TouchDraw is a UIView you can draw on." s.description = <<-DESC diff --git a/TouchDraw.xcodeproj/project.pbxproj b/TouchDraw.xcodeproj/project.pbxproj index 2cd005a..8f9fcaf 100644 --- a/TouchDraw.xcodeproj/project.pbxproj +++ b/TouchDraw.xcodeproj/project.pbxproj @@ -244,7 +244,7 @@ buildSettings = { CLANG_ANALYZER_NONNULL = YES; INFOPLIST_FILE = TouchDrawTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.dehli.TouchDrawTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -258,7 +258,7 @@ buildSettings = { CLANG_ANALYZER_NONNULL = YES; INFOPLIST_FILE = TouchDrawTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.dehli.TouchDrawTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -314,7 +314,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -366,7 +366,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/TouchDraw/Info.plist b/TouchDraw/Info.plist index 28d15c1..a60ea4a 100644 --- a/TouchDraw/Info.plist +++ b/TouchDraw/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.3 + 2.2.0 CFBundleSignature ???? CFBundleVersion