0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

BクラスからAクラスを呼び出したい時(Swift )

Last updated at Posted at 2016-10-18

<<<<<<< HEAD

ClassA


class ClassA {

    class func classMethod() {
        // クラスメソッド処理
    }

    func instanceMethod() {
        // インスタンスメソッド処理
    }

=======
```swift:ClassA
class ClassA {
    
    class func classMethod() {
        // クラスメソッド処理
    }
    
    func instanceMethod() {
        // インスタンスメソッド処理
    }
    
>>>>>>> EDIT_REQUEST
}
<<<<<<< HEAD

=======
>>>>>>> EDIT_REQUEST

<<<<<<< HEAD

ClassB


// ClassA のクラスメソッドを呼び出す
    ClassA.classMethod()

    // ClassA のインスタンスメソッドを呼び出す
    let a = ClassA()
    a.instanceMethod()



=======
```swift:ClassB
    
    // ClassA のクラスメソッドを呼び出す
    ClassA.classMethod()
    
    // ClassA のインスタンスメソッドを呼び出す
    let a = ClassA()
    a.instanceMethod()
    
>>>>>>> EDIT_REQUEST

ドットで呼び出す

0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?