मेरे आईओएस swift
ऐप में मेरे पास UITableViewController
है जो गतिशील रूप से जोड़े गए कोशिकाओं के साथ है। प्रत्येक सेल में MKMapView
एम्बेडेड होता है और मैं अलग-अलग निर्देशांक पर प्रत्येक सेल के लिए मानचित्र का केंद्र सेट कर रहा हूं।UITableViewController में प्रत्येक सेल में मैंने मानचित्र एम्बेड किया है। क्या इसके बजाय मानचित्र के स्क्रीनशॉट में इसे बदलने का कोई तरीका है?
func centerMapOnLocation(location: CLLocation, map: MKMapView, radius: CLLocationDistance) {
let coordinateRegion = MKCoordinateRegionMakeWithDistance(location.coordinate,
radius * 2.0, radius * 2.0)
map.setRegion(coordinateRegion, animated: true)
}
अंदर cellForRowAtIndexPath
:: मैं इस विधि को फोन करके इसलिए कर रहा हूँ
override func tableView(tview: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tview.dequeueReusableCellWithIdentifier("cell") as! SingleCall
let user:SingleUser = self.items[indexPath.row] as! SingleUser
let regionRadius: CLLocationDistance = 150
let initialLocation = CLLocation(latitude: user.coordinate.latitude, longitude: user.coordinate.longitude)
centerMapOnLocation(initialLocation, map: cell.eventMap, radius: regionRadius)
cell.eventMap.zoomEnabled = false
cell.eventMap.scrollEnabled = false
cell.eventMap.userInteractionEnabled = false
}
यह ठीक है और यह काम करता है, लेकिन मैं रिकॉर्ड के बहुत सारे के साथ कल्पना वहाँ स्मृति के साथ समस्याओं होगा - अब भी जब उपयोगकर्ता तालिका को स्क्रॉल करता है तो केवल कुछ कोशिकाओं के साथ - प्रत्येक नक्शा तुरंत लोड होता है और मैं केवल कल्पना कर सकता हूं कि ऐसा करने के लिए कितनी गणना शक्ति होती है।
तो मेरा सवाल यह है कि क्या मानचित्र की वास्तविक स्थिति के किसी भी प्रकार के स्क्रीनशॉट को गतिशील मानचित्र दृश्य बदलने का कोई तरीका है? जब यह कई कोशिकाओं की बात आती है तो क्या यह तेजी से काम करेगा?