Coder Social home page Coder Social logo

choiceyou / fwpopupview Goto Github PK

View Code? Open in Web Editor NEW
462.0 13.0 64.0 8.53 MB

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

License: MIT License

Swift 81.38% Ruby 2.46% C 0.04% Objective-C 16.13%
popup swift objective-c pod alertview sheet menu

fwpopupview's People

Contributors

choiceyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fwpopupview's Issues

originKeyWindow bug

这个属性在hide时 makeKey 会导致其他使用keyWindow属性显示不出来。

bug原因:
赋值windows.first 并不是keyWindow
在hide时又做了makeKey操作,导致在使用keyWindow属性时不能被显示。
此处赋值的时机是否应该放在吊起FWPopupSWindow时?
望改进。

attachview 相关

传入 attachview 弹窗试图本身的按钮响应全部失效 点击就dismiss了啊

关于 topCenter - frame

当为topCenter - frame 样式的时候,能否设置上下maskViewColor 不同呢,
我想要上面是透明颜色,下面有个遮罩颜色
Simulator Screen Shot - iPhone 8 Plus - 2019-11-05 at 19 09 12

继承FWPopupView的弹窗,在tableView编辑状态下进行tableViewCell移动时无效

`
import UIKit
class SNHomeMoreView: FWPopupView {
lazy var tableView : UITableView = {
let tableView = UITableView.init(frame: CGRect.zero, style: .plain)
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .white
tableView.isEditing = true
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "SNHomeMoreCell")
tableView.frame = CGRect.init(x: 0, y: 0, width: 300, height: 400)
return tableView
}()
var titles = ["a","b","c","d","e","f","g"]
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.white
let vProperty = FWPopupViewProperty()
vProperty.popupCustomAlignment = .topCenter
vProperty.popupAnimationType = .frame
vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
vProperty.touchWildToHide = "1"
vProperty.popupViewEdgeInsets = UIEdgeInsets(top: kTopH, left: 0, bottom: 0, right: 0)
vProperty.animationDuration = 0.5

    //vProperty.cornerRadius =
    self.vProperty = vProperty
    self.addSubview(tableView)
    tableView.reloadData()
}
required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

}
extension SNHomeMoreView : UITableViewDelegate,UITableViewDataSource{

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    return 44
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return titles.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "SNHomeMoreCell", for: indexPath)
    cell.selectionStyle = UITableViewCell.SelectionStyle.none
    cell.textLabel?.text = titles[indexPath.row]
   
    return cell
}
// 设置 cell 是否允许移动
func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
    return true
}
// 移动 cell 时触发
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
    print("\(sourceIndexPath.row) *** \(destinationIndexPath.row)")
    
    let source = titles[sourceIndexPath.row]
    let destination = titles[destinationIndexPath.row]
    titles[destinationIndexPath.row] = source
    titles[sourceIndexPath.row] = destination
    tableView.reloadData()
}

}

`

FWPopupWindow

pod 方式集成, FWPopupWindow下的touchWildToHide无法通过点语法设置

FWMenuView 在设置popupViewSize 及bottomCenter 显示错误

在您示例代码的 自定义菜单中
FWMenuView.menu 中 设置
property.popupCustomAlignment = .bottomCenter
property.popupViewSize = CGSize(width: UIScreen.main.bounds.width - 32, height: 200)
会导致,最终的menuView位置不正确
X轴会向左偏移 property.popupViewSize 我设置的一半 暂时解决办法增加 property.popupViewEdgeInsets 的left 值

一点点疑问,一点点建议

属性过多,似乎还有属性重叠,增加了复杂度

open class FWMenuViewProperty: FWPopupViewProperty
这继承关系感觉没啥必要,徒增复杂度和代码数量,且这两个class中属性设置重叠

iOS 13问题

  1. 暗色模式未�适配,输入框内容看不到

不兼容SnapKit

Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0: /Users/mac/Library/Developer/Xcode/DerivedData/TLZB-eafleshslmajwzhhtwkwjiuyjvjn/Build/Products/Debug-iphoneos/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/arm64.swiftmodule

底部横条

prefersHomeIndicatorAutoHidden,这个可能也需要适配下,老铁

FWAlertView.alert 键盘遮挡。

        let alertView = FWAlertView.alert(title: "标题", detail: "带输入框", inputPlaceholder: "请输入...", keyboardType: .default, isSecureTextEntry: false, customView: nil, items: items)

修改keyboardtype default键盘出现遮挡。 项目同样用到了IQKeyboardManagerSwift。

不好做暗黑适配

如果有个public 数组装有底部按钮,或者把一些控件暴露出来,这样我就好些分类处理暗黑适配的问题。

弹出菜单存在内存泄漏

我的代码中设置了attachedView.popupMenu.attachedView = self.view 从而导致了内存泄漏。
初步分析是attachedView持有self.view无法释放,建议attachedView设置为weak。

项目deployment iOS 10,pod 'FWPopupView'后,编译报错

Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0: /Users/relax/Library/Developer/Xcode/DerivedData/Honeybee-dscsjclqjfzwvfaxehqljaqkpwcf/Build/Products/TestDebug-iphoneos/SnapKit/SnapKit.swiftmodule/arm.swiftmodule

iPhone竖屏切到横屏时,菜单无法自动调整。

你好,版本3.0.6。用Swift语言在iPhone竖屏时创建一个topCenter居中的菜单FWMenuView。
弹出菜单显示后,将手机从竖屏旋转为横屏,底部遮罩层未做自动调整适应,导致显示位置发生偏移。

能否支持暗黑模式适配

目前你弹窗里面的按钮什么的都是一些临时变量。你能否使用一个数组装好所有空间,然后使用tag方式,让我可以获取那些控件,我需要做暗黑适配。或者你有更好方式,能做到,感谢大神

FWPopupView

在使用FWSheetView.sheet时有去替换UIWindow,隐藏时没有将原本的window换回来,导致后续在获取keyWindow的时候,获取到的Window Class不正确,往window上add控件无效

4.2.1 FWSheetView 存在内存泄漏

//        let itemClickedBlock: FWPopupItemClickedBlock = { (popupView, index, title) in
+        let itemClickedBlock: FWPopupItemClickedBlock = {[weak self] (popupView, index, title) in
+            guard let weakSelf = self else {
+                return
+            }
             if itemBlock != nil {
//               itemBlock!(self, index, title)
+                itemBlock!(weakSelf, index, title)
             }
         }

编译失败

FWPopupView使用其他版本报Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0,如果使用3.1.5版本报Cannot invoke initializer for type 'FWPopupWindow' with no arguments,怎么处理???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.