This document describes the conversion specification by enumerating conversion patterns. All sections are generated automatically from Test Spec of Objc2Swift.js.

Each section consists of a Objective-C code fragment and its corresponding Swift code like following.

Example Pattern


@interface MyClass
- (void)hello;

@implementation MyClass
- (void)hello{
    NSLog(@"Hello the Swift World!");


class MyClass {
    func hello() {
        NSLog("Hello the Swift World!")

Note that NSLog() is not converted into print() by default because they are not equivalent.