Overview

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

Objective-C

@interface MyClass
- (void)hello;
@end

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

Swift

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

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