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
JSPatch Introduction
Search
Wei Wang
August 06, 2015
Programming
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JSPatch Introduction
Wei Wang
August 06, 2015
More Decks by Wei Wang
See All by Wei Wang
網路之難,難於上青天 - iPlayground 2019
onevcat
11
5.5k
GMTC 2019 - 在分歧中发展,2019 我们能用 Swift 做什么
onevcat
0
1.3k
从 Swift 到机器学习
onevcat
2
1.1k
iOS Dev - The Dark Side
onevcat
0
180
面向协议编程与 Cocoa 的邂逅
onevcat
14
5k
Swift 3 - From Expert to Beginner
onevcat
2
290
如何打造一个让人愉快的框架
onevcat
4
23k
Objective-C Runtime Swizzle
onevcat
0
250
Unity Memory
onevcat
0
200
Other Decks in Programming
See All in Programming
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
0
110
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
270
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
Railsバージョンを4倍にした話
optim
0
440
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
750
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
For a Future-Friendly Web
brad_frost
184
10k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
A Tale of Four Properties
chriscoyier
163
24k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Agile that works and the tools we love
rasmusluckow
331
22k
Technical Leadership for Architectural Decision Making
baasie
3
600
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Transcript
ࣗݾհ w ԦቨʢΦΪPOFWDBUʣ+1 w -JOF"ET -JOFόΠτ (BNF$BTU 5IVOEFS w
IUUQTHJUIVCDPNPOFWDBU w IUUQPOFWDBU
ੈքҰ൪ͷ ϓϩάϥϛϯάݴޠʁ
+BWB4DSJQUؒҧ͍ͳ͍ IUUQHJUIVUJOGP
+BWB4DSJQU$PSF J04
+BWB4DSJQU$PSF var num = 5 + 5 var triple =
function(value) { return value * 3} triple(num) //30 import JavaScriptCore let context = JSContext() context.evaluateScript("var num = 5 + 5") context.evaluateScript("var triple = function(value) { return value * 3 }") let tripleNum: JSValue = context.evaluateScript("triple(num)") +BWB4DSJQU 4XJGU
import JavaScriptCore let context = JSContext() context.evaluateScript("var num = 5
+ 5") context.evaluateScript("var triple = function(value) { return value * 3 }") let tripleNum: JSValue = context.evaluateScript("triple(num)") 1MBJO4USJOH'VODUJPOBMJUZ
import JavaScriptCore let context = JSContext() context.evaluateScript("var num = 5
+ 5") context.evaluateScript("var triple = function(value) { return value * 3 }") let tripleNum: JSValue = context.evaluateScript("triple(num)") 1MBJO4USJOH'VODUJPOBMJUZ 3VOUJNF
+41BUDI Ԧቨ
+BWB4DSJQUΛͬͯɺ ΞϓϦͷϝιʔυΛࠩ͠ସ͑ΔϥΠϒϥϦʔ +41BUDIͱ IUUQTHJUIVCDPNCBOH+41BUDI
8IZ w "QQਃͱϨϏϡʔ ͍ w ಛٸਃ੍ؒݶ w मਖ਼͚ͩͰͳ͘ɺػ ೳՃՄೳɻ
͍ํ
͍ํ
͍ํ w $PDPB1PETQPE+41BUDI w <+1&OHJOFTUBSU&OHJOF> w <+1&OHJOFFWBMVBUF4DSJQUTDSJQU> 4DSJQU
ࠩ͠ସ͑ΔͷΛఆٛ͢ΔKT 4DSJQU ϩʔΧϧϑΝΠϧɺωοτɺετϦϯά ಛఆͳOBNFDPOWFOUJPOͰɺ0CKFDUJWF$ޓ
%FNP Talk is cheap. Show me the code.
3VMFEFpOF$MBTT w Ϋϥεͷϝιʔυ࠶ఆٛ defineClass("ClassName", { method: function() { ... },
}) @implementation ClassName -(void)method { … } defineClass(classDeclaration, instanceMethods, classMethods)
3VMFΞϯμʔόʔ w ΫϥεͷεϖʔεΛࠩ͠ସ͑Δ @implementation JPTestObject - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ } @end defineClass("JPTableViewController", { tableView_didSelectRowAtIndexPath: function(tableView, indexPath) { ... }, })
3VMF03*( w 03*(Λ͍ͨΒɺલͷ࣮ΛݺͿ @implementation JPTableViewController - (void) viewDidLoad { }
@end defineClass("JPTableViewController", { viewDidLoad: function() { self.ORIGviewDidLoad(); }, })
3VMFTFUUFSHFUUFS w TFUUFSPSHFUUFSΛ͏ @interface JPTableViewController @property (nonatomic) NSArray *data; @end
@implementation JPTableViewController @end defineClass("JPTableViewController", { viewDidLoad: function() { var data = self.data() self.setData(data.toJS().push("JSPatch") }, })
3VMF0UIFS IUUQTHJUIVCDPNCBOH+41BUDI XJLJ6TBHFPGEFpOF$MBTT μϒϧΞϯμʔόʔ CMPDL($% TVQFS QSPUPDPM OFXQSPQFSUZNFUIPE FYUFOTJPO
+41BUDI࣮ݱݪཧ ForwardInvocation Core Concept: IUUQCMPHDOCBOHOFUUFDI தࠃޠͰ͕͢ɻɻ
ϦεΫ w தؒऀ߈ܸ .*5. )5514ඞཁ w ϩʔΧϧվ͟Μ҉߸Խ͢Δ w ύϑΥʔϚϯεόʔδϣϯཧΫϦςΟΧϧ όά͚ͩ
4XJGU
4XJGU w /40CKFDUͱγεςϜ"1*0, EZOBNJD EJTQBUDI w ଞͷEZOBNJDLFZXPSEΛՃඞཁ SVOUJNF ར༻͢ΔͨΊ
w +4ʹɺDMBTT໊ͷલNPEVMF໊Ճඞཁ w ݁ɿ͑·͕͢ɺ໘ɻΊͯͷํ͕͍͍
5IBOLZPV '"2