Get all layers info in Swift

1105
2
Jump to solution
09-27-2016 12:35 AM
AntonioFiume
New Contributor III

Dear All,

i tried to convert Object-c call in Swift using last stable SDK version:

AGSMapServiceInfo *serviceInfo = [AGSMapServiceInfo mapServiceInfoWithURL:serviceURL credential:nil error:&error];

 the Swift equivalent seem is the following:

var serviceInfo : AGSMapServiceInfo;

serviceInfo = AGSMapServiceInfo(URL: serviceURL, credential: nil);

If i gets the following parameter:

serviceInfo.layerInfos

in Object-C works fine, but in Swift return NIL.

I tried a lot of example on internet but nothing works fine.

Could you please take a look?

Thanks and Regards.

Tony

0 Kudos
1 Solution

Accepted Solutions
AntonioFiume
New Contributor III

Hope the Swift equivalent seem is the following:

serviceInfo = AGSMapServiceInfo.mapServiceInfoWithURL(serviceURL, credential: nil)

View solution in original post

0 Kudos
2 Replies
AntonioFiume
New Contributor III

please note that my goal is to create a FOR statement to get all layers name from a Map Server and add them in my mapView.

0 Kudos
AntonioFiume
New Contributor III

Hope the Swift equivalent seem is the following:

serviceInfo = AGSMapServiceInfo.mapServiceInfoWithURL(serviceURL, credential: nil)

0 Kudos