Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions CBApp/CBApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = Type2Designs;
TargetAttributes = {
DEEBE0431B9892B600F18093 = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -291,12 +291,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -346,12 +348,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -403,8 +407,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -429,8 +432,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion CBApp/CBApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion CBApp/CBApp/CVLayoutCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CVLayoutCell : UICollectionViewCell, UICollectionViewDataSource, UICollect

let imgIndex = (indexPath as NSIndexPath).row % imgURLs.count
let url = imgURLs[imgIndex]
cell.imageView.onLoadTransition = UIViewAnimationOptions.transitionCrossDissolve
cell.imageView.onLoadTransition = UIView.AnimationOptions.transitionCrossDissolve
cell.imageView.loadImage(at: url, completion: nil)

return cell
Expand Down
6 changes: 3 additions & 3 deletions CBApp/CBApp/LoadersCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class LoadersCell : UICollectionViewCell {
@IBAction func toggleActivityIndicator(_ sender: CBButton) {
if activityIndicator.animating {
activityIndicator.stopAnimating()
sender.setTitle("Start", for: UIControlState.normal)
sender.setTitle("Start", for: UIControl.State.normal)
sender.tintColor = UIColor.white
}
else {
activityIndicator.startAnimating()
sender.setTitle("Stop", for: UIControlState.normal)
sender.setTitle("Stop", for: UIControl.State.normal)
sender.tintColor = UIColor.red
}
}
Expand Down Expand Up @@ -70,7 +70,7 @@ class LoadersCell : UICollectionViewCell {
self.progress = 0
self.uploadButtonView.isEnabled = true
self.progressCompleteImageView.transform = CGAffineTransform(scaleX: 0, y: 0)
UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIViewAnimationOptions.curveEaseOut, animations: { () -> Void in
UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIView.AnimationOptions.curveEaseOut, animations: { () -> Void in
self.progressCompleteImageView.alpha = 1
self.progressCompleteImageView.transform = CGAffineTransform(scaleX: 1, y: 1)
}) { (fin) -> Void in
Expand Down
6 changes: 2 additions & 4 deletions CBApp/CBApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import CBToolkit

class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, GalleryDelegate, CBImageEditorDelegate {

@IBOutlet weak var contentCollectionView: UICollectionView!

override func viewDidLoad() {
Expand Down Expand Up @@ -65,7 +65,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection


func openImageEditor(_ image: UIImage) {
let editor = CBImageEditor(image: image, style: UIBlurEffectStyle.light, delegate: self)
let editor = CBImageEditor(image: image, style: UIBlurEffect.Style.light, delegate: self)
self.present(editor, animated: true, completion: nil)
}

Expand All @@ -77,7 +77,5 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
editor.dismiss(animated: true, completion: nil)
}



}

2 changes: 1 addition & 1 deletion CBToolkit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "CBToolkit"
s.version = "0.2.3"
s.version = "1.0"
s.summary = "A UI and utility Toolkit for iOS"
s.homepage = "https://github.com/WCByrne/CBToolkit"
s.license = "MIT"
Expand Down
14 changes: 8 additions & 6 deletions CBToolkit/CBToolkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = WCBMedia;
TargetAttributes = {
1CDBAFED1A7D8A7200D7677B = {
CreatedOnToolsVersion = 6.1.1;
DevelopmentTeam = 33W8XH2WT5;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
};
};
Expand Down Expand Up @@ -240,12 +240,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -297,12 +299,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -355,8 +359,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -378,8 +381,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.wcbmedia.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "1000"
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:CBToolkit.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">
<MacroExpansion>
<BuildableReference
Expand All @@ -85,10 +88,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
Expand Down
16 changes: 8 additions & 8 deletions CBToolkit/CBToolkit/CBButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ import UIKit


private func animateShrink() {
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction, UIView.AnimationOptions.beginFromCurrentState], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: self.shrinkscale, y: self.shrinkscale)
}, completion: nil)
}

private func animateToResting() {
UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform.identity
}, completion: nil)
}

public func popAnimation() {
UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIViewAnimationOptions.curveEaseOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIView.AnimationOptions.curveEaseOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: self.popScale, y: self.popScale)
}) { (finished) -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: 1, y: 1)
}, completion: nil)
}
Expand Down Expand Up @@ -198,23 +198,23 @@ import UIKit
}

private func animateShrink() {
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction, UIView.AnimationOptions.beginFromCurrentState], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: self.shrinkscale, y: self.shrinkscale)
}, completion: nil)
}


private func animateToResting() {
UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform.identity
}, completion: nil)
}

public func popAnimation() {
UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIViewAnimationOptions.curveEaseOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIView.AnimationOptions.curveEaseOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: self.popScale, y: self.popScale)
}) { (finished) -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in
UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in
self.transform = CGAffineTransform(scaleX: 1, y: 1)
}, completion: nil)
}
Expand Down
2 changes: 1 addition & 1 deletion CBToolkit/CBToolkit/CBCollectionViewLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public class CBCollectionViewLayout : UICollectionViewLayout, UIGestureRecognize
// let v = velocity ?? CGPoint.zero

let cell = self.collectionView?.cellForItem(at: finalIndexPath as IndexPath)
UIView.animate(withDuration: 0.35, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0, options: UIViewAnimationOptions.beginFromCurrentState, animations: { () -> Void in
UIView.animate(withDuration: 0.35, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0, options: UIView.AnimationOptions.beginFromCurrentState, animations: { () -> Void in
oldView.frame = attr!.frame
cell?.alpha = 1
}, completion: { (fin) -> Void in
Expand Down
Loading