Станислав Королевский, Я же Вам выше написал что должен быть путь к файлу в папке Recources
Читайте документацию https://docs.unity3d.com/ScriptReference/Resources...
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
public class SquareImageView extends ImageView {
public SquareImageView(Context context) {
super(context);
}
public SquareImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = getMeasuredWidth();
setMeasuredDimension(width, width);
}
}
if CLLocationManager.locationServicesEnabled() {
switch(CLLocationManager.authorizationStatus()) {
case .notDetermined, .restricted, .denied:
print("No access")
case .authorizedAlways, .authorizedWhenInUse:
print("Access")
}
} else {
print("Location services are not enabled")
}
let array = ["математика", "физика"]
. В tableViewController №2 создаете переменную которой будете передавать название предмета var name = ""
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "Seque" {
if let indexPath = self.tableView.indexPathForSelectedRow {
let destinationVC = segue.destination as! SecondTableViewController
destinationVC.name = self.array[(indexPath as NSIndexPath).row]
}
}
}
// create and add a camera to the scene
let cameraNode = SCNNode()
cameraNode.camera = SCNCamera()
//let cameraRoot = SCNNode()
cameraNode.position = SCNVector3(x: 0, y: 10, z: 20)
//cameraRoot.addChildNode(cameraNode)
scene.rootNode.addChildNode(cameraNode)
// setup a target object
let sphere = SCNSphere(radius: 0)
let sphereNode = SCNNode(geometry: sphere)
scene.rootNode.addChildNode(sphereNode)
// put a constraint on the camera
let targetNode = SCNLookAtConstraint(target: sphereNode)
targetNode.isGimbalLockEnabled = true
cameraNode.constraints = [targetNode]
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetailsSegue" && searchController.active {
if let indexPath = self.resultsController.tableView.indexPathForSelectedRow {
let destinationVC = segue.destinationViewController as! DetailsViewController
destinationVC.ralImage = self.ralImages[indexPath.row]
destinationVC.ralName = self.filteredRal[indexPath.row]
} else if let indexPath = self.tableView.indexPathForSelectedRow {
let destinationVC = segue.destinationViewController as! DetailsViewController
destinationVC.ralImage = self.ralImages[indexPath.row]
destinationVC.ralName = self.ralNames[indexPath.row]
}
}
if segue.identifier == "showDetailsSegue" {
if let indexPath = self.tableView.indexPathForSelectedRow {
let destinationVC = segue.destinationViewController as! DetailsViewController
destinationVC.ralImage = self.ralImages[indexPath.row]
destinationVC.ralName = self.ralNames[indexPath.row]
}
}
}
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(MainTableViewController.dismissKeyboard))
view.addGestureRecognizer(tap)