Trên GitHub, bang590/JSPatch đã đạt 11.3k sao, ngôn ngữ Objective-C. JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
JSPatch bridges Objective-C and JavaScript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. That makes the APP obtaining the power of script language: add modules or replacing Objective-C code to fix bugs dynamically.
JSPatch is still in development, welcome to improve the project together.
You can also try to use JSPatch Convertor to convertor code from Objective-C to JavaScript automatically.
Installation
CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like JSPatch in your projects. See the "Getting Started" guide for more information.
# Your Podfile
platform :ios, '6.0'
pod 'JSPatch'
Manually
Copy JSEngine.mJSEngine.hJSPatch.js in JSPatch/ to your project.
// JS
defineClass("JPTableViewController", {
// instance method definitions
tableView_didSelectRowAtIndexPath: function(tableView, indexPath) {
var row = indexPath.row()
if (self.dataSource().count() > row) { //fix the out of bound bug here
var content = self.dataSource().objectAtIndex(row);
var ctrl = JPViewController.alloc().initWithContent(content);
self.navigationController().pushViewController(ctrl);
}
},
dataSource: function() {
// get the original method by adding prefix 'ORIG'
var data = self.ORIGdataSource().toJS();
return data.push('Good!');
}
}, {})
Go to wiki page for more details: Usage of defineClass
Extensions
There are some extensions provide support for custom struct type, C methods and other functional, call +addExtensions: after starting engine to add extensions:
include('test.js') //include function provide by JPInclude.m
var view = require('UIView').alloc().init()
//CGAffineTransform is supported in JPCGTransform.m
view.setTransform({a:1, b:0, c:0, d:1, tx:0, ty:100})
Extensions can be added dynamiclly in JS, which is recommended:
require('JPEngine').addExtensions(['JPInclude', 'JPCGTransform'])
// `include()` and `CGAffineTransform` is avaliable now.
You can create your own extension to support custom struct type and C methods in project, see the wiki page for more details: Adding new extensions
bang590/JSPatch có 11.3k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/bang590/JSPatch. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
bang590/JSPatch có phải mã nguồn mở không?
Có — bang590/JSPatch phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/bang590/JSPatch.
bang590/JSPatch còn đang phát triển không?
Commit gần nhất trên bang590/JSPatch là 6.0 năm trước (theo timestamp GitHub). Repo có 2.2k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
bang590/JSPatch là gì?
bang590/JSPatch (bang590/JSPatch) là dự án Objective-C trên GitHub. Theo mô tả gốc: JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
Đọc thêm về bang590/JSPatch ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/bang590/JSPatch là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc JSPatch có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về JSPatch.