forked from ChatSecure/ChatSecure-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2a7f28
commit 39b8c84
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Compatibility.swift | ||
// ChatSecureCore | ||
// | ||
// Created by Chris Ballinger on 7/15/18. | ||
// Copyright © 2018 Chris Ballinger. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
#if swift(>=4.1) | ||
#elseif swift(>=4.2) | ||
#warning("Remove this once we've updated.") | ||
#else | ||
extension Collection { | ||
func compactMap<ElementOfResult>( | ||
_ transform: (Element) throws -> ElementOfResult? | ||
) rethrows -> [ElementOfResult] { | ||
return try flatMap(transform) | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters