Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
74f704f
Update README.md
yoavlt Sep 8, 2015
cf904c8
Support iOS 7.0+ for minimum deployment target
yoavlt Sep 8, 2015
38349f5
Bump version to 0.1.2
yoavlt Sep 8, 2015
d741e1d
Fix minimum version to iOS 8.0
yoavlt Sep 8, 2015
e743775
change floatingActionButton => liquidFloatingActionButton
DingGong Oct 4, 2015
5abf9d7
Merge pull request #12 from LancerDing/master
yoavlt Oct 4, 2015
f6335db
Fix typo
reillywatson May 25, 2016
6c5883a
Merge pull request #65 from reillywatson/patch-1
yoavlt May 25, 2016
7b53e18
updated podfile for compatibility with more recent changes
shotaroikeda Jun 6, 2016
f4d9f01
updated project build settings for xcode 7
shotaroikeda Jun 6, 2016
ce08bb7
somewhat working
shotaroikeda Jun 6, 2016
6b7a59b
updated example, cell colors default to button colors
shotaroikeda Jun 6, 2016
64c56f4
updated readme to prepare for release
shotaroikeda Jun 6, 2016
ebdb486
added gif of updated feature
shotaroikeda Jun 6, 2016
aa4766b
updated readme
shotaroikeda Jun 6, 2016
a838c9d
fixed broken gif link
shotaroikeda Jun 6, 2016
b9e8417
Merge branch 'master' into swift-2.0
shotaroikeda Jun 6, 2016
bec308d
updated readme for correct pod file instructions
shotaroikeda Jun 6, 2016
3b8bf2d
updated travis for cocoapods v 1.0.1
shotaroikeda Jun 6, 2016
05a77b7
updated for swift 2.2 syntax
shotaroikeda Jun 6, 2016
1bce458
added updating repo for travis
shotaroikeda Jun 6, 2016
52dbdc2
made sure shadows actually don't get drawn
shotaroikeda Jun 6, 2016
7d34bca
added shadow bug fix (or feature?)
shotaroikeda Jun 6, 2016
fcd3549
removed unnecessary colors
shotaroikeda Jun 7, 2016
5ff389a
Merge branch 'master' into swift-2.0
shotaroikeda Jun 7, 2016
2631f93
better handling of default colors
shotaroikeda Jun 7, 2016
1903dbc
performance improvements by relying on garbage collector
shotaroikeda Jun 7, 2016
3791ad3
updated travis to work with newer selector syntax, silent pod update
shotaroikeda Jun 7, 2016
d1f5a58
bumped version for small performance increase
shotaroikeda Jun 7, 2016
9342185
fixed typo
shotaroikeda Jun 7, 2016
5b75829
updated ios sdk for travis
shotaroikeda Jun 7, 2016
c1741db
reverted travis image to see if build will go through
shotaroikeda Jun 7, 2016
bcaa439
upgrade to swift 3
shotaroikeda Sep 21, 2016
1df2109
updated snapkit dependency to swift 3
shotaroikeda Sep 21, 2016
e9af1dc
fixed demo build settings
shotaroikeda Sep 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Demo/colored_example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 72 additions & 63 deletions Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 6 additions & 6 deletions Example/LiquidFloatingActionButton/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
5 changes: 3 additions & 2 deletions Example/LiquidFloatingActionButton/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
41 changes: 24 additions & 17 deletions Example/LiquidFloatingActionButton/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import LiquidFloatingActionButton

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

init(icon: UIImage, name: String) {
Expand All @@ -22,28 +22,28 @@ public class CustomCell : LiquidFloatingCell {
fatalError("init(coder:) has not been implemented")
}

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

public class CustomDrawingActionButton: LiquidFloatingActionButton {
open class CustomDrawingActionButton: LiquidFloatingActionButton {

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

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

let w = frame.width
Expand All @@ -57,11 +57,11 @@ public class CustomDrawingActionButton: LiquidFloatingActionButton {

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

plusLayer.path = path.CGPath
plusLayer.path = path.cgPath

return plusLayer
}
Expand Down Expand Up @@ -93,18 +93,25 @@ class ViewController: UIViewController, LiquidFloatingActionButtonDataSource, Li
let cell = CustomCell(icon: UIImage(named: iconName)!, name: iconName)
return cell
}

// Insert cell with color customization!
cells.append(cellFactory("ic_cloud"))
cells.last?.color = UIColor.red // Set cell to red color

cells.append(customCellFactory("ic_system"))
cells.last?.color = UIColor.blue // Set Cell to blue color

cells.append(cellFactory("ic_place"))
// Cell becomes the button's color!

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 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)
let topLeftButton = createButton(floatingFrame2, .down)

self.view.addSubview(bottomRightButton)
self.view.addSubview(topLeftButton)
Expand All @@ -115,17 +122,17 @@ class ViewController: UIViewController, LiquidFloatingActionButtonDataSource, Li
// Dispose of any resources that can be recreated.
}

func numberOfCells(liquidFloatingActionButton: LiquidFloatingActionButton) -> Int {
func numberOfCells(_ liquidFloatingActionButton: LiquidFloatingActionButton) -> Int {
return cells.count
}

func cellForIndex(index: Int) -> LiquidFloatingCell {
func cellForIndex(_ index: Int) -> LiquidFloatingCell {
return cells[index]
}

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

}
}
4 changes: 2 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

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

target 'LiquidFloatingActionButton_Tests', :exclusive => true do
target 'LiquidFloatingActionButton_Tests' do
pod "LiquidFloatingActionButton", :path => "../"


Expand Down
12 changes: 7 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- LiquidFloatingActionButton (0.1.1)
- SnapKit (0.20.0)
- LiquidFloatingActionButton (0.2.0)
- SnapKit (3.0.1)

DEPENDENCIES:
- LiquidFloatingActionButton (from `../`)
Expand All @@ -11,7 +11,9 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
LiquidFloatingActionButton: dcdae1e59eb07eccbf60c027001a4d6731c345c9
SnapKit: 5fce3c1bbbf1fbd31de9aa92f33eb9fa03f15650
LiquidFloatingActionButton: 29795cd474e42f44766f0d7073d573442cb989a8
SnapKit: f818b8326d45b4e1c777d0ab27b5c0a3624bfdeb

COCOAPODS: 0.39.0
PODFILE CHECKSUM: d32e84aa2d52a9e8dbba10e8de937cda2a823e0d

COCOAPODS: 1.1.0.rc.2

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

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

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

Loading