Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline ignore macros #88

Closed
mfclarke opened this issue Jul 31, 2015 · 1 comment
Closed

Inline ignore macros #88

mfclarke opened this issue Jul 31, 2015 · 1 comment

Comments

@mfclarke
Copy link

Say you have a UICollectionViewController, with the following method:

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCellWithReuseIdentifier("someidentifier", forIndexPath: indexPath) as! UICollectionViewCell
    return cell
}

SwiftLint complains about the force casting from AnyObject returned by collectionView.dequeueReusableCellWithReuseIdentifier to UICollectionViewCell, but there's really no other way. The SDK requires you to use this method to fetch a cell to return, and you have to return a UICollectionViewCell.

Is there something I can wrap these sorts of exceptions in, similar to Clang's #pragma's maybe, so SwiftLint ignores them?

@jpsim
Copy link
Collaborator

jpsim commented Jul 31, 2015

We'd love to add that functionality! We're currently tracking this as #4, so I'll be closing this issue as a duplicate, but please feel free to continue the conversation there!

@jpsim jpsim closed this as completed Jul 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants