質問編集履歴
2
微調整
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,9 @@
|
|
68
68
|
|
69
69
|
### 補足
|
70
70
|
|
71
|
+
すみません、説明不足だったのですが、Bridge-headerなしでも、TwitterKitを入れてビルドするだけなら出来るのですが、別のエラーがでたため、ドキュメントを読んでBridge-headerを入れました。
|
72
|
+
|
71
|
-
|
73
|
+
今回やりたいことは、Twitter投稿です。
|
72
74
|
|
73
75
|
そこで、ドキュメントにそって、AppDelegate.swiftに、以下のコードを貼っています。
|
74
76
|
|
1
補足エラー説明
test
CHANGED
File without changes
|
test
CHANGED
@@ -63,3 +63,53 @@
|
|
63
63
|
普通にTwitter投稿がやりたいだけなのですが、以前はここまで複雑じゃありませんでした。
|
64
64
|
|
65
65
|
何か方法をおわかりの方は、ご教授頂けると幸いです。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
### 補足
|
70
|
+
|
71
|
+
すみません、説明不足だったのですが、今回は、Twitter投稿を行おうとしています。
|
72
|
+
|
73
|
+
そこで、ドキュメントにそって、AppDelegate.swiftに、以下のコードを貼っています。
|
74
|
+
|
75
|
+
```AppDelegate.swift
|
76
|
+
|
77
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
78
|
+
|
79
|
+
Twitter.sharedInstance().start(withConsumerKey:"{customor-key}", consumerSecret:"customor-secret")
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
return true
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
```ViewController.swift
|
92
|
+
|
93
|
+
func tweet() {
|
94
|
+
|
95
|
+
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter) {
|
96
|
+
|
97
|
+
let composer = SLComposeViewController(forServiceType: SLServiceTypeTwitter)
|
98
|
+
|
99
|
+
composer.setInitialText("Hello Twitter!")
|
100
|
+
|
101
|
+
composer.addImage(UIImage(named: "hello"))
|
102
|
+
|
103
|
+
composer.addURL(URL(string: "https://dev.twitter.com"))
|
104
|
+
|
105
|
+
self.presentViewController(socialController, animated: true, completion: nil)
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
これらの機能でTwitter投稿が出来るらしいですが、AppDelegate.swiftにて、
|
114
|
+
|
115
|
+
Use of unresolved identifier 'Twitter'というエラーが表示されます。こちら、解決方法が分からずに困っています。同じようなエラーに引っかかった方、おられないでしょうか?
|