Skip to content

Instantly share code, notes, and snippets.

@muhammadabbas001
Created November 20, 2023 07:55
Show Gist options
  • Save muhammadabbas001/aab04752a83064b85e511464267d44e8 to your computer and use it in GitHub Desktop.
Save muhammadabbas001/aab04752a83064b85e511464267d44e8 to your computer and use it in GitHub Desktop.
func getHeight(_ i: Int) -> CGFloat {
if i == relativeLoc(){
return itemHeight
}
return itemHeight - 100
}
func getOpacity(_ i: Int) -> Double {
if i == relativeLoc()
|| i + 1 == relativeLoc()
|| i - 1 == relativeLoc()
|| i + 2 == relativeLoc()
|| i - 2 == relativeLoc()
|| (i + 1) - views.count == relativeLoc()
|| (i - 1) - views.count == relativeLoc()
|| (i + 2) - views.count == relativeLoc()
|| (i - 2) - views.count == relativeLoc()
{
return 1
}
return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment