-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some feature, add IdentifiedArray
- Loading branch information
1 parent
1657fb3
commit 383944f
Showing
18 changed files
with
362 additions
and
80 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.swiftpm/xcode/package.xcworkspace/xcuserdata/admin.xcuserdatad/IDEFindNavigatorScopes.plist
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,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<array/> | ||
</plist> |
Binary file added
BIN
+60.8 KB
...tpm/xcode/package.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
57 changes: 57 additions & 0 deletions
57
.swiftpm/xcode/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist
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,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>Builder.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>1</integer> | ||
</dict> | ||
<key>DataStructures.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>2</integer> | ||
</dict> | ||
<key>Transform.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>3</integer> | ||
</dict> | ||
<key>swift-extension-Package.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>Builder</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>DataStructures</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>Transform</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>UnitTests</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>swift-extension</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
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 |
---|---|---|
@@ -1,61 +1,77 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "CwlCatchException", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea", | ||
"version": "2.1.1" | ||
} | ||
}, | ||
{ | ||
"package": "CwlPreconditionTesting", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "fb7a26374e8570ff5c68142e5c83406d6abae0d8", | ||
"version": "2.0.2" | ||
} | ||
}, | ||
{ | ||
"package": "Nimble", | ||
"repositoryURL": "https://github.com/Quick/Nimble.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c93f16c25af5770f0d3e6af27c9634640946b068", | ||
"version": "9.2.1" | ||
} | ||
}, | ||
{ | ||
"package": "Quick", | ||
"repositoryURL": "https://github.com/Quick/Quick.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "bd86ca0141e3cfb333546de5a11ede63f0c4a0e6", | ||
"version": "4.0.0" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftDocCPlugin", | ||
"repositoryURL": "https://github.com/apple/swift-docc-plugin", | ||
"state": { | ||
"branch": null, | ||
"revision": "9b1258905c21fc1b97bf03d1b4ca12c4ec4e5fda", | ||
"version": "1.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "SymbolKit", | ||
"repositoryURL": "https://github.com/apple/swift-docc-symbolkit", | ||
"state": { | ||
"branch": null, | ||
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version": "1.0.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
"pins" : [ | ||
{ | ||
"identity" : "cwlcatchexception", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state" : { | ||
"revision" : "3ef6999c73b6938cc0da422f2c912d0158abb0a0", | ||
"version" : "2.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "cwlpreconditiontesting", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state" : { | ||
"revision" : "2ef56b2caf25f55fa7eef8784c30d5a767550f54", | ||
"version" : "2.2.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "nimble", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Nimble.git", | ||
"state" : { | ||
"revision" : "c93f16c25af5770f0d3e6af27c9634640946b068", | ||
"version" : "9.2.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "quick", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Quick.git", | ||
"state" : { | ||
"revision" : "bd86ca0141e3cfb333546de5a11ede63f0c4a0e6", | ||
"version" : "4.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-collections", | ||
"state" : { | ||
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", | ||
"version" : "1.1.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-plugin", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-plugin", | ||
"state" : { | ||
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", | ||
"version" : "1.3.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-symbolkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-symbolkit", | ||
"state" : { | ||
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version" : "1.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-identified-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/pointfreeco/swift-identified-collections", | ||
"state" : { | ||
"revision" : "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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 @@ | ||
import IdentifiedCollections | ||
import Foundation | ||
|
||
@available(iOS 13, macOS 12, tvOS 13, watchOS 6, *) | ||
public extension IdentifiedArray where Element: Identifiable { | ||
init(@ArrayBuilder<Element> builder: () -> [Element]) where ID == Element.ID { | ||
var identifiedArray: IdentifiedArrayOf<Element> = [] | ||
let items = builder() | ||
for item in items { | ||
identifiedArray.updateOrAppend(item) | ||
} | ||
self = identifiedArray | ||
} | ||
} |
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,17 @@ | ||
import IdentifiedCollections | ||
|
||
public extension IdentifiedArray { | ||
func toArray() -> [Element] { | ||
var array: [Element] = [] | ||
for value in self { | ||
array.append(value) | ||
} | ||
return array | ||
} | ||
} | ||
|
||
public extension IdentifiedArray where Element: Hashable { | ||
func toSet() -> Set<Element> { | ||
toArray().toSet() | ||
} | ||
} |
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,10 @@ | ||
public extension Bool { | ||
|
||
func toInt() -> Int { | ||
self ? 1 : 0 | ||
} | ||
|
||
func toString() -> String { | ||
self ? "true" : "false" | ||
} | ||
} |
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
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
Oops, something went wrong.