Skip to content

Commit 761cbf1

Browse files
authored
Merge branch 'master' into fix/roundedRectangle
2 parents 44155b4 + 14e7027 commit 761cbf1

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

IBAnimatableApp/IBAnimatableApp/Playground/ActivityIndicators/ActivityIndicatorCollectionViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class ActivityIndicatorCollectionViewController: UICollectionViewControlle
1717
iterateEnum(ActivityIndicatorType.self).forEach {
1818
types.append($0)
1919
}
20-
if types.count % 2 != 0, let index = types.index(of: .none) {
20+
if types.count % 2 != 0, let index = types.firstIndex(of: .none) {
2121
types.remove(at: index)
2222
}
2323
return types

IBAnimatableApp/IBAnimatableApp/Playground/Presentations/PresentingViewController.swift

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,19 @@ extension PresentingViewController {
228228
func resetSelectedItemPicker() {
229229
var row: Int?
230230
if selectedButton == btnAnimationType {
231-
row = animations.index(of: selectedAnimationType ?? "")
231+
row = animations.firstIndex(of: selectedAnimationType ?? "")
232232
} else if selectedButton == btnDismissalAnimationType {
233-
row = animations.index(of: selectedDismissalAnimationType ?? "")
233+
row = animations.firstIndex(of: selectedDismissalAnimationType ?? "")
234234
} else if selectedButton == btnModalPosition {
235-
row = positions.index(of: selectedModalPosition ?? "")
235+
row = positions.firstIndex(of: selectedModalPosition ?? "")
236236
} else if selectedButton == btnModalSize {
237-
pickerView.selectRow(sizes.index(of: selectedModalWidth) ?? 0, inComponent: 0, animated: false)
238-
pickerView.selectRow(sizes.index(of: selectedModalHeight) ?? 0, inComponent: 1, animated: false)
237+
pickerView.selectRow(sizes.firstIndex(of: selectedModalWidth) ?? 0, inComponent: 0, animated: false)
238+
pickerView.selectRow(sizes.firstIndex(of: selectedModalHeight) ?? 0, inComponent: 1, animated: false)
239239
return
240240
} else if selectedButton == btnKeyboardTranslation {
241-
row = keyboardTranslations.index(of: selectedKeyboardTranslation ?? "")
241+
row = keyboardTranslations.firstIndex(of: selectedKeyboardTranslation ?? "")
242242
} else if selectedButton == btnBlurEffectStyle {
243-
row = blurEffectStyles.index(of: selectedBlurEffectStyle ?? "")
243+
row = blurEffectStyles.firstIndex(of: selectedBlurEffectStyle ?? "")
244244
}
245245
pickerView.selectRow(row ?? 0, inComponent: 0, animated: false)
246246
}
@@ -287,3 +287,12 @@ extension PresentingViewController {
287287
}
288288

289289
}
290+
291+
/// Swift < 5.0 support
292+
#if swift(<5.0)
293+
extension Array where Element: Equatable {
294+
public func firstIndex(of element: Element) -> Int? {
295+
return self.index(of: element)
296+
}
297+
}
298+
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy