Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
VladK9 committed Nov 27, 2023
1 parent 227df86 commit 05ede47
Show file tree
Hide file tree
Showing 17 changed files with 1,209 additions and 608 deletions.
418 changes: 301 additions & 117 deletions Sources/UIFloatMenu.swift

Large diffs are not rendered by default.

140 changes: 71 additions & 69 deletions Sources/UIFloatMenuAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,75 @@

import UIKit

//MARK: - selectionConfig
public enum selectionConfig {
case multi(isSelected: Bool = false, selectedIcon: UIImage?, selectedTitle: String, defaultIcon: UIImage?, defaultTitle: String)
case `default`(icon: UIImage? = nil, title: String)
}

//MARK: - transition_style
public enum transition_style {
case `default`(animated: Bool = true)
case fade
}

//MARK: - h_heightStyle
public enum h_heightStyle {
case compact
case standard
}

//MARK: - h_cellLayout
public enum h_cellLayout {
case Icon_Title
case center
case Title_Icon
}

//MARK: - heightStyle
public enum heightStyle {
case compact
case standard
case big
}
//MARK: - itemSetup
public enum itemSetup {

//MARK: - selectionConfig
public enum selectionConfig {
case multi(isSelected: Bool = false, selectedIcon: UIImage?, selectedTitle: String, defaultIcon: UIImage?, defaultTitle: String)
case `default`(icon: UIImage? = nil, title: String)
}

//MARK: - labelConfig
public enum labelConfig {
case config(fontSize: CGFloat = 15, fontWeight: UIFont.Weight = .semibold)
}
//MARK: - transition_style
public enum transition_style {
case `default`(animated: Bool = true)
case fade
}

//MARK: - itemColor
public enum itemColor {
case standard
case clear
case filled(_ color: UIColor)
case tinted(_ color: UIColor)
case custom(iconColor: UIColor = .clear, textColor: UIColor, backColor: UIColor)
}
//MARK: - h_heightStyle
public enum h_heightStyle {
case compact
case `default`
}

//MARK: - cellLayout
public enum cellLayout {
case Icon_Title
case Title_Icon
}
//MARK: - h_cellLayout
public enum h_cellLayout {
case Icon_Title
case center
case Title_Icon
}

//MARK: - spacerType
public enum spacerType {
case empty
case line(_ color: UIColor = UIColor.gray.withAlphaComponent(0.25), inset: CGFloat = 15)
case dashedLine(_ color: UIColor = UIColor.gray.withAlphaComponent(0.35))
case divider
}
//MARK: - heightStyle
public enum heightStyle {
case compact
case `default`
case big
}

//MARK: - inputType
public enum inputType {
case textField(text: String = "", isSecure: Bool = false, content: UITextContentType? = nil, keyboard: UIKeyboardType = .default)
case textView(text: String = "", content: UITextContentType? = nil, keyboard: UIKeyboardType = .default)
}

//MARK: - labelConfig
public enum labelConfig {
case config(fontSize: CGFloat = 15, fontWeight: UIFont.Weight = .semibold)
}

//MARK: - itemColor
public enum itemColor {
case `default`
case clear
case filled(_ color: UIColor)
case tinted(_ color: UIColor)
case custom(iconColor: UIColor = .clear, textColor: UIColor, backColor: UIColor)
}

//MARK: - itemSetup
public enum itemSetup {
//MARK: - cellLayout
public enum cellLayout {
case Icon_Title
case Title_Icon
}

//MARK: - spacerType
public enum spacerType {
case empty(height: CGFloat = 12)
case line(_ color: UIColor = UIColor.gray.withAlphaComponent(0.25), inset: CGFloat = 15)
case dashedLine(_ color: UIColor = UIColor.gray.withAlphaComponent(0.35))
case divider
}

/**
UIFloatMenu: ActionCell

Expand All @@ -77,8 +82,8 @@ public enum itemSetup {
- Parameter layout: Loyout of cell (**.Title_Icon**, **.Icon_Title**), Default: **.Title_Icon**.
- Parameter height: Height of cell (**.standard**, **.compact**), Default: **.standard**.
*/
case ActionCell(selection: selectionConfig, subtitle: String = "", itemColor: itemColor = .standard,
layout: cellLayout = .Icon_Title, height: heightStyle = .standard)
case ActionCell(selection: selectionConfig, subtitle: String = "", itemColor: itemColor = .default,
layout: cellLayout = .Icon_Title, height: heightStyle = .default)

/**
UIFloatMenu: Title
Expand All @@ -92,7 +97,7 @@ public enum itemSetup {

- Parameter type: Type of spacer (**.empty**, **.line**, **.divider**)
*/
case Spacer(type: spacerType = .empty)
case Spacer(type: spacerType = .empty())

/**
UIFloatMenu: InfoCell
Expand All @@ -105,17 +110,14 @@ public enum itemSetup {
label: labelConfig = .config(fontSize: 15, fontWeight: .semibold))

/**
UIFloatMenu: TextFieldCell
UIFloatMenu: InputCell

- Parameter title: Data in TextField at start
- Parameter type: **.textField()** or **.textView()**
- Parameter placeholder: Placeholder
- Parameter isResponder: Is active at start
- Parameter isSecure: Show dots
- Parameter content: UITextContentType
- Parameter keyboard: UIKeyboardType
- Parameter identifier: Identifier to search data in **UIFloatMenuGetInputData** delegate
*/
case TextFieldCell(title: String = "", placeholder: String, isResponder: Bool = false,
isSecure: Bool = false, content: UITextContentType? = nil, keyboard: UIKeyboardType = .default, identifier: String = "")
case InputCell(type: inputType, placeholder: String, isResponder: Bool = false, identifier: String = "")

/**
UIFloatMenu: SwitchCell
Expand All @@ -141,11 +143,11 @@ public enum itemSetup {
/**
UIFloatMenu: HorizontalCell

- Parameter items: actions [UIFloatMenuAction]
- Parameter items: actions **[UIFloatMenuAction]**
- Parameter height: h_heightStyle
- Parameter layout: h_cellLayout
*/
case HorizontalCell(items: [UIFloatMenuAction], height: h_heightStyle = .standard, layout: h_cellLayout = .center)
case HorizontalCell(items: [UIFloatMenuAction], height: h_heightStyle = .default, layout: h_cellLayout = .center)

/**
UIFloatMenu: CustomCell
Expand Down
96 changes: 0 additions & 96 deletions Sources/UIFloatMenuAnimation.swift

This file was deleted.

Loading

0 comments on commit 05ede47

Please sign in to comment.