exyte/FloatingButton
소개
SwiftUI로 제작된, 쉽게 커스터마이즈할 수 있는 플로팅 버튼 메뉴입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- +2
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
FloatingButton
Easily customizable floating button menu created with SwiftUI
Usage
Create main button view and a number of submenu buttons — both should be cast to
AnyViewtype.Pass both to
FloatingButtonconstructor:FloatingButton(mainButtonView: mainButton, buttons: buttons)You may also pass a binding which will determine if the menu is currently open. You may use this to close the menu on any submenu button tap for example.
FloatingButton(mainButtonView: mainButton, buttons: buttons, isOpen: $isOpen)
- Chain
.straight()or.circle()to specify desired menu type. - Chain whatever you like afterwards. For example:
FloatingButton(mainButtonView: mainButton, buttons: textButtons) .straight() .direction(.top) .alignment(.left) .spacing(10) .initialOffset(x: -1000) .animation(.spring()) FloatingButton(mainButtonView: mainButton2, buttons: buttonsImage.dropLast()) .circle() .startAngle(3/2 * .pi) .endAngle(2 * .pi) .radius(70) .layoutDirection(.counterClockwise)
Universal options
spacing - space between submenu buttonsinitialScaling - size multiplyer for submenu buttons when the menu is closedinitialOffset - offset for submenu buttons when the menu is closedinitialOpacity - opacity for submenu buttons when the menu is closedanimation - custom SwiftUI animation like Animation.easeInOut() or Animation.spring()delays - delay for each submenu button's animation start
- you can pass array of delays - one for each element
- or you can pass delayDelta - then this same delay will be used for each element
mainZStackAlignment - main button and submenu buttons are contained in one ZStack (not an overlay so the menu has a correct size), you can change this ZStack's alignment with this parameter
inverseZIndex - inverse zIndex of mainButton and the children. Use, for example, if you have a negative spacing and want to change the order
wholeMenuSize - pass CGSize binding to get updates of menu's size. Menu's size includes main button frame and all of elements' frames
menuButtonsSize - pass CGSize binding to get updates of combined menu elements' size
Straight menu only options
direction - position of submenu buttons relative to main menu buttonalignment - alignment of submenu buttons relative to main menu button
Circle only options
startAngleendAngleradius - distance between center of main button and centers of submenu buttonslayoutDirection - changes the button layout direction from the startAngle to the endAngle
Examples
To try the FloatingButton examples:
- Clone the repo
https://github.com/exyte/FloatingButton.git - Open
FloatingButtonExample.xcodeprojin the Xcode - Try it!
Installation
Swift Package Manager
dependencies: [
.package(url: "https://github.com/exyte/FloatingButton.git")
]
Requirements
- iOS 14.0+ / macOS 11.0+ / watchOS 7.0+
- Xcode 12+
Our other open source SwiftUI libraries
LazyCustomLayout - A custom layout protocol for SwiftUI, powered by a lazy scroll view
PopupView - Toasts and popups library
AnchoredPopup - Anchored Popup grows "out" of a trigger view (similar to Hero animation)
Grid - The most powerful Grid container
ScalingHeaderScrollView - A scroll view with a sticky header which shrinks as you scroll
AnimatedTabBar - A tabbar with a number of preset animations
MediaPicker - Customizable media picker
Chat - Chat UI framework with fully customizable message cells, input view, and a built-in media picker
CalendarView - Calendar view with fully customizable month/day cells
OpenAI Wrapper lib for OpenAI REST API
AnimatedGradient - Animated linear gradient
ConcentricOnboarding - Animated onboarding flow
ActivityIndicatorView - A number of animated loading indicators
ProgressIndicatorView - A number of animated progress indicators
FlagAndCountryCode - Phone codes and flags for every country
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation
관련 프로젝트 살펴보기
불러오는 중…
