Javascript	  in	  iOS	  na.ve	  apps	  Jordi	  Giménez	  jordi@mobilejazz.cat	  
•  Reusing	  code	  in	  several	  pla>orms	  •  Exis.ng	  code	  to	  be	  integrated	  on	  our	  applica.on	  •  HTML5	...
•  Apple	  developed	  WebKit:	  JavaScript	  engine	  in	  Safari	  •  JavaScriptCore	  is	  part	  of	  WebKit	  –  Open...
•  A	  TwiZer	  applica.on	  usually	  provides	  a	  character	  counter.	  •  However,	  links	  need	  to	  be	  treate...
•  Create	  a	  JavaScript	  execu.on	  context	  	  mobilejazz.cat	  Nasty	  bits	  
•  Load	  your	  library	  mobilejazz.cat	  Nasty	  bits	  
•  Create	  func.ons	  mobilejazz.cat	  Nasty	  bits	  
•  Call	  func.ons	  mobilejazz.cat	  Nasty	  bits	  
•  Sample	  code:	  hZps://github.com/mobilejazz/tweet-­‐composer-­‐demo	  •  Objec.ve-­‐C	  wrapper	  with	  some	  added...
Upcoming SlideShare
Loading in …5
×

Javascript in iOS native apps - Tweet composer

541 views
445 views

Published on

Published in: Technology, Lifestyle
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
541
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
4
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Javascript in iOS native apps - Tweet composer

  1. 1. Javascript  in  iOS  na.ve  apps  Jordi  Giménez  jordi@mobilejazz.cat  
  2. 2. •  Reusing  code  in  several  pla>orms  •  Exis.ng  code  to  be  integrated  on  our  applica.on  •  HTML5  thing  does  not  work  as  adver.sed  •  Xcode  is  the  only  official  way  to  compile  code  that  can  go  to  the  AppStore  =>  {C,C++,Objec.ve-­‐C}  mobilejazz.cat  Problem  
  3. 3. •  Apple  developed  WebKit:  JavaScript  engine  in  Safari  •  JavaScriptCore  is  part  of  WebKit  –  Open-­‐source  library  –  Compilable  in  Xcode  mobilejazz.cat  Solu.on  
  4. 4. •  A  TwiZer  applica.on  usually  provides  a  character  counter.  •  However,  links  need  to  be  treated  specially  because  they  will  be  shortened.  •  TwiZer  open-­‐sourced  their  text  processing  library  (twiZer-­‐text.js)  mobilejazz.cat  Example  
  5. 5. •  Create  a  JavaScript  execu.on  context    mobilejazz.cat  Nasty  bits  
  6. 6. •  Load  your  library  mobilejazz.cat  Nasty  bits  
  7. 7. •  Create  func.ons  mobilejazz.cat  Nasty  bits  
  8. 8. •  Call  func.ons  mobilejazz.cat  Nasty  bits  
  9. 9. •  Sample  code:  hZps://github.com/mobilejazz/tweet-­‐composer-­‐demo  •  Objec.ve-­‐C  wrapper  with  some  added  stuff  (not  tested)  hZps://github.com/siuying/EvalJS    mobilejazz.cat  References  

×