We're evaluating skobbler for a large deployment.
I'm building a framework that will be included in one or more apps.
I followed the steps to add in the documentation to add the cocoapod to my framework, but the framework doesn't build. It can't import SKMaps. I had to make two changes to make it work:
1. Add "${PODS_ROOT}/ScoutMaps-iOS-SDK/SKMaps.framework/Headers" to my Header Search Paths
2. Manually create module.modulemap in "${PODS_ROOT}/ScoutMaps-iOS-SDK/SKMaps.framework/Headers"
Content of module.modulemap
Code:
module SKMaps {
header "SKMaps.h"
export *
}
These two changes got me building successfully, but now I need to create a private cocoapod for my own framework. I'm hitting the same errors again.
From what I have been able to determine, https://developer.apple.com/library/...xandMatch.html describes what you need to do to package an Objective-C cocoapod so it can be used inside other Swift frameworks. See the section titled "Importing Code from Within the Same Framework Target"
In the meantime, I suppose I'll have to hack a fix in the podspec for my cocoapod, and find a way to make it work with the ScoutMaps-iOS-SDK cocoapod. I'm not sure yet how I'll do that.
To reproduce my problem:
1. Create a new swift iOS framework project.
a. File | New | Project.
b. In the left panel under iOS, select Framework & Library.
c. In the right panel, select CocoaTouch Framework. Next.
d. Enter project name, SkobblerNestedFramework. Make sure to select Swift for the language. Next.
e. Choose location for project. Create.
2. Create Podfile:
Code:
platform :ios, '9.0'
use_frameworks!
target 'SkobblerNestedFramework' do
pod 'ScoutMaps-iOS-SDK'
end
target 'SkobblerNestedFrameworkTests' do
pod 'ScoutMaps-iOS-SDK'
end
3. Pod Install
4. Create a class that uses SKMapView
Code:
import UIKit
import SKMaps
public class SkobblerMapView: UIView {
var mapView: SKMapView
public override init(frame: CGRect) {
mapView = SKMapView(frame: CGRectMake(0,0, frame.size.width, frame.size.width))
super.init(frame: frame)
self.addSubview(mapView)
}
required public init?(coder aDecoder: NSCoder) {
mapView = SKMapView(frame: CGRectZero)
super.init(coder: aDecoder)
}
public override func awakeFromNib() {
super.awakeFromNib()
mapView.frame = self.bounds
self.addSubview(mapView)
}
}
According to the Apple documentation, the "import SKMaps" should not be necessary. Removing it results in errors on every line that references mapView.
I tried to attach a zip file with a sample project created with the steps above, but I would not upload, probably due to size (94 MB).
Does anyone have suggestions about how to work around this problem so that my cocoapod, with its dependency on the ScoutMaps-iOS-SDK cocoapod will work? (pod lib lint fails because it can't find SKMaps).
Thanks!
Bookmarks