Skip to content

Commit

Permalink
Merge pull request #14 from robertherdzik/Update_t0_swift_2.2
Browse files Browse the repository at this point in the history
Update to Swift 2.2
  • Loading branch information
yoavlt committed May 14, 2016
2 parents f0d0a2c + 45a36a7 commit 6f8f7d6
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 29 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode6.4
osx_image: xcode7.3
language: objective-c
install:
- gem install cocoapods -v 0.38.2 --no-document
Expand All @@ -9,4 +9,5 @@ before_script:

xcode_workspace: LiquidLoader.xcworkspace
xcode_scheme: LiquidLoader-Example
xcode_sdk: iphonesimulator8.4
xcode_sdk: iphonesimulator9.3
script: set -o pipefail
8 changes: 7 additions & 1 deletion Example/LiquidLoader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@
607FACC81AFB9204008FA782 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -422,6 +423,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -490,6 +492,7 @@
INFOPLIST_FILE = LiquidLoader/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -502,6 +505,7 @@
INFOPLIST_FILE = LiquidLoader/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -521,6 +525,7 @@
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiquidLoader_Example.app/LiquidLoader_Example";
};
Expand All @@ -537,6 +542,7 @@
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LiquidLoader_Example.app/LiquidLoader_Example";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +62,18 @@
ReferencedContainer = "container:LiquidLoader.xcodeproj">
</BuildableReference>
</MacroExpansion>
<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">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand All @@ -86,10 +89,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion Example/LiquidLoader/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>org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
1 change: 1 addition & 0 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

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.

2 changes: 1 addition & 1 deletion Example/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>org.cocoapods.$(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 Pod/Classes/ArrayEx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension Array {

func indexOf <U: Equatable> (item: U) -> Int? {
if item is Element {
return Swift.find(unsafeBitCast(self, [U].self), item)
return unsafeBitCast(self, [U].self).indexOf(item)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions Pod/Classes/CircularGradientLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class CircularGradientLayer : CALayer {
setNeedsDisplay()
}

required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func drawInContext(ctx: CGContext!) {
override func drawInContext(ctx: CGContext) {
var locations = CGMath.linSpace(0.0, to: 1.0, n: colors.count)
locations = locations.map { 1.0 - $0 * $0 }.reverse()
locations = Array(locations.map { 1.0 - $0 * $0 }.reverse())
let gradients = CGGradientCreateWithColors(CGColorSpaceCreateDeviceRGB(), colors.map { $0.CGColor }, locations)
CGContextDrawRadialGradient(ctx, gradients, self.frame.center, CGFloat(0.0), self.frame.center, max(self.frame.width, self.frame.height), 10)
CGContextDrawRadialGradient(ctx, gradients, self.frame.center, CGFloat(0.0), self.frame.center, max(self.frame.width, self.frame.height), CGGradientDrawingOptions(rawValue: 10))
}
}
2 changes: 1 addition & 1 deletion Pod/Classes/LiquidLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class LiquidLoader : UIView {
self.effectDelegate = self.effect.setup(self)
}

public required init(coder aDecoder: NSCoder) {
public required init?(coder aDecoder: NSCoder) {
self.effect = .Circle(UIColor.whiteColor())
super.init(coder: aDecoder)
self.effectDelegate = self.effect.setup(self)
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/LiquittableCircle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LiquittableCircle : UIView {
setup()
}

required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

Expand Down
8 changes: 4 additions & 4 deletions Pod/Classes/UIView+Grow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import UIKit

extension UIView {
func grow(baseColor: UIColor, radius: CGFloat, shininess: CGFloat) {
guard let sublayers = layer.sublayers as? [CAShapeLayer] else { return }

let growColor = UIColor(red: 0 / 255.0, green: 1, blue: 1, alpha: 1.0)
growShadow(radius, growColor: growColor, shininess: shininess)
let circle = CAShapeLayer()
circle.path = UIBezierPath(ovalInRect: CGRect(x: 0, y: 0, width: radius * 2.0, height: radius * 2.0)).CGPath
let circleGradient = CircularGradientLayer(colors: [growColor, UIColor(white: 1.0, alpha: 0)])
circleGradient.frame = CGRect(x: 0, y: 0, width: radius * 2.0, height: radius * 2.0)
circleGradient.opacity = 0.25
for sub in layer.sublayers {
if let l = sub as? CAShapeLayer {
l.fillColor = UIColor.clearColor().CGColor
}
for sub in sublayers {
sub.fillColor = UIColor.clearColor().CGColor
}
circleGradient.mask = circle
layer.addSublayer(circleGradient)
Expand Down

0 comments on commit 6f8f7d6

Please sign in to comment.