質問編集履歴

1

内容

2017/08/01 08:59

投稿

hn_tokyo
hn_tokyo

スコア69

test CHANGED
@@ -1 +1 @@
1
- Swift 単語をタップしてそ単語の意味を表示したい
1
+ Swift テキスト検索
test CHANGED
@@ -1,53 +1,5 @@
1
- アプリ内の英文の単語をタップすると、辞書の単語の意味がでるようにしたいのですが、
1
+ UILaebel,
2
2
 
3
- やりかたがつかめていません。
4
-
5
-
6
-
7
- 調べて行くうちに、
8
-
9
- UIAccesibilityをどうにかするかとおもって以下様なコードを画面表示時に描いても何もおこらず。
3
+ UITExtview、UITextfieldテキスト検索
10
-
11
-
12
-
13
- どのようにすればよいか教えて欲しいです。
14
-
15
-
16
-
17
-
18
4
 
19
5
  ```
20
-
21
- var accesibilityElement : UIAccessibilityElement?
22
-
23
-
24
-
25
- override func viewDidLoad() {
26
-
27
- super.viewDidLoad()
28
-
29
-
30
-
31
- accesibilityElement = UIAccessibilityElement.init(accessibilityContainer: self)
32
-
33
- accesibilityElement?.isAccessibilityElement = true
34
-
35
- accesibilityElement?.accessibilityFrame = myView.label.frame
36
-
37
- accesibilityElement?.accessibilityLabel = "abcdefg"
38
-
39
- let traits:UIAccessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction
40
-
41
- accesibilityElement?.accessibilityTraits = traits
42
-
43
- guard let element = accesibilityElement else {
44
-
45
- return
46
-
47
- }
48
-
49
- self.accessibilityElements?.append(element)
50
-
51
- }
52
-
53
- ```