| | |
| | | } |
| | | |
| | | func scrollViewDidScroll(_ scrollView: UIScrollView) { |
| | | |
| | | |
| | | let totalHeight = adapterViewController.headHeight |
| | | let offset = totalHeight - scrollView.contentOffset.y |
| | | let isTop = (offset - topSafeHeight) < 0 |
| | | |
| | | if scrollView.contentOffset.y > 0 && !isTop{ |
| | | adapterViewController.scrollview.contentOffset = scrollView.contentOffset |
| | | } |
| | | let totalHeight = adapterViewController?.headHeight ?? 0 |
| | | let offset = totalHeight - scrollView.contentOffset.y |
| | | let isTop = (offset - topSafeHeight) < 0 |
| | | if scrollView.contentOffset.y >= 0 { |
| | | if isTop{ |
| | | adapterViewController?.scrollview.contentOffset = CGPoint(x: 0, y: totalHeight - topSafeHeight) |
| | | }else if scrollView.contentOffset.y <= 0{ |
| | | adapterViewController?.scrollview.setContentOffset(.zero, animated: true) |
| | | }else{ |
| | | adapterViewController?.scrollview.contentOffset = scrollView.contentOffset |
| | | } |
| | | } |
| | | } |
| | | |
| | | @IBAction func addNoteAction(_ sender: UIButton) { |
| | |
| | | self?.refreshStatus.onNext(.beingHeaderRefresh) |
| | | alert(msg: "Add note successed") |
| | | }else{ |
| | | alert(msg: data.msg) |
| | | alert(msg: data.message) |
| | | } |
| | | }) { error in |
| | | alert(msg: error.localizedDescription) |