More than 1 year has passed since last update.

Swiftでのクラスメソッドの書き方

Class.swift
class SomeClass {
    class func someTypeMethod() {
        // type method implementation goes here
    }
}

SomeClass.someTypeMethod()

Objective-Cの場合だと

SomeClass.m
+ (void)someTypeMethod;

となります

追記

Swift1.2より、staticが使用できます。

class SomeClass {
    static func someTypeMethod() {
    }
}
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.