Commit 64d0eaea by Daniel Dahan

development: fixed issue where result was causing a warning issue-528

parent ccd546c8
......@@ -59,7 +59,8 @@ public typealias AnimationDelayCancelBlock = (Bool) -> Void
public struct Animation {
/// Delay helper method.
public static func delay(time: TimeInterval, completion: @escaping () -> Void) -> AnimationDelayCancelBlock {
@discardableResult
public static func delay(time: TimeInterval, completion: @escaping () -> Void) -> AnimationDelayCancelBlock? {
func asyncAfter(completion: @escaping () -> Void) {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + time, execute: completion)
......@@ -80,7 +81,7 @@ public struct Animation {
cancelable?(false)
}
return delayed;
return cancelable;
}
/**
......@@ -127,7 +128,7 @@ public struct Animation {
:name: animateWithDelay
*/
public static func animateWithDelay(delay d: CFTimeInterval, duration: CFTimeInterval, animations: @escaping (() -> Void), completion: (() -> Void)? = nil) {
_ = delay(time: d) {
delay(time: d) {
animateWithDuration(duration: duration, animations: animations, completion: completion)
}
}
......
......@@ -109,7 +109,7 @@ open class BottomTabBar: UITabBar {
super.didMoveToSuperview()
if isAlignedToParentAutomatically {
if let v = superview {
_ = v.layout(self).bottom().horizontally()
v.layout(self).bottom().horizontally()
}
}
}
......
......@@ -180,7 +180,7 @@ open class Button: UIButton {
open func pulse(point: CGPoint? = nil) {
let p = nil == point ? CGPoint(x: CGFloat(width / 2), y: CGFloat(height / 2)) : point!
Animation.pulseExpandAnimation(layer: layer, visualLayer: visualLayer, pulseColor: pulseColor, pulseOpacity: pulseOpacity, point: p, width: width, height: height, pulseLayers: &pulseLayers, pulseAnimation: pulseAnimation)
_ = Animation.delay(time: 0.35) { [weak self] in
Animation.delay(time: 0.35) { [weak self] in
guard let s = self else {
return
}
......
......@@ -568,7 +568,7 @@ open class Capture: View, UIGestureRecognizerDelegate {
}
v.transform = CATransform3DMakeScale(0.5, 0.5, 1)
}) {
_ = Animation.delay(time: 0.4) { [weak layer] in
Animation.delay(time: 0.4) { [weak layer] in
Animation.animationDisabled { [weak layer] in
guard let v = layer else {
return
......
......@@ -286,7 +286,7 @@ open class Card: PulseView {
verticalFormat += "-[titleLabel]"
views["titleLabel"] = v
_ = layout(v).horizontally(left: contentInset.left + titleLabelInset.left, right: contentInset.right + titleLabelInset.right)
layout(v).horizontally(left: contentInset.left + titleLabelInset.left, right: contentInset.right + titleLabelInset.right)
}
// detail
......@@ -301,7 +301,7 @@ open class Card: PulseView {
verticalFormat += "-[contentView]"
views["contentView"] = v
_ = layout(v).horizontally(left: contentInset.left + contentViewInset.left, right: contentInset.right + contentViewInset.right)
layout(v).horizontally(left: contentInset.left + contentViewInset.left, right: contentInset.right + contentViewInset.right)
}
// leftButtons
......@@ -322,7 +322,7 @@ open class Card: PulseView {
h += "[\(k)]"
_ = layout(b).bottom(contentInset.bottom + leftButtonsInset.bottom)
layout(b).bottom(contentInset.bottom + leftButtonsInset.bottom)
i += 1
}
......@@ -349,7 +349,7 @@ open class Card: PulseView {
h += "-(right_left)-"
}
_ = layout(b).bottom(contentInset.bottom + rightButtonsInset.bottom)
layout(b).bottom(contentInset.bottom + rightButtonsInset.bottom)
i -= 1
}
......
......@@ -217,7 +217,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView {
open func pulse(point: CGPoint? = nil) {
let p: CGPoint = nil == point ? CGPoint(x: CGFloat(width / 2), y: CGFloat(height / 2)) : point!
Animation.pulseExpandAnimation(layer: layer, visualLayer: visualLayer, pulseColor: pulseColor, pulseOpacity: pulseOpacity, point: p, width: width, height: height, pulseLayers: &pulseLayers, pulseAnimation: pulseAnimation)
_ = Animation.delay(time: 0.35) { [weak self] in
Animation.delay(time: 0.35) { [weak self] in
guard let s = self else {
return
}
......
......@@ -227,7 +227,7 @@ open class CollectionViewCell: UICollectionViewCell {
open func pulse(point: CGPoint? = nil) {
let p: CGPoint = nil == point ? CGPoint(x: CGFloat(width / 2), y: CGFloat(height / 2)) : point!
Animation.pulseExpandAnimation(layer: layer, visualLayer: visualLayer, pulseColor: pulseColor, pulseOpacity: pulseOpacity, point: p, width: width, height: height, pulseLayers: &pulseLayers, pulseAnimation: pulseAnimation)
_ = Animation.delay(time: 0.35) { [weak self] in
Animation.delay(time: 0.35) { [weak self] in
guard let s = self else {
return
}
......
......@@ -135,18 +135,18 @@ open class ContentCard: PulseView {
if let v = titleBar {
views["titleBar"] = v
format += "[titleBar]"
_ = layout(v).horizontally()
layout(v).horizontally()
}
views["contentView"] = contentView
format += "[contentView]"
_ = layout(contentView).horizontally()
layout(contentView).horizontally()
contentView.layoutIfNeeded()
if let v = bottomBar {
views["bottomBar"] = v
format += "[bottomBar]"
_ = layout(v).horizontally()
layout(v).horizontally()
}
addConstraints(Layout.constraint(format: "\(format)|", options: [], metrics: nil, views: views))
......
......@@ -394,9 +394,9 @@ open class ImageCard: PulseView {
verticalFormat += "-[titleLabel]"
views["titleLabel"] = v
} else {
_ = layout(v).top(contentInset.top + titleLabelInset.top)
layout(v).top(contentInset.top + titleLabelInset.top)
}
_ = layout(v).horizontally(left: contentInset.left + titleLabelInset.left, right: contentInset.right + titleLabelInset.right)
layout(v).horizontally(left: contentInset.left + titleLabelInset.left, right: contentInset.right + titleLabelInset.right)
}
// detail
......@@ -411,7 +411,7 @@ open class ImageCard: PulseView {
verticalFormat += "-[contentView]"
views["contentView"] = v
_ = layout(v).horizontally(left: contentInset.left + contentViewInset.left, right: contentInset.right + contentViewInset.right)
layout(v).horizontally(left: contentInset.left + contentViewInset.left, right: contentInset.right + contentViewInset.right)
}
// leftButtons
......@@ -432,7 +432,7 @@ open class ImageCard: PulseView {
h += "[\(k)]"
_ = layout(b).bottom(contentInset.bottom + leftButtonsInset.bottom)
layout(b).bottom(contentInset.bottom + leftButtonsInset.bottom)
i += 1
}
......@@ -459,7 +459,7 @@ open class ImageCard: PulseView {
h += "-(right_left)-"
}
_ = layout(b).bottom(contentInset.bottom + rightButtonsInset.bottom)
layout(b).bottom(contentInset.bottom + rightButtonsInset.bottom)
i -= 1
}
......
......@@ -102,7 +102,7 @@ internal extension Animation {
default:break
}
_ = Animation.delay(time: duration) {
Animation.delay(time: duration) {
bLayer.setValue(true, forKey: "animated")
}
}
......@@ -122,7 +122,7 @@ internal extension Animation {
return
}
_ = Animation.delay(time: animated ? 0 : 0.15) {
Animation.delay(time: animated ? 0 : 0.15) {
guard let pLayer = bLayer.sublayers?.first as? CAShapeLayer else {
return
}
......@@ -144,7 +144,7 @@ internal extension Animation {
default:break
}
_ = Animation.delay(time: duration) {
Animation.delay(time: duration) {
pLayer.removeFromSuperlayer()
bLayer.removeFromSuperlayer()
}
......
......@@ -53,7 +53,7 @@ open class PulseView: View {
open func pulse(point: CGPoint? = nil) {
let p: CGPoint = nil == point ? CGPoint(x: CGFloat(width / 2), y: CGFloat(height / 2)) : point!
Animation.pulseExpandAnimation(layer: layer, visualLayer: visualLayer, pulseColor: pulseColor, pulseOpacity: pulseOpacity, point: p, width: width, height: height, pulseLayers: &pulseLayers, pulseAnimation: pulseAnimation)
_ = Animation.delay(time: 0.35) { [weak self] in
Animation.delay(time: 0.35) { [weak self] in
guard let s = self else {
return
}
......
......@@ -102,7 +102,7 @@ open class SnackbarController: RootController {
Animates to a SnackbarStatus.
- Parameter status: A SnackbarStatus enum value.
*/
open func animate(snackbar status: SnackbarStatus, delay: TimeInterval = 0, animations: ((Snackbar) -> Void)? = nil, completion: ((Snackbar) -> Void)? = nil) -> AnimationDelayCancelBlock {
open func animate(snackbar status: SnackbarStatus, delay: TimeInterval = 0, animations: ((Snackbar) -> Void)? = nil, completion: ((Snackbar) -> Void)? = nil) -> AnimationDelayCancelBlock? {
return Animation.delay(time: delay) { [weak self, status = status, animations = animations, completion = completion] in
guard let s = self else {
return
......
......@@ -79,6 +79,6 @@ open class StatusBarController: RootController {
private func prepareStatusBarView() {
statusBarView.zPosition = 3000
statusBarView.backgroundColor = Color.black.withAlphaComponent(0.12)
_ = view.layout(statusBarView).top(0).horizontally().height(20)
view.layout(statusBarView).top(0).horizontally().height(20)
}
}
......@@ -101,7 +101,7 @@ open class TableViewCell: UITableViewCell {
open func pulse(point: CGPoint? = nil) {
let p: CGPoint = nil == point ? CGPoint(x: CGFloat(width / 2), y: CGFloat(height / 2)) : point!
Animation.pulseExpandAnimation(layer: layer, visualLayer: visualLayer, pulseColor: pulseColor, pulseOpacity: pulseOpacity, point: p, width: width, height: height, pulseLayers: &pulseLayers, pulseAnimation: pulseAnimation)
_ = Animation.delay(time: 0.35) { [weak self] in
Animation.delay(time: 0.35) { [weak self] in
guard let s = self else {
return
}
......
......@@ -161,11 +161,11 @@ public class TextView: UITextView {
internal func reloadView() {
if let p = placeholderLabel {
removeConstraints(constraints)
_ = layout(p).edges(
top: textContainerInset.top,
left: textContainerInset.left + textContainer.lineFragmentPadding,
bottom: textContainerInset.bottom,
right: textContainerInset.right + textContainer.lineFragmentPadding)
layout(p).edges(
top: textContainerInset.top,
left: textContainerInset.left + textContainer.lineFragmentPadding,
bottom: textContainerInset.bottom,
right: textContainerInset.right + textContainer.lineFragmentPadding)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment