Giter Club home page Giter Club logo

mytableviewindex's People

Contributors

dgarkusha avatar hipwelljo avatar hongxinhope avatar markj avatar mattbarker016 avatar mindz-eye avatar nemesisprime avatar tmergulhao 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  avatar

mytableviewindex's Issues

Xcode 10, Swift 4.3 support required

I am using this library and it's working great. But it's yet not build with Swift 4.3 as it's required for Xcode 10 now. Please add support for Swift 4.3 so that we can continue using it.

Manual Installation

CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

Pin TableViewIndex to Specific Sections

It would be nice to have the built in feature described in the title. This is how I did it in the meantime, and here was the result.
Result - TableViewIndex pinned to 3rd section
pinnedindexbar

 func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let contentOffsetY = scrollView.contentOffset.y
        if scrollView == tableView && searchBar.text == "" {
            if let visibleRows = tableView.indexPathsForVisibleRows {
                let visibleSections = visibleRows.map({$0.section})
                if let allStopsIndex = sections.index(where: {$0.type == SectionType.AllStops}), let firstAllStopCellIndexPath = visibleRows.filter({$0.section == allStopsIndex && $0.row == 1}).first {
                    let secondCell = tableView.cellForRow(at: firstAllStopCellIndexPath)
                    let newYPosition = view.convert(tableViewIndexController.tableViewIndex.indexRect(), from: tableView).minY
                    if ((newYPosition * -1.0) < (secondCell?.frame.minY)! - view.bounds.midY) {
                        let offset = (secondCell?.frame.minY)! - initialTableViewIndexMidY - contentOffsetY
                        tableViewIndexController.tableViewIndex.indexOffset = .init(horizontal: 0.0, vertical: offset)
                        tableViewIndexController.setHidden(!visibleSections.contains(allStopsIndex), animated: true)
                    }
                }
            }
        }
    } 

iOS 13: UITableView in modal presentation conflicts with dismiss gesture

Here is a new one coming with iOS 13 - when a UITableView is being presented as a modal, the index can't be dragged because it causes rubber banding as that modal's dismissal takes priority.

Just starting to digging into this, but it looks like there's going to need to be some sort of callback to hook into to disable that gesture recognizer during MYTVI touches (see: https://stackoverflow.com/questions/56718552/disable-gesture-to-pull-down-form-page-sheet-modal-presentation).

Labels sometimes disappear

I'm seeing an issue where the labels sometimes disappear, have you seen that before?

It occurs for me in a few different scenarios, like when I bring up the keyboard on iPad in portrait (which doesn't cause the truncation to occur because they all fit on screen) then rotate to landscape (where not all fit on screen so it has to truncate). A lot of the labels disappear, but their frame is preserved so there's space for each but they're not all visible. When I then dismiss the keyboard it expands out to show all but a few labels are not visible. What's interesting is the View Debugger shows the missing labels don't exist as subviews, they're not there at all.

I've been trying to debug it but haven't been able to figure out why this is occurring. It seems to be an issue when the height changes, it calls layoutSubviews in the index view a few times with different heights, but the last one is always correct, yet it ends up not properly creating all the subviews it seems. Or maybe a race condition removing and re-adding? I'm not sure. Hoping you might know where the problem may lie.

img_0336 img_0337 img_0338

Accessibility Support

This is a fantastic implementation, thank you! I'd like to request it be just as fantastic for users who rely on accessibility features like VoiceOver. It would ideally behave the exact same as it does for the native table index. This will ensure it can be intuitively used by all users!

I'll work on a pull request for this. ๐Ÿ˜Š

Add support for left TableViewIndex

The TableViewIndex is always displayed on the Right side of the tableView.
Since I have Arabic text inside table view which has text from right to left it is so I need the TableViewIndex on the left side

Take less horizontal space

This is a bit of a nit pick but in my case it had serious implications. In order to tap outside of the section index to hit a table view row, you have to tap pretty far to the left. You can compare this to the native Contacts app to see the difference. For example, it interferes with the X in the screen shotted view. I tried to handle this through the indexInset property but that did not work.
img_4799

Touches moves not detected

Hi and thank you for the great job on that library,

I'm having an issue with what should be a default behavior of the index:

When I tap an item, tableViewIndex(tableViewIndex, didSelectItem, atIndex) is called, but not if I swipe through the index bar. It seems like touchesBegan is called, but not touchesMoved.

Most of my code is copied from the demo example which works perfectly fine, so I don't really know where to investigate.

Do you by any chance have an idea of what causes the issue?

Let me know if you need more info

Thanks!

Manual installation issue

On manual installation, XCode throws error: "Redeclaration of BackgroundView class"
As it is declared in Examples.swift and also a separate file named BackgroundView.swift having BackgroundView

Some public var-s of TableViewIndex not visible from Objective-C

Hi,

Thanks for the nice library!

I would like to report one small issue that I found while integrating the lib into an Objective-C project.
The problem is that indexInset, indexOffset and itemSpacing var-s are missing in auto-generated header and can not be accessed from Objective C. At the same time, when you edit library code and try to specify a different name for any of those properties via @objc(...), compiler starts showing "Property cannot be marked @objc because its type cannot be represented in Objective-C" error.

I made a small investigation and found that indexInset and indexOffset were visible correctly until 510e329. So, the problem appeared as soon as those struct-s became implicitly unwrapped optionals.
If I now simply change them back in a way that they wouldn't be optionals anymore, the problem disappears. If on your opinion this is ok (maybe there is a better solution...), I'll do a merge request.

Didselect on country name

Hi there,
I have implement your library in a project and i need click even of tableview cell where listed country name.
Can you please help from where i can find that.

Custom StringItem doesn't work

Hello, thanks for this framework!

I have a question when I used the example, the font increases well with standard indexes when I used his index, the font is not increased. How can I fix it?

 fileprivate func setupCustomSectionIndex() {
       let tableViewIndexController = TableViewIndexController(tableView: tableView)
       tableViewIndexController.tableViewIndex.dataSource = self
       tableViewIndexController.tableViewIndex.delegate = self
       tableViewIndexController.tableViewIndex.font = fontManager.lato(.Bold, size: 50)// 11.5
   }
   
   func indexItems(for tableViewIndex: TableViewIndex) -> [UIView] {
       return sortedContactKeys.map { title -> UIView in // this doesn't work
           let stringItem = StringItem(text: title)
           return stringItem
       }
   }

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.