Skip to content

Commit

Permalink
Merge branch 'swift-2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavlt committed Jun 27, 2016
2 parents d741e1d + 25de77f commit 60ab7c7
Show file tree
Hide file tree
Showing 43 changed files with 5,117 additions and 932 deletions.
4 changes: 2 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
language: objective-c
install:
- gem install cocoapods -v 0.38.2 --no-document
Expand All @@ -9,4 +9,4 @@ before_script:

xcode_workspace: LiquidFloatingActionButton.xcworkspace
xcode_scheme: LiquidFloatingActionButton-Example
xcode_sdk: iphonesimulator8.4
xcode_sdk: iphonesimulator9.0
13 changes: 10 additions & 3 deletions Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
1DBCE28963DAD945FFD48B50 /* Pods_LiquidFloatingActionButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C3A86F9C536AF0FF2200223 /* Pods_LiquidFloatingActionButton_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
49A475E961E793F7AF7E4ED6 /* Pods_LiquidFloatingActionButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 919BDD2D3636894AF8DB602C /* Pods_LiquidFloatingActionButton_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
1DBCE28963DAD945FFD48B50 /* Pods_LiquidFloatingActionButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C3A86F9C536AF0FF2200223 /* Pods_LiquidFloatingActionButton_Example.framework */; };
49A475E961E793F7AF7E4ED6 /* Pods_LiquidFloatingActionButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 919BDD2D3636894AF8DB602C /* Pods_LiquidFloatingActionButton_Tests.framework */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
Expand Down Expand Up @@ -209,7 +209,9 @@
607FACC81AFB9204008FA782 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -422,6 +424,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 @@ -491,6 +494,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
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 @@ -504,6 +508,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
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 @@ -523,6 +528,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)/LiquidFloatingActionButton_Example.app/LiquidFloatingActionButton_Example";
};
Expand All @@ -539,6 +545,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)/LiquidFloatingActionButton_Example.app/LiquidFloatingActionButton_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:LiquidFloatingActionButton.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
4 changes: 2 additions & 2 deletions Example/LiquidFloatingActionButton/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<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>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
79 changes: 73 additions & 6 deletions Example/LiquidFloatingActionButton/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,102 @@
//

import UIKit
import SnapKit
import LiquidFloatingActionButton

public class CustomCell : LiquidFloatingCell {
var name: String = "sample"

init(icon: UIImage, name: String) {
self.name = name
super.init(icon: icon)
}

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

public override func setupView(view: UIView) {
super.setupView(view)
let label = UILabel()
label.text = name
label.textColor = UIColor.whiteColor()
label.font = UIFont(name: "Helvetica-Neue", size: 12)
addSubview(label)
label.snp_makeConstraints { make in
make.left.equalTo(self).offset(-80)
make.width.equalTo(75)
make.top.height.equalTo(self)
}
}
}

public class CustomDrawingActionButton: LiquidFloatingActionButton {

override public func createPlusLayer(frame: CGRect) -> CAShapeLayer {

let plusLayer = CAShapeLayer()
plusLayer.lineCap = kCALineCapRound
plusLayer.strokeColor = UIColor.whiteColor().CGColor
plusLayer.lineWidth = 3.0

let w = frame.width
let h = frame.height

let points = [
(CGPoint(x: w * 0.25, y: h * 0.35), CGPoint(x: w * 0.75, y: h * 0.35)),
(CGPoint(x: w * 0.25, y: h * 0.5), CGPoint(x: w * 0.75, y: h * 0.5)),
(CGPoint(x: w * 0.25, y: h * 0.65), CGPoint(x: w * 0.75, y: h * 0.65))
]

let path = UIBezierPath()
for (start, end) in points {
path.moveToPoint(start)
path.addLineToPoint(end)
}

plusLayer.path = path.CGPath

return plusLayer
}
}

class ViewController: UIViewController, LiquidFloatingActionButtonDataSource, LiquidFloatingActionButtonDelegate {

var cells: [LiquidFloatingCell] = []
var floatingActionButton: LiquidFloatingActionButton!

override func viewDidLoad() {
super.viewDidLoad()

// self.view.backgroundColor = UIColor(red: 55 / 255.0, green: 55 / 255.0, blue: 55 / 255.0, alpha: 1.0)
// Do any additional setup after loading the view, typically from a nib.
let createButton: (CGRect, LiquidFloatingActionButtonAnimateStyle) -> LiquidFloatingActionButton = { (frame, style) in
let floatingActionButton = LiquidFloatingActionButton(frame: frame)
let floatingActionButton = CustomDrawingActionButton(frame: frame)
floatingActionButton.animateStyle = style
floatingActionButton.dataSource = self
floatingActionButton.delegate = self
return floatingActionButton
}

let cellFactory: (String) -> LiquidFloatingCell = { (iconName) in
return LiquidFloatingCell(icon: UIImage(named: iconName)!)
let cell = LiquidFloatingCell(icon: UIImage(named: iconName)!)
return cell
}
let customCellFactory: (String) -> LiquidFloatingCell = { (iconName) in
let cell = CustomCell(icon: UIImage(named: iconName)!, name: iconName)
return cell
}
cells.append(cellFactory("ic_cloud"))
cells.append(cellFactory("ic_system"))
cells.append(customCellFactory("ic_system"))
cells.append(cellFactory("ic_place"))

let floatingFrame = CGRect(x: self.view.frame.width - 56 - 16, y: self.view.frame.height - 56 - 16, width: 56, height: 56)
let bottomRightButton = createButton(floatingFrame, .Up)

let image = UIImage(named: "ic_art")
bottomRightButton.image = image

let floatingFrame2 = CGRect(x: 16, y: 16, width: 56, height: 56)
let topLeftButton = createButton(floatingFrame2, .Down)

Expand All @@ -47,7 +114,7 @@ class ViewController: UIViewController, LiquidFloatingActionButtonDataSource, Li
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

func numberOfCells(liquidFloatingActionButton: LiquidFloatingActionButton) -> Int {
return cells.count
}
Expand All @@ -57,8 +124,8 @@ class ViewController: UIViewController, LiquidFloatingActionButtonDataSource, Li
}

func liquidFloatingActionButton(liquidFloatingActionButton: LiquidFloatingActionButton, didSelectItemAtIndex index: Int) {
println("did Tapped! \(index)")
floatingActionButton.close()
print("did Tapped! \(index)")
liquidFloatingActionButton.close()
}

}
1 change: 1 addition & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use_frameworks!

target 'LiquidFloatingActionButton_Example', :exclusive => true do
pod "LiquidFloatingActionButton", :path => "../"
pod "SnapKit"
end

target 'LiquidFloatingActionButton_Tests', :exclusive => true do
Expand Down
7 changes: 5 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
PODS:
- LiquidFloatingActionButton (0.1.2)
- SnapKit (0.20.0)

DEPENDENCIES:
- LiquidFloatingActionButton (from `../`)
- SnapKit

EXTERNAL SOURCES:
LiquidFloatingActionButton:
:path: ../

SPEC CHECKSUMS:
LiquidFloatingActionButton: 438a98371cfba6856ef37a40c106a75462b237b9
LiquidFloatingActionButton: 12ed6f642365142f85c73eaebef8c40b6590511e
SnapKit: 5fce3c1bbbf1fbd31de9aa92f33eb9fa03f15650

COCOAPODS: 0.39.0.beta.4
COCOAPODS: 0.39.0

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

7 changes: 5 additions & 2 deletions Example/Pods/Manifest.lock

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

Loading

0 comments on commit 60ab7c7

Please sign in to comment.