wangmchn / wmpagecontroller-swift Goto Github PK
View Code? Open in Web Editor NEWAn easy solution to page controllers like NetEase News.(Swift Implementation)
License: MIT License
An easy solution to page controllers like NetEase News.(Swift Implementation)
License: MIT License
您好!麻烦适配一下swift5.3,谢谢
1/ I don't understand why we need "animation" private property? It does not contain any information after user dragged manually content (this property is not resetted anywhere).
2/ How I can programmatically drag content? If I set contentOffset for contentView, then I see next: if user dragged content already, then it works, but if user did not drag yet, then it does not work. It happens because "animation" property is false
请问, 怎么能像斗鱼iOS首页一样的效果, 导航栏和标签栏都能透过内容?
public func selectItemAtIndex(index: Int) {
let tag = index + tagGap
let currentIndex = selectedItem.tag - tagGap //this line exit break
guard currentIndex != index && selectedItem != nil else { return }
let menuItem = viewWithTag(tag) as! MenuItem
selectedItem.selected = false
selectedItem = menuItem
selectedItem.selected = true
progressView?.moveToPosition(index, animation: false)
delegate?.menuView?(self, didSelectedIndex: index, fromIndex: currentIndex)
refreshContentOffset()
}
首先非常感谢贡献这么好用的library!
在使用的过程中发现一个必现的crash:从PageController
pop back时会crash:fatal error: unexpectedly found nil while unwrapping an Optional value
,不确定是不是我使用上有什么疏漏,我用的是Storyboard。
具体出错代码是在MenuView.swift line 214:let itemWidth = delegate!.menuView(self, widthForItemAtIndex: index)
hi, wangmchn. It shows a warning msg like issues title when run carthage update. In the end, Xcode can't build successfully and show an error : "No such module 'WMPageControllerSwift'".
environment: Swift, Xcode 7.3.1, Carthage
I am using WMPageController
in storyboard. I have a customized UITableViewController
with prototype cells, it works well when stand alone. But when embedded it into WMPageController
, a crash happens. The error message is:Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier VoucherListCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
.
Could you please to help find out what is going wrong? Thanks a lot.
新项目准备使用swift,WMPageController-Swift有空可以升级到swift4.2吗,Thank you.
使用uitableivew添加向右滑动删除的功能,不能使用,能添加上吗
hi, @wangmchn , my app crashed when I run it in iOS10 phone, it gets an error that fatal error: unexpectedly found nil while unwrapping an Optional value
, this error perhaps caused by func: adjustMenuViewFrame
, iOS 10 does not has this class : NSClassFromString("_UINavigationBarBackground")
?, I have tried to fix it and it works by below codes:
for subview in (navigationController?.navigationBar.subviews)! {
// add a guard to filter that missing class: _UINavigationBarBackground
guard let _ = NSClassFromString("_UINavigationBarBackground") else {
continue
}
guard !subview.isKindOfClass(NSClassFromString("_UINavigationBarBackground")!) && !subview.isKindOfClass(MenuView.self) && (subview.alpha != 0) && (subview.hidden == false) else { continue }
let maxX = CGRectGetMaxX(subview.frame)
if maxX < viewWidth / 2 {
let leftWidth = maxX
menuX = menuX > leftWidth ? menuX : leftWidth
}
let minX = CGRectGetMinX(subview.frame)
if minX > viewWidth / 2 {
let width = viewWidth - minX
rightWidth = rightWidth > width ? rightWidth : width
}
}
I don't know whether it will cause other bug, or maybe it not the correct way to avoid the crash.
Environment: Xcode8, Swift2.3, iOS 10
thanks.
When embedded WMPageController
into UINavigationBarController
or UITabBarController
, the color of navigation bar/tab bar change to a little bit transparent and dark. The Objective-C version has the same issue, I tested with the demo code.
Still I am using storyboard, if it may be a cause.
cocoaPod上面 上传的版本过低。目前只有pod 'WMPageController-Swift', '~> 1.4.0'
能提交最新版本吗?
support swift4.0?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.