The situation is a little complicated. I have a swift project, and I have import some objective-c file into this project. Right now I want to use some swift class in these objective-c file. How to do that?
via Chebli Mohamed
The situation is a little complicated. I have a swift project, and I have import some objective-c file into this project. Right now I want to use some swift class in these objective-c file. How to do that?
My iPhone is not showing up under "This PC" like the other drives on my computer. To import pictures, I used to plug in the cable, the iPhone would pop up like any other drive, right-click, then choose "Import pictures and videos". This is great because it gives you the option to erase the images once they're safely on your computer, freeing up your iPhone or iPad.
so I'm PC user Windows.
but I used Mac before, now i'm planning on learning C, object-c so I can create my apps you know have some fun.
There is a lot of questions in here but i find that Old.
So what I want to know is what machines are good/The Beast for now in 2015/2016 so i can work with Xcode without problems.
My budget is 4 thousand dollars.
I have two types of object: A and B
I want to B to collide with B but I don't want B to collide with A
How I do that?
I converted a image fully gray when load. But i want to remove gray color from when touch move and view original image color .
I want to know how i convert a gray color effect to original image and original to gray when user finger move over the image
I need to implement UIScrollView in my app using constraintsWithVisualFormat possible that someone would guide me with some code . Thank You!
import UIKit
class ViewController: UIViewController, UIScrollViewDelegate{
var scrollView: UIScrollView!
var containerView = UIView()
//FUNCION PARA PERMITIR COLORES HEXÁDECIMALES
func uicolorFromHex(rgbValue:UInt32)->UIColor{
let red = CGFloat((rgbValue & 0xFF0000) >> 16)/256.0;
let green = CGFloat((rgbValue & 0xFF00) >> 8)/256.0;
let blue = CGFloat(rgbValue & 0xFF)/256.0;
return UIColor(red:red, green:green, blue:blue, alpha:1.0);
}
//***
override func viewDidLoad() {
super.viewDidLoad()
self.scrollView = UIScrollView()
self.scrollView.delegate = self
containerView = UIView()
containerView.backgroundColor = uicolorFromHex(0x0099FF);
containerView.setTranslatesAutoresizingMaskIntoConstraints(false);
scrollView.addSubview(containerView)
view.addSubview(scrollView)
//*** DICCIONARIO
let viewsDictionary = ["scrollView":scrollView
,"containerView":containerView]
let view_constraint_H:NSArray = NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[scrollView]-0-|",
options: NSLayoutFormatOptions(0),
metrics: nil,
views: viewsDictionary)
let view_constraint_V:NSArray = NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[scrollView]-0-|",
options: NSLayoutFormatOptions(0),
metrics: nil,
views: viewsDictionary)
view.addConstraints(view_constraint_H as [AnyObject])
view.addConstraints(view_constraint_V as [AnyObject])
let view_constraintContainer_H:NSArray = NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[containerView]-0-|",
options: NSLayoutFormatOptions(0),
metrics: nil,
views: viewsDictionary)
let view_constraintContainer_V:NSArray = NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[containerView]-0-|",
options: NSLayoutFormatOptions(0),
metrics: nil,
views: viewsDictionary)
scrollView.addConstraints(view_constraintContainer_H as [AnyObject])
scrollView.addConstraints(view_constraintContainer_V as [AnyObject])
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
error:
2015-08-04 22:26:05.693 dsds[2017:56799] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "", "", "", "" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful. 2015-08-04 22:26:05.695 dsds[2017:56799] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "", "", "", "" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful. Message from debugger: Terminated due to signal 15
help me!!!! thanks!!!
In my game, there's a class for a "wall" that's moving to the left. I want to change the speed of it based on count i that I added to touchesBegan method:
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent {
count++
}
func startMoving() {
let moveLeft = SKAction.moveByX(-kDefaultXToMovePerSecond, y: 0, duration: 1 )
let move = SKAction.moveByX(-kDefaultXToMovePerSecond, y: 0, duration: 0.5)
if(count <= 10)
{
runAction(SKAction.repeatActionForever(moveLeft))
}
else
{
runAction(SKAction.repeatActionForever(move))
}
}
but it's not working. Can you help?