Wallpaper_Home/wallpaper_project/Pods/GYSide/Classes/GYSideConfig.swift
2024-04-17 14:37:20 +08:00

71 lines
1.9 KiB
Swift

//
// GYSideConfig.swift
// GYSide
//
// Created by gaoyuan on 2018/1/29.
// Copyright © 2018 gaoyuan. All rights reserved.
//
import UIKit
public enum GYSideAnimationType:Int {
case zoom //
case translationPush //
case translationMask //
}
public enum GYSideDirection:Int {
case left //
case right //
}
public class GYSideConfig {
/// 0.3
public var timeInterval: TimeInterval! = 0.3
/// 0.5
public var maskAlpha: CGFloat! = 0.5
/// 0.0 ~ 1.0 0.7
public var sideRelative: CGFloat! = 0.7 {
didSet {
if sideRelative>1.0 {sideRelative = 1.0}
if sideRelative<0.0 {sideRelative = 0.0}
if animationType == .zoom {sideRelative = 1.0}
}
}
/// 0.0 ~ 1.0 0.7
public var zoomRelative: CGFloat! = 0.7 {
didSet {
if zoomRelative>1.0 {zoomRelative = 1.0}
if zoomRelative<0.0 {zoomRelative = 0.0}
}
}
/// view 0.0 ~ 1.0 0.5
public var zoomOffsetRelative: CGFloat! = 0.5 {
didSet {
if zoomOffsetRelative>1.0 {zoomOffsetRelative = 1.0}
if zoomOffsetRelative<0.0 {zoomOffsetRelative = 0.0}
}
}
///
public var direction:GYSideDirection! = .left
///
public var animationType:GYSideAnimationType! = .translationPush {
didSet {
if animationType == .zoom {sideRelative = 1.0}
}
}
deinit {
// print( NSStringFromClass(self.classForCoder) + " ---->1")
}
}