teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

誤字の修正

2020/06/07 13:29

投稿

oeiqgfodgfhps
oeiqgfodgfhps

スコア35

title CHANGED
@@ -1,1 +1,1 @@
1
- 辞書型配列から特定のキー値のみの配列を取り出したい
1
+ swiftで辞書型配列から特定のキー値のみの配列を取り出したい
body CHANGED
@@ -1,4 +1,4 @@
1
- 下記のような配列からuserIdが1のみのものを取り出したいです
1
+ swiftを使って下記のような配列からuserIdが1のみのものを取り出したいです
2
2
  ```ここに言語を入力
3
3
  quizArray = [
4
4
  [id:1,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:1],

1

コードをマークダウンを使用して書きました

2020/06/07 13:29

投稿

oeiqgfodgfhps
oeiqgfodgfhps

スコア35

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,12 @@
1
1
  下記のような配列からuserIdが1のみのものを取り出したいです
2
- quizArray = [[id:1,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:1],[id:2,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:2],[id:3,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:2],[id:4,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:1]]
2
+ ```ここに言語を入力
3
+ quizArray = [
4
+ [id:1,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:1],
5
+ [id:2,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:2],
6
+ [id:3,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:2],
7
+ [id:4,content:"問題文",select1:"選択肢1",select2:"選択肢2",select3:"選択肢3",userId:1]
8
+ ]
9
+ ```
10
+
3
11
  どのように記述すればいいでしょうか?
4
12
  ご回答お願いいたします。