This is a simple converter for Java Class to Swift2.x Class using regex
Online converter available : http://betas.github.io/Java2Swift-Class-Converter/
[Origin]
public int func1() {
blahblahblah
}
[Converted]
func func1() -> Int {
blahblahblah
}
[Origin]
class Test {
public Test(int foo) {
blahblahblah
}
}
[Converted]
class Test {
init(foo: Int) {
blahblahblah
}
}
[Origin]
class Test {
private int foo = 0;
private String bar;
}
[Converted]
class Test {
var foo: Int = 0;
var bar: String = ""; // Auto generated default value as same as Java
}
- Support convert options
- convert 'private' or 'protected' to 'internal'
- spacing after ':' character
- external parameter name to '_'
- remove ';'