All Projects → appcoda → Javascriptcoredemo

appcoda / Javascriptcoredemo

A Demo of JavaScriptCore in Swift

Programming Languages

javascript
184084 projects - #8 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Javascriptcoredemo

Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+8331.82%)
Mutual labels:  swift-framework
Flightanimator
Advanced Natural Motion Animations, Simple Blocks Based Syntax
Stars: ✭ 588 (+1236.36%)
Mutual labels:  swift-framework
Cheatyxml
CheatyXML is a Swift framework designed to manage XML easily
Stars: ✭ 23 (-47.73%)
Mutual labels:  swift-framework
Awesome Swift
A collaborative list of awesome Swift libraries and resources. Feel free to contribute!
Stars: ✭ 21,440 (+48627.27%)
Mutual labels:  swift-framework
Swiftybeaver
Convenient & secure logging during development & release in Swift 3, 4 & 5
Stars: ✭ 5,392 (+12154.55%)
Mutual labels:  swift-framework
Postal
A Swift framework for working with emails
Stars: ✭ 602 (+1268.18%)
Mutual labels:  swift-framework
Livecollections
Automatically perform UITableView and UICollectionView animations between two sets of immutable data. It supports generic data types and is fully thread-safe.
Stars: ✭ 337 (+665.91%)
Mutual labels:  swift-framework
Viewcomposer
Compose views using enums swiftly: `let label: UILabel = [.text("Hello"), .textColor(.red)]`
Stars: ✭ 27 (-38.64%)
Mutual labels:  swift-framework
Awesome Swift
A curated list of awesome Swift frameworks, libraries and software.
Stars: ✭ 5,201 (+11720.45%)
Mutual labels:  swift-framework
Parade
Parallax Scroll-Jacking Effects Engine for iOS / tvOS
Stars: ✭ 754 (+1613.64%)
Mutual labels:  swift-framework
Pulltodismiss
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.
Stars: ✭ 456 (+936.36%)
Mutual labels:  swift-framework
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (+1195.45%)
Mutual labels:  swift-framework
Bluecap
iOS Bluetooth LE framework
Stars: ✭ 669 (+1420.45%)
Mutual labels:  swift-framework
Owl
A declarative type-safe framework for building fast and flexible lists with UITableViews & UICollectionViews
Stars: ✭ 423 (+861.36%)
Mutual labels:  swift-framework
Taniwhatextfield
My first cocoapod framework
Stars: ✭ 26 (-40.91%)
Mutual labels:  swift-framework
Steampress
A Blogging Engine and Platform written in Swift for use with the Vapor Framework
Stars: ✭ 337 (+665.91%)
Mutual labels:  swift-framework
Badgehub
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
Stars: ✭ 592 (+1245.45%)
Mutual labels:  swift-framework
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-29.55%)
Mutual labels:  swift-framework
Nantes
Swift TTTAttributedLabel replacement
Stars: ✭ 852 (+1836.36%)
Mutual labels:  swift-framework
Koyomi
Simple customizable calendar component in Swift 📆
Stars: ✭ 716 (+1527.27%)
Mutual labels:  swift-framework

Using JavaScriptCore Framework in Swift Projects

For a long time I wanted to write a post about how Swift and JavaScript can be tied together, and lead eventually to more powerful and rich-featured apps. Being able to embed JavaScript code in iOS projects is not something that you hear for first time, but if you have never tried to do that then you should really read this and find out how simple is to do magical things with just a few actions. The one that makes that magic available has a name, and is called JavaScriptCore framework.

You might be thoughtful about that, and wondering why someone would really like to use JavaScript when everything can be done in Swift. I admit that I was thoughtful too in the beginning, but here are some good reasons that answer to the above:

  • iOS developers that were used to write web apps and they miss JavaScript-ing, can take the maximum out of the JavaScriptCore framework coding again using their favourite language.
  • There might exist JavaScript libraries that perform specific tasks suitable for your needs, and there’s nothing equivalent in Swift or you have to do it on your own. Why not to use them?
  • It’s possible that some tasks are easier to be handled in JavaScript.
  • You want to modify the behaviour of your app remotely. In that case the JavaScript code resides on a server and not locally in the app’s bundle. Be careful though, because it’s easy to end up with a disaster.
  • You could possibly make your app more flexible and powerful.
  • You are curious enough and you want to use JavaScript in your iOS projects.

Of course, you can think more than the above, but even these are good reasons to make you want to get started with JavaScript in iOS. Now that you feel the excitement too, let me underline a few necessary technical details. First off, JavaScript execution has its own environment, or to put it in a better way, a virtual machine where it runs into. In the JavaScriptCore framework, the JSVirtualMachine class represents programmatically that virtual machine, but usually you won’t have to deal directly with it. It’s possible to have multiple virtual machines running in an app, but they cannot exchange any data directly.

For the full tutorial, you can refer to this link:

http://www.appcoda.com/javascriptcore-swift/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].