Add this to your Podfile:
target 'YourApp' do
pod 'MapMetrics', '~> 0.0.1' # Use the latest version
# OR
pod 'MapMetrics', :git => 'https://github.com/hasnattariqusuf/MapMetrics-iOS.git', :tag => '0.0.1'
end
Run:
pod install
To prevent rsync.samba deny(1)
errors, users must add these settings:
Add to your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Disable sandbox restrictions
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
end
end
end
Then run:
pod install
- Open your project in Xcode.
- Go to Target → Build Settings.
- Search for
ENABLE_USER_SCRIPT_SANDBOXING
. - Set to NO for all configurations (Debug/Release).
Import in your code:
import MapMetrics
Clean Build (if issues persist):
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Issue | Solution |
---|---|
Sandbox deny(1) errors | Ensure ENABLE_USER_SCRIPT_SANDBOXING=NO is set. |
pod install fails |
Delete Pods/ and Podfile.lock , then retry. |
Version conflicts | Run pod update MapMetrics . |
Here's how to integrate MapMetrics into your project:
import UIKit
import MapMetrics
class ViewController: UIViewController {
var mapView: MLNMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Initialize the map view
let isdarkMode: Bool = true
mapView = MLNMapView(frame: view.bounds, isDarkMode: isdarkMode)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Set the map's center coordinate and zoom level
let center = CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194) // San Francisco
mapView.setCenter(center, zoomLevel: 12, animated: false)
// Add the map view to the view controller
view.addSubview(mapView)
}
}
platform :ios, '12.0'
target 'YourApp' do
use_frameworks!
pod 'MapMetrics', '~> 0.0.2'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
end
end
end
end