forum

Home / DeveloperSection / Forums / How to call a function within a structure and a class?

How to call a function within a structure and a class?

Anonymous User168613-Oct-2014
I have two files: ClassA.swift and ClassB.swift
classClassA: NSObject {
        structStructA {
            func talk(string: String) {
                println("I say: \(string)")
            }
        }
    }
 
 
    classClassB: NSObject {
        func makeItTalk(string: String) {
            ClassA.StructA.talk("Hello") <--------------
        }
    }

I get the following error message

Type 'ClassA.StructA' does not conform to protocol 'StringLiteralConvertible'

Any idea why? Is it actually something than can be achieved?


Updated on 13-Oct-2014
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By