Coder Social home page Coder Social logo

aupickercell's People

Contributors

azizuysal avatar lfarah avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

aupickercell's Issues

Assertion info

I've implemented it like the README says but it's giving me some assertion issues. I don't know if this is normal or not, I'm fairly new to cocoapods. When I would comment out the heightForRowAt it would not give me any assertion info. Is this something I need to fix or just keep it like this? Furthermore the pickers work as it should with no issues.

Full info:
[Assert] Attempted to call -cellForRowAtIndexPath: on the table view while it was in the process of updating its visible cells, which is not allowed. Make a symbolic breakpoint at UITableViewAlertForCellForRowAtIndexPathAccessDuringUpdate to catch this in the debugger and see what caused this to occur. Perhaps you are trying to ask the table view for a cell from inside a table view callback about a specific row? Table view: <UITableView: 0x14e818800; frame = (0 0; 375 812); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x280f51a40>; layer = <CALayer: 0x280103840>; contentOffset: {0, -88}; contentSize: {375, 325.33333333333337}; adjustedContentInset: {88, 0, 34, 0}; dataSource: <SkiMapMarker.AddTripsTVC: 0x14fe066b0>>

Code:

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        if let cell = tableView.cellForRow(at: indexPath) as? AUPickerCell {
            return cell.height
        }else if indexPath.section == 0 && indexPath.row == 1 {
            return 200
        }else{
            return super.tableView(tableView, heightForRowAt: indexPath)
        }
    }

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 if indexPath.section == 0 {
            if indexPath.row == 0{
                let cell = tableView.dequeueReusableCell(withIdentifier: "GebiedNaam", for: indexPath) as! GebiedNaam

                cell.gebiedNaamLabel.text = gebiedNaam

                return cell
            }else{
                let cell = tableView.dequeueReusableCell(withIdentifier: "GebiedKaart", for: indexPath) as! GebiedKaart

                cell.imageViewCell.image = kaartAfbeelding

                return cell
            }
        }else{
            if indexPath.row == 0{
                let cell = AUPickerCell(type: .date, reuseIdentifier: "DatumStartPicker")
                cell.datePickerMode = .date
                cell.leftLabel.text = "Start:"
                cell.dateStyle = .medium
                cell.timeStyle = .none
                cell.delegate = self

                return cell
            }else {
                let cell = AUPickerCell(type: .date, reuseIdentifier: "DatumEindePicker")
                cell.datePickerMode = .date
                cell.dateStyle = .medium
                cell.timeStyle = .none
                cell.leftLabel.text = "Einde:"
                cell.delegate = self


                return cell
            }
        }
    }

Delete the right label when the picker is closed

Unless the Picker is closed, the data contained in the right labels of the cells below are deleted.
Can you help me to resolve?

I changed this to the AUPickerCell.swift class to increase the height of the list when opening the picker:

public func selectedInTableView(_ tableView: UITableView) {
let unexpandedHeightList = CGFloat(Double(tableView.numberOfRows(inSection: 0)) * 29.5)
let expandedHeightList = unexpandedHeightList + picker.bounds.height
let heightList = !self.expanded ? expandedHeightList : unexpandedHeightList
print(heightList)
let expandedFrame = CGRect(x: tableView.frame.origin.x,
y: tableView.frame.origin.y,
width: tableView.bounds.width,
height: heightList)
print(expandedFrame.height)
if !expanded {
rightLabelTextColor = rightLabel.textColor
}
expanded = !expanded
UIView.transition(with: rightLabel, duration: 0.15, options: .transitionCrossDissolve , animations: { [unowned self] in
tableView.frame = expandedFrame
self.rightLabel.textColor = self.expanded ? self.tintColor : self.rightLabelTextColor
})
tableView.beginUpdates()
tableView.endUpdates()
}

example

Add GIF to README

It would be cool to add a gif showing the use of your library. You can use this as an example

Please fix this issue before we can approve your PR on AwesomeiOS

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.