Skip to content
 
 

Repository files navigation

FWPopupView

FWPopupView is a customizable popup library for iOS. It provides alert, sheet, date picker, menu, custom sheet, and radio button components.

Requirements

  • iOS 12 or later
  • Swift 5
  • Xcode 14 or later

Installation

Swift Package Manager

Add the package in Xcode using the following repository URL:

https://github.com/MosaviOrg/FWPopupView.git

Select the FWPopupView product for your app target.

To use the package from a manifest:

.package(url: "https://github.com/MosaviOrg/FWPopupView.git", branch: "master")

For local development:

.package(path: "../FWPopupView")

SnapKit is resolved automatically as a package dependency.

CocoaPods

use_frameworks!
pod "FWPopupView", "~> 4.2"

Usage

Alert

import FWPopupView

let alert = FWAlertView.alert(
    title: "Title",
    detail: "Message"
) { _, _, _ in
    print("Confirmed")
}

alert.show()

Sheet

let sheet = FWSheetView.sheet(
    title: "Options",
    itemTitles: ["First", "Second"],
    itemBlock: { _, index, title in
        print("Selected: \(index), \(title ?? "")")
    },
    cancenlBlock: {
        print("Cancelled")
    }
)

sheet.show()

Date Picker

let datePicker = FWDateView.date { picker in
    print(picker.date)
}

datePicker.show()

Menu

let menu = FWMenuView.menu(itemTitles: ["Edit", "Delete"]) { _, index, title in
    print("Selected: \(index), \(title ?? "")")
}

menu.show()

License

FWPopupView is available under the MIT license.

About

弹窗控件:支持AlertView、Sheet、自定义视图的PopupView。AlertView中可以嵌套自定义视图,各组件的显示隐藏可配置;Sheet仿微信样式;同时提供自定义弹出。更多配置请参考”可设置参数“,提供OC使用Demo。

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages