Skip to content

Commit

Permalink
Update for Xcode 15 and also fix an assertion due to zero size (#60)
Browse files Browse the repository at this point in the history
* Update the readme

* Make the project build in Xcode 15 by bumping min target and adding a version for the demo

* Don't redraw if the image size is zero to avoid an assertion

https://developer.apple.com/forums/thread/733326
  • Loading branch information
ricsantos authored Sep 25, 2023
1 parent e0e7748 commit 4c38a18
Show file tree
Hide file tree
Showing 12 changed files with 360 additions and 293 deletions.
4 changes: 2 additions & 2 deletions Demo/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
TouchDraw: 02074f86f08957eceb8ee3012b6b8740405e6109
TouchDraw: ceed566f08865e4c7e41a338659117224788a95b

PODFILE CHECKSUM: f850bd72d12b5fb4f18cad822d3a3481b9ad2931

COCOAPODS: 1.5.3
COCOAPODS: 1.12.1
2 changes: 1 addition & 1 deletion Demo/Pods/Local Podspecs/TouchDraw.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Demo/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

485 changes: 250 additions & 235 deletions Demo/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions Demo/TouchDrawDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -204,7 +205,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TouchDrawDemo/Pods-TouchDrawDemo-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-TouchDrawDemo/Pods-TouchDrawDemo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/TouchDraw/TouchDraw.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -213,7 +214,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TouchDrawDemo/Pods-TouchDrawDemo-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TouchDrawDemo/Pods-TouchDrawDemo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -296,7 +297,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -343,7 +344,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -357,7 +358,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = TouchDrawDemo/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "TouchDraw Demo";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.dehli.touchdraw;
Expand All @@ -373,7 +377,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = TouchDrawDemo/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "TouchDraw Demo";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = io.dehli.touchdraw;
Expand Down
2 changes: 2 additions & 0 deletions Demo/TouchDrawDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
1 change: 1 addition & 0 deletions Sources/TouchDrawView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ fileprivate extension TouchDrawView {

/// Clears view, then draws stack
func redrawStack() {
if imageView.frame.size == .zero { return }
beginImageContext()
image?.draw(in: imageView.bounds)
for stroke in stack {
Expand Down
2 changes: 1 addition & 1 deletion TouchDraw.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/cpdehli"

s.platform = :ios
s.ios.deployment_target = "8.0"
s.ios.deployment_target = "12.0"

s.source = { :git => "https://github.com/dehli/TouchDraw.git", :tag => "#{s.version}"}
s.source_files = "Sources/**/*.{swift}"
Expand Down
5 changes: 3 additions & 2 deletions TouchDraw.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 89F60F611BC9580000BCDD93;
Expand Down Expand Up @@ -387,7 +388,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = TouchDraw/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.dehli.TouchDraw;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -409,7 +410,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = TouchDraw/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.dehli.TouchDraw;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

0 comments on commit 4c38a18

Please sign in to comment.