Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
The service variable in ViewController should be able to take every type that conforms to the RESTServiceType Protocol. But this produces a Swift Compiler Error.
import UIKit
protocol RESTServiceType {
class func getData()
struct RESTService: RESTServiceType {
static func getData() {
class ViewController {
var service: RESTServiceType.Type = RESTService.self
func viewDidLoad() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment