Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Objc2Swift.js is an Objective-C to Swift converter written in JavaScript. (Live Demo)
#import
delective with pre-compiled header cache.$ npm install -g objc2swift
Then, run the objc2swift
command with --init
option to setup the default configuration.
$ objc2swift --init ios
Note that the parameter ios
means to setup objc2swift for using Xcode's iOS SDK. If you want to target other SDK, use osx
, tvos
or watchos
.
Pass the target source file to the command. The conversion result will be written to the current directory with extension .swift
.
$ objc2swift foo.m
The first conversion is very slow since there is no pre-compiled header cache. It will be speed-up later.
By default, the command searches user headers from the current directory and its subdirectories.
To import more headers, use -I
option can be used to specifiy include paths. For example,
$ objc2swift -I ~/git/myproject/ foo.m
The path specified by -I
is recursively traversed.
The default config path is ~/.objc2swift/config.json
. A typical content of config.json is like following.
If you want to add user header search path permanently instead of -I
, add the path to includePaths
array.
{
"systemIncludePaths": [
"${Xcode.app}/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks",
"${Xcode.app}/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include",
"${Xcode.app}/Contents/Developer/Platforms/iPhoneOS.platform/usr/lib/clang/3.5/include"
],
"includePaths": []
}
FAQs
Objective-C to Swift Converter
The npm package objc2swift receives a total of 11 weekly downloads. As such, objc2swift popularity was classified as not popular.
We found that objc2swift demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.