Skip to content

Commit

Permalink
Swift 2 only compatibility from 0.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Bunney committed Aug 5, 2015
1 parent 0e34c87 commit 7f4737f
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ before_install:
- gem install xcpretty
script:
- set -o pipefail
- xcodebuild -project Toucan.xcodeproj -scheme "ToucanTests" test -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c

# Disabled until Travis supports Xcode 7 :-(
#- xcodebuild -project Toucan.xcodeproj -scheme "ToucanTests" test -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ Toucan is a Swift library that provides a clean, quick API for processing images

## Requirements ##

- Xcode 6
- iOS 7.0+
- Xcode 7
- iOS 8.0+

*As of version 0.4, Toucan only supports Swift 2. Use version 0.3.x for the latest Swift 1.2 compatible release*

## Setup ##

Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
12 changes: 6 additions & 6 deletions Source/Toucan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public class Toucan : NSObject {

- returns: Self, allowing method chaining
*/
public func maskWithImage(#maskImage : UIImage) -> Toucan {
public func maskWithImage(maskImage maskImage : UIImage) -> Toucan {
self.image = Toucan.Mask.maskImageWithImage(self.image, maskImage: maskImage)
return self
}
Expand All @@ -222,7 +222,7 @@ public class Toucan : NSObject {

- returns: Self, allowing method chaining
*/
public func maskWithPath(#path: UIBezierPath) -> Toucan {
public func maskWithPath(path path: UIBezierPath) -> Toucan {
self.image = Toucan.Mask.maskImageWithPath(self.image, path: path)
return self
}
Expand All @@ -234,7 +234,7 @@ public class Toucan : NSObject {

- returns: Self, allowing method chaining
*/
public func maskWithPathClosure(#path: (rect: CGRect) -> (UIBezierPath)) -> Toucan {
public func maskWithPathClosure(path path: (rect: CGRect) -> (UIBezierPath)) -> Toucan {
self.image = Toucan.Mask.maskImageWithPathClosure(self.image, pathInRect: path)
return self
}
Expand All @@ -249,7 +249,7 @@ public class Toucan : NSObject {

- returns: Self, allowing method chaining
*/
public func maskWithRoundedRect(#cornerRadius: CGFloat, borderWidth: CGFloat = 0, borderColor: UIColor = UIColor.whiteColor()) -> Toucan {
public func maskWithRoundedRect(cornerRadius cornerRadius: CGFloat, borderWidth: CGFloat = 0, borderColor: UIColor = UIColor.whiteColor()) -> Toucan {
self.image = Toucan.Mask.maskImageWithRoundedRect(self.image, cornerRadius: cornerRadius, borderWidth: borderWidth, borderColor: borderColor)
return self
}
Expand Down Expand Up @@ -531,7 +531,7 @@ public class Toucan : NSObject {
CGImageGetBitsPerComponent(image.CGImage),
CGImageGetBytesPerRow(image.CGImage),
CGImageGetColorSpace(image.CGImage),
CGImageGetBitmapInfo(image.CGImage))!;
CGImageGetBitmapInfo(image.CGImage).rawValue)!;

CGContextConcatCTM(context, transform);

Expand Down Expand Up @@ -587,7 +587,7 @@ public class Toucan : NSObject {

- returns: Image pulled from the end of the closure
*/
static func drawImageWithClosure(#size: CGSize!, closure: (size: CGSize, context: CGContext) -> ()) -> UIImage {
static func drawImageWithClosure(size size: CGSize!, closure: (size: CGSize, context: CGContext) -> ()) -> UIImage {
UIGraphicsBeginImageContextWithOptions(size, false, 0)
closure(size: size, context: UIGraphicsGetCurrentContext())
let image : UIImage = UIGraphicsGetImageFromCurrentImageContext()
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
2 changes: 1 addition & 1 deletion Toucan.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Toucan'
s.version = '0.3.1'
s.version = '0.4.0'
s.license = 'MIT'
s.summary = 'Fabulous Image Processing in Swift'
s.homepage = 'https://github.com/gavinbunney/Toucan'
Expand Down
7 changes: 6 additions & 1 deletion Toucan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0600;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Bunney Apps";
TargetAttributes = {
740AC3E91999799900AB9A86 = {
Expand Down Expand Up @@ -286,6 +286,7 @@
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -363,6 +364,7 @@
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -380,6 +382,7 @@
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
Expand All @@ -398,6 +401,7 @@
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -411,6 +415,7 @@
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "au.net.bunney.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
55 changes: 52 additions & 3 deletions Toucan.xcodeproj/xcshareddata/xcschemes/Toucan.xcscheme
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction>
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForRunning = "YES">
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "740AC3E91999799900AB9A86"
Expand All @@ -15,8 +22,50 @@
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug">
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "740AC3E91999799900AB9A86"
BuildableName = "Toucan.framework"
BlueprintName = "Toucan"
ReferencedContainer = "container:Toucan.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
55 changes: 50 additions & 5 deletions Toucan.xcodeproj/xcshareddata/xcschemes/ToucanTests.xcscheme
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction>
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForTesting = "YES">
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "740AC3F41999799900AB9A86"
Expand All @@ -17,9 +23,13 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug">
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "740AC3F41999799900AB9A86"
Expand All @@ -29,8 +39,43 @@
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
useCustomWorkingDirectory = "NO">
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "740AC3F41999799900AB9A86"
BuildableName = "ToucanTests.xctest"
BlueprintName = "ToucanTests"
ReferencedContainer = "container:Toucan.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

0 comments on commit 7f4737f

Please sign in to comment.