Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WebViewを活用するアプリの作り方 LT @ Conference With Develo...
Search
cockscomb
February 01, 2014
Programming
2.3k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebViewを活用するアプリの作り方 LT @ Conference With Developers 2
cockscomb
February 01, 2014
More Decks by cockscomb
See All by cockscomb
はてなアカウント基盤 State of the Union
cockscomb
1
1.5k
jq at the Shortcuts
cockscomb
1
2.1k
GraphQL放談
cockscomb
4
2.2k
GraphQL Highway
cockscomb
28
8.9k
吉田を支える技術
cockscomb
0
2.6k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.5k
ユーザインターフェイスと非同期処理
cockscomb
5
2.1k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.8k
Other Decks in Programming
See All in Programming
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
370
AmebaブログはKMPから卒業します
kmars0605
0
110
Kotlinの15年とServer-Side Kotlin
n_takehata
1
140
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
230
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
0
190
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
410
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
120
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
APNsからLive Activityを開始する話
yumnumm
0
170
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
210
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
560
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Paper Plane
katiecoart
PRO
5
54k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Six Lessons from altMBA
skipperchong
29
4.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Transcript
cockscomb
None
ͯͳϒϩά
8FC"1*Λར༻͢ΔJ04ΞϓϦ։ൃ ͯͳαϚʔΠϯλʔϯγοϓ
–id:griffin-stewie lͦΕͳΓʹ࣮ઓܦݧ͕͋ΔਓͰ ͬͯͳͦ͞͏ͩͬͨΓΒͳͦ͏ͳ͜ͱΛ αϥοͱݟͤͯ͘Ε͍ͯΔz
)BUFOB&OHJOFFS4FNJOBS ͯͳʹ͓͚ΔϞμϯJ04ΞϓϦ։ൃೖ
– @kazuph lϞμϯʹॻ͔ͳ͔ͬͨ߹ͱॻ͍ͨ߹Λίʔ υͰൺֱͨͭ͠ͷͰઆ໌Λͯ͘͠ΕͯΔͷͰ ͍͢͝ḿΔIBUFOBUFDIz
cockscomb
8FC7JFXΛ׆༻͢Δ ΞϓϦͷ࡞Γํ
6*ͱͯ͠ͷ8FC7JFX w 6*8FC7JFXͰ)5.-ΞϓϦΛ࡞Δ w ΞϓϦͷҰ෦͚ͩ)5.-Ͱ࡞Δ w +BWB4DSJQUͱωΠςΟϒͷؒΛͲ͏औ Γ͔࣋ͭ
w "QBDIF$PSEPWB "EPCF1IPOF(BQ w 6*8FC7JFX w +BWB4DSJQU$PSF w 8FC7JFX+BWB4DSJQU#SJEHF
"QBDIF$PSEPWB w 6*8FC7JFXΛӅṭ w ϓϥάΠϯΞʔΩςΫνϟ w ϚϧνϓϥοτϑΥʔϜ
6*8FC7JFX • -stringByEvaluating JavaScriptFromString: • -webView: shouldStartLoadWithRequest: navigationType:
8FC7JFX+BWB4DSJQU#SJEHF w HJUIVCDPNNBSDVTXFTUJO 8FC7JFX+BWBTDSJQU#SJEHF w 8FCίϯςϯπͱωΠςΟϒͷΓऔ ΓΛநԽ
self.bridge = [WebViewJavascriptBridge bridgeForWebView:self.webView webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
}]; ! [self.bridge registerHandler:@"objc-handler" handler:^(NSDictionary *data, WVJBResponseCallback responseCallback) { // do something responseCallback(@{}); }]; [self.bridge callHandler:@"js-handler" data:@{ @"key" : @"value" } responseCallback:^(id responseData) { // do something }];
var Bridge = {}; Bridge.connect = function(callback) { if (window.WebViewJavascriptBridge)
{ callback(WebViewJavascriptBridge); } else { document.addEventListener('WebViewJavascriptBridgeReady', function() { callback(WebViewJavascriptBridge); }, false); } }; ! Bridge.connect(function(bridge) { bridge.init(function (message, responseCallback) { if (responseCallback) { responseCallback(); } }); ! bridge.registerHandler('js-handler', function (responseData) { // do something }); ! bridge.callHandler(‘objc-handler', { 'key' : 'value' }, function responseCallback(responseData) { // do something }); });
8FC7JFX+BWB4DSJQU#SJEHF w ωΠςΟϒଆͱ8FCίϯςϯπଆɺ ํͷݺͼग़͠ɺσʔλͷड͚͠ w ബ͘ίϯτϩʔϧ͍͢͠Ϧʔζφϒ ϧͳΠϯλʔϑΣʔε
+BWB4DSJQU$PSF
JSContext *context = [self.webView valueForKeyPath: @"documentView.webView.mainFrame.javaScriptContext"]; JSValue *three = [context
evaluateScript:@"1+2"]; http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
6*8FC7JFX +BWB4DSJQU$PSF w ඇެ։"1* w +BWB4DSJQU$PSFͷߴͳΈ w কདྷͷJ04ͷظ
8FC7JFXΛ׆༻͢Δ ΞϓϦͷ࡞Γํ
DPDLTDPNCIBUFOBCMPHDPN
IBUFOBDPSQKQSFDSVJU