-
Notifications
You must be signed in to change notification settings - Fork 1
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
58a176a
commit 6173b09
Showing
5 changed files
with
41 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
This directory caches tarball of build dependencies | ||
(downloaded from [prebuilder](https://github.com/fcitx-contrib/fcitx5-ios-prebuilder/releases)), | ||
(downloaded from [prebuilder](https://github.com/fcitx-contrib/fcitx5-prebuilder/releases/ios)), | ||
which will be extracted to `build/sysroot/usr`. |
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,35 @@ | ||
import SwiftUI | ||
|
||
struct EntryView: OptionViewProtocol { | ||
let label: String | ||
let data: [String: Any] | ||
@Binding var value: Any | ||
|
||
private func getChild(_ children: [[String: Any]], _ i: Int) -> [String: Any] { | ||
var child = children[i] | ||
child["Value"] = (value as! [String: Any])[child["Option"] as! String] | ||
return child | ||
} | ||
|
||
var body: some View { | ||
let children = data["Children"] as! [[String: Any]] | ||
VStack { | ||
ForEach(children.indices, id: \.self) { i in | ||
let child = getChild(children, i) | ||
let optionViewType = toOptionViewType(child) | ||
AnyView( | ||
optionViewType.init( | ||
label: child["Description"] as! String, | ||
data: child, | ||
value: Binding<Any>( | ||
get: { child["Value"] }, | ||
set: { | ||
var v = value as! [String: Any] | ||
v[child["Option"] as! String] = $0 | ||
value = v | ||
} | ||
))) | ||
} | ||
} | ||
} | ||
} |
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