Comments (10)
A note: if I extend a UITableViewCell, the problem occur and scrolling seems to fix this, but if I extend a UIView the problem does not appear, so something is in the UITableViewCell class extension that interfere the first time the section is attach.
from eureka.
So you mean this only appears when you subclass UITableViewCell? Are you doing that with your header view class (aka EKHeaderClass)? That should not subclass from UITableViewCell. Subclassing from UIView is correct
from eureka.
So you mean this only appears when you subclass UITableViewCell?
Yes I wanted to reuse a row class
Are you doing that with your header view class (aka EKHeaderClass)
Yes
Subclassing from UIView is correct
But the cell is visible initially and I see that it disappear when the row animation ends, and why scrolling shows it back?
Can I load a xib file and then assign the .contentview to the section.header? I wish to be clever and reuse the rows we have created for both rows and headers, in this way we have less classes to maintain.
from eureka.
Have you tried using UITableViewCell subclasses as headers of a UITableView without Eureka? I wouldn't be surprised if there is some added logic in UITableViewCell that is responsible for this.
What I would do in such a case is design a UIView with common design and use that inside both a row and a header, instead of trying to use a cell as header, but maybe it works
from eureka.
Yes, I did use subclassing the headers without having problems. At the moment I cannot put more time and money on this update to use a UIView custom class inside the headers, I wanted to re-use Eureka Custom Class (not the row) to be clever and have one class that does both things (header and regular row). But the point is that the this "glitch" occur only when the section is added, but when the header is off screen and then re enter the screen scrolling back the correct Y position, the cell is visible again; many people have this problem, is possible to track it someway?
from eureka.
Describe the bug I wish to re-use a custom class with a xib file in a section with some rows added dynamically, but when I use the following code
var section = Section() { section in section.tag = v var header = HeaderFooterView<EKHeaderClass>(.nibFile(name: "EKHeader", bundle: nil)) header.height = { 25 } header.onSetupView = { view, _ in view.titleLabel.text = "My title" view.subTitleLabel.isHidden = "My subtitle" } section.header = header } section.insert(contentsOf: [rowA, rowB], at: 0) form.insert(section, at: mealParts.count)
I see that the xib view and its class gets instantiated but it disappear immediately; if I keep adding more of the same to have a very long table/form and i start to scroll, the headers reappear without problems. On the contrary, if I use a simple view class, I have no problems and I see the header being attach and never disappear. Does anyone knows how to fix this?
Thanks 1k
Versions (please complete the following information):
- Device: iPhone 12
- OS: 15.0
- Eureka Version 5.4.0
- Xcode version 14.1
How is the behavior in this assignment (inside the onSetupView block):
view.subTitleLabel.isHidden = "My subtitle"
from eureka.
I created this ViewController, with the custom header subclassing UITableViewCell. I could not reproduced the issue.
import UIKit
import Eureka
class ViewController: FormViewController {
override func viewDidLoad() {
super.viewDidLoad()
for _ in 0...19 {
createSection()
}
}
private func createSection() {
var section = Section() { section in
var header = HeaderFooterView<EKHeaderClass>(.nibFile(name: "EKHeader", bundle: nil))
header.height = { 25 }
header.onSetupView = { view, _ in
view.titleLabel.text = "My title"
}
section.header = header
}
let rowA = LabelRow() {
$0.title = "Row A!!!"
}
let rowB = LabelRow() {
$0.title = "Row B!!!"
}
section.insert(contentsOf: [rowA, rowB], at: 0)
form.insert(section, at: 0)
}
}
class EKHeaderClass: UITableViewCell {
@IBOutlet var titleLabel: UILabel!
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
Versions:
Device: iPhone 14 Pro
iOS: 16.1 (20B72)
Eureka Version 5.4.0
Xcode version 14.1 (14B47b)
from eureka.
How is the behavior in this assignment (inside the onSetupView block):
view.subTitleLabel.isHidden = "My subtitle"
I have a stackview vertical and when there is only the title I hide the subtitle
from eureka.
Ok, so is possible to use a custom tableviewcell instead of a view, good to know.
from eureka.
Ok, I was testing it and I found out that if I delay the creation of the sections with the custom header form a nib, it does not works.
Please add this to your code:
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
for _ in 0...19 {
self.createSection()
}
}
from eureka.
Related Issues (20)
- How to set the position and size of the form HOT 2
- What is the difference between cellUpdate and cellSetup? HOT 1
- TimePickerRow is undeletable in MultivaluedSection HOT 2
- The image of the minus button does not disappear in MultivaluedSection for MultivaluedOptions = [.Insert] HOT 2
- App Store Connect Operation Error: The app references non-public selectors HOT 11
- dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib HOT 2
- Extend cell with another cell
- SegmentedRow crash due to selectedSegmentIndex == -1 HOT 9
- Reordering sections and rows will return the same initial order and not the updated ones HOT 2
- custom Table Inline Row
- SwitchRow Not responding to second time from user interaction HOT 1
- M1 chip Computer + React Native 0.68 + Xcode 14.2 = Compiling Error HOT 1
- Enable BUILD_LIBRARY_FOR_DISTRIBUTION
- Any rule to validate special characters/ numbers in text field in a cell HOT 1
- Food
- How to turn off the capitalization of Section header tiitle? HOT 1
- Bug in iOS 17 Crash app HOT 1
- How to add multivalued .insert options without a multivalued section?
- Index Validation and Safer Collection Handling in Eureka
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eureka.