在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:kciter/Floaty开源软件地址:https://github.com/kciter/Floaty开源编程语言:Swift 98.2%开源软件介绍:FloatyFloaty is simple floating action button for iOS. (formerly KCFloatingActionButton)
PreviewRequirements
InstallationCocoaPodsuse_frameworks!
pod 'Floaty', '~> 4.2.0' Carthagegithub "kciter/Floaty" Swift Package ManagerOnce you have your Swift package set up, adding Floaty as a dependency is as easy as adding it to the dependencies value of your dependencies: [
.package(url: "https://github.com/kciter/Floaty.git", from: "4.2.1")
] ManuallyTo install manually the Floaty in an app, just drag the UsageStoryboard supportDependent on the UIWindow.Floaty.global.button.addItem(title: "Hello, World!")
Floaty.global.show() Dependent on the UIViewController.let floaty = Floaty()
floaty.addItem(title: "Hello, World!")
self.view.addSubview(floaty) Use iconlet floaty = Floaty()
floaty.addItem("Hello, World!", icon: UIImage(named: "icon")!)
self.view.addSubview(floaty) Use handlerSwiftlet floaty = Floaty()
floaty.addItem("I got a handler", icon: UIImage(named: "icon")!, handler: { item in
let alert = UIAlertController(title: "Hey", message: "I'm hungry...", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Me too", style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)
floaty.close()
})
self.view.addSubview(floaty) Use custom itemlet item = FloatyItem()
item.buttonColor = UIColor.blueColor()
item.title = "Custom item"
Floaty.global.button.addItem(item: item) RTL SupportYou can use the Floaty.global.rtlMode = true StickyYou can use the floaty.sticky = true // sticking to parent UIScrollView(also UITableView, UICollectionView)
scrollView.addSubview(floaty) Friendly TapYou can use the
With the default location of the frame, the button is now tappable until the right and rightbottom of the screen. This prevents tapping behind it by accident. Animation type
ToDo
DonateIf you like this open source, you can sponsor it. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论