No Such Module ‘Parse’

I just had this problem, and I got it to work by doing this: I opened my Target > Build Settings > Search Paths > Framework Search Paths. I added two values: $(PROJECT_DIR) and $(inherited) I don’t know why these were empty in the first place, but there you have it.

iOS Designated Initializers : Using NS_DESIGNATED_INITIALIZER

The use of NS_DESIGNATED_INITIALIZER is nicely explained in http://useyourloaf.com/blog/2014/08/19/xcode-6-objective-c-modernization.html: The designated initializer guarantees the object is fully initialised by sending an initialization message to the superclass. The implementation detail becomes important to a user of the class when they subclass it. The rules for designated initializers in detail: A designated initializer must call (via super) … Read more

How to set imageView in circle like imageContacts in Swift correctly?

This is solution which I have used in my app: var image: UIImage = UIImage(named: “imageName”) imageView.layer.borderWidth = 1.0 imageView.layer.masksToBounds = false imageView.layer.borderColor = UIColor.whiteColor().CGColor imageView.layer.cornerRadius = image.frame.size.width/2 imageView.clipsToBounds = true Swift 4.0 let image = UIImage(named: “imageName”) imageView.layer.borderWidth = 1.0 imageView.layer.masksToBounds = false imageView.layer.borderColor = UIColor.white.cgColor imageView.layer.cornerRadius = image.frame.size.width / 2 imageView.clipsToBounds = true

Animating a constraint in Swift

You need to first change the constraint and then animate the update. This should be in the superview. self.nameInputConstraint.constant = 8 Swift 2 UIView.animateWithDuration(0.5) { self.view.layoutIfNeeded() } Swift 3, 4, 5 UIView.animate(withDuration: 0.5) { self.view.layoutIfNeeded() }

Remove println() for release version iOS Swift

The simplest way is to put your own global function in front of Swift’s println: func println(object: Any) { Swift.println(object) } When it’s time to stop logging, just comment out the body of that function: func println(object: Any) { // Swift.println(object) } Or you can make it automatic by using a conditional: func println(object: Any) … Read more

How do I perform an auto-segue in Xcode 6 using Swift?

If your UI is laid out in a Storyboard, you can set an NSTimer in viewDidLoad of your first ViewController and then call performSegueWIthIdentifier when the timer fires: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let timer = Timer.scheduledTimer(interval: 8.0, … Read more