zepojo / UPCarouselFlowLayout

A fancy carousel flow layout for UICollectionView on iOS.
MIT License
1.66k stars 236 forks source link

iOS 7 and iOS 8 #2

Closed pjebs closed 8 years ago

pjebs commented 8 years ago

I noticed that it is supported by only iOS8.1+

What part of the code makes it not work with iOS 7?

appicus commented 8 years ago

If you set Deployment Target to 7.0 there is an issue with Alerts, but if you fix that it should be working fine.

pjebs commented 8 years ago

I did a search in UPCarouselFlowLayout.swift and don't see any mention of 'Alerts'?

appicus commented 8 years ago

You asked what part of code makes it not work with iOS 7.0 Look at ViewController.swift in Function:

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    let character = items[(indexPath as NSIndexPath).row]
    let alert = UIAlertController(title: character.name, message: nil, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
    present(alert, animated: true, completion: nil)
}

In iOS 7.0 you cannot use UIAlertController like this. You need to fix this in order to compile with deployment target 7.0

pjebs commented 8 years ago

Oh okay - Thanks. Just miscommunication. I was referring to the actual code and you were referring to the example project.