IDE: Fire
Version: Version 10.0.0.2400 (develop) built on talax, 20190426-155608. Commit f04dec1.
Target (If relevant): iOS
Description:
I am wondering if it’s possible to use a Swift-based framework like SnapKit (see: https://github.com/SnapKit/SnapKit) within a Silver-based project? Should it work when I compile the library into a .framework
file and then import it into Fire?
I have tried to import the framework but I am getting the compiler error and now I am not sure if what I am trying to do is actually supported by the compiler. I am not sure if the framework should be Objective-C based ones. My gut feeling thinks it should be
Expected Behavior:
I would expect that the code will compile without any compiler errors and the constraints are working
Actual Behavior:
Compiler error: No member "snp" on type "UIView!" [/Users/x/Desktop/Bug/SnapKit/SnapKit/RootViewController.swift (16)]
Steps:
You can download my project code at: https://www.dropbox.com/s/fev5qjzt3sk4ucc/SnapKit.zip?dl=0
- Checked out the SnapKit project
- Build the framework for
Generic iOS device
and theiPhone XS
-simulator device - Navigated to the derived data directory and copied the
.framework
of each build toFrameworks/SnapKit
directory in my Fire project - Created a
iOS
andiOS Simulator
directory inside and moved the respective framework file in each directory
Note: Here I am getting confused I am not sure which file I supposed to drag into the references section of my iOS project. The documentation suggests the tool will pickup the right .framework
when you use the above structure. Only does this only refer when you use FXGen
-tool or in general?
- Create a simple iOS project in Fire
- Drag the
iOS
's framework to the project - Use some simple code to use the framework listed below
- Compile the project
- Notice the compiler error
Used RootViewController.swift
import UIKit
import SnapKit
@IBObject class RootViewController : UIViewController {
public override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let box = UIView()
let container = UIView()
container.addSubview(box)
box.snp.makeConstraints { (make) -> Void in
make.size.equalTo(50)
make.center.equalTo(container)
}
}
public override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}