I have created the account on ArcGIS online portal. In this portal, I have also created a map into it. I am able to show this map into IOS mobile device through ArcGIS runtime SDK. Below is the code which I am using.
self.portal = AGSPortal (URL: NSURL(string: "https://mtx.maps.arcgis.com")!, loginRequired: false)
self.portal.credential = AGSCredential(user: USERNAME, password: PASSWORD)
//construct a portal item from the portal and item ID string
self.portalItem = AGSPortalItem(portal: self.portal, itemID: ITEMID)
//construct a map from the portal item
self.map = AGSMap(item: self.portalItem)
self.portal.loadWithCompletion() {[weak self] (error) in
if error == nil {
// check the portal item loaded and print the modified date
if self?.portal.loadStatus == AGSLoadStatus.Loaded {
self?.mapView.map = self?.map
}
}
else{
print("The map failed to load. ", error?.localizedDescription)
}
}