-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility issues with older Swift versions
Drops support for Xcode 11.7 (Swift 5.2.4) due to issues resolving overloaded methods.
- Loading branch information
1 parent
a0034d3
commit 69ab631
Showing
4 changed files
with
31 additions
and
42 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
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,14 @@ | ||
// | ||
// DynamicCast.swift | ||
// MockingbirdFramework | ||
// | ||
// Created by typealias on 8/2/21. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Swift versions before 5.4 cannot cast from `Any` to a more optional type. | ||
/// https://forums.swift.org/t/casting-from-any-to-optional/21883 | ||
func dynamicCast<T>(_ value: Any?) -> T { | ||
return value as! T | ||
} |
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