Giter VIP home page Giter VIP logo

bsgridcollectionviewlayout's People

Stargazers

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

Watchers

 avatar

bsgridcollectionviewlayout's Issues

Crash due to invalid range parameters in indexPathsInRect

Hello! Thanks for creating this pod and the BSImagePicker pod!

Our project recently encountered a crashing issue in the following scenario:

  • Using BSImagePicker, scroll to the end of a very large camera roll
  • Switch to a much smaller album from the album list
  • Crash with fatal error: Can't form Range with end < start in indexPathsInRect:

Values at crash:

rect    CGRect  (origin = (x = 0, y = 62480), size = (width = 320, height = 1136))  
self    BSGridCollectionViewLayout.GridCollectionViewLayout 0x000000012f8af4e0
rowHeight   CGFloat 107.33333333333333  
startRow    Int 582
endRow  Int 4
startIndex  Int 1746
endIndex    Int 13
indexPaths  [NSIndexPath]   
rows 5

Our project is resolving this for now in a private fork by adding this guard function for invalid values, right before attempting to create the range of indices:
guard startIndex <= endIndex else { return [] }

support for headers and footers

Hi,

i'm struggling a bit with being able to show a footer and a header for the different sections. Is it even possible? If I add a

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {

to my UICollectionViewController it never gets called.

Any suggestions?

Xcode 11 compilation error because of plist inclusion to compilation sources

It seems Xcode 11 beta 6 complains about including plist into the compile sources build phase. I guess we can just remove it from the compile sources list

EDIT: Just tried to remove plist from compile sources to make sure that was the problem, and it works. I will do a pull request with the fix

1) Target 'BSGridCollectionViewLayout' (project 'Pods') has copy command from '/ios-app/Pods/BSGridCollectionViewLayout/Sources/InfoSource.plist' to '/Library/Developer/Xcode/DerivedData/IOSAPP-hhwqkvqhhakfhgbegnyfmpxvohva/Build/Products/Beta_debug-iphonesimulator/BSGridCollectionViewLayout/BSGridCollectionViewLayout.framework/InfoSource.plist'

Support for Bitcode

Describe the bug
Build with Enable Bitcode failed. Related to https://github.com/Sh1d0w/multi_image_picker/issues/368

To Reproduce

  1. Using multi_image_picker for flutter project.
  2. Build release with bitcode enabled.

Expected behavior
The library support bitcode.

Error Log

ld: '/Users/alex/SomeFlutterProject/build/ios/Release-iphoneos/BSGridCollectionViewLayout/BSGridCollectionViewLayout.framework/BSGridCollectionViewLayout' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/alex/SomeFlutterProject/build/ios/Release-iphoneos/BSGridCollectionViewLayout/BSGridCollectionViewLayout.framework/BSGridCollectionViewLayout' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Extra Info

Idk why we have to talk like this, developers should done this to each other? BAN someone from new issue? It's just a technical question, you can just say whether it will support or not, instead of closing it without any info provided, that's not open source sharing works like. The kind of attitude will make developers NEVER use the package again.

Occured error on flutter project

the Error is as following:

Launching lib/main.dart on Lemon' iPhoneXr in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: SB2AYBD9S3
Running Xcode build...
Xcode build done.                                           91.8s
Failed to build iOS app
Error output from Xcode build:
↳
    2020-04-24 14:07:01.773 xcodebuild[24720:4378833]  DTDeviceKit: deviceType from 00008020-001C2CE834C2002E was NULL
    2020-04-24 14:07:01.930 xcodebuild[24720:4378953]  DTDeviceKit: deviceType from 00008020-001C2CE834C2002E was NULL
    ** BUILD FAILED **


Xcode's output:
↳
    Non-fat binary /Users/mac/Desktop/aic_flutter/build/ios/Debug-iphoneos/Runner.app/Frameworks/BSGridCollectionViewLayout.framework/BSGridCollectionViewLayout is not armv7. Running lipo -info:
    Non-fat file: /Users/mac/Desktop/aic_flutter/build/ios/Debug-iphoneos/Runner.app/Frameworks/BSGridCollectionViewLayout.framework/BSGridCollectionViewLayout is architecture: arm64
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Error launching application on Lemon' iPhoneXr.

My other flutter projects run well on this iPhoneXr.

Error with latest commit.

The latest commit has seemed to introduce an off by one error in GridCollectionViewLayout.swift.

When I build my project, xcode throws "fatal error: Can't form Range with end < start.

This seems to be originating from line 150 in the file,
let indexPaths = (startIndex...endIndex).map { indexPathFromFlatIndex($0) }

My guess is because endIndex is assigned in line 148,
let endIndex = (endRow * itemsPerRow + itemsPerRow > items) ? items-1 : endRow * itemsPerRow,
it is mistakenly set to -1.

I fixed this in my project by replacing this portion of the code with the previously used for loop and thought you might want to look into this.

Compiler errors

Hi, I am using version 1.2.0 with BSImagePicker version 2.5.0 (Installed with Cocoapods) and I get a number of compiler errors - my swift is not good enough to resolve them. Below is a sample of the errors I am receiving (the rest are mostly duplicates of the below)

GridCollectionViewLayout.swift:130:102: error: use of undeclared type 'IndexPath'
    public override func layoutAttributesForDecorationView(ofKind elementKind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {

GridCollectionViewLayout.swift:77:25: error: property does not override any property from its superclass
    public override var collectionViewContentSize: CGSize {

GridCollectionViewLayout.swift:77:59: error: getter for 'collectionViewContentSize' with Objective-C selector 'collectionViewContentSize' conflicts with method 'collectionViewContentSize()' from superclass 'UICollectionViewLayout' with the same Objective-C selector
    public override var collectionViewContentSize: CGSize {

I am using Swift 2.3 (Required, due to another dependency)

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.