Contact method for a frame

Swift
I am trying to implement a contact method to know when my player block has touched the yellow frame. Below is the code I have so far. When i drag the ...
2 years ago

Collection cell that fills entire width of screen and scrolls only one at a time in swift?

Swift
I have a UICollectionView that has 20 cells and 1 section. I made each cell 320 in width and 304 in height. I scroll the collection view programmatic...
2 years ago

Delegate method property to being triggered on conforming class

Swift
I have the following protocol protocol SentenceDelegate: class{ func sentenceDidFinish() } I have my SentenceMarkov class conform to the protoc...
2 years ago

Swift Code ending during variable set

Swift
I have the following code, and for some reason when it gets to the line let num = data[pagesLeft] The code just stops, and I cant figure out why. I...
2 years ago

Unit testing network calls (failing tests) - Swift

Swift
I'm trying to write failing tests for my network calls but can't find anyway to access the connection settings from within my tests. This code works...
2 years ago

Delgator's delegate property points to two Delegators and not to the Delegate class

Swift
I have the following class which conforms to a protocol SentenceDelegate class SentenceMarkov : SentenceDelegate{ var UltimateSentence : Sentence ...
2 years ago

Swift: Cannot subscript a value of type 'Array'

Swift
I have just started learning swift ios development. I am encountering this problem which I am not able to solve. Can someone please tell what I am doi...
2 years ago

Cannot link an IBOutlet for UITextField

Swift
I tried adding my an outlet on my Main.Storyboard and CTRL + dragged it into my corresponding view controller. class LoginViewController: UIViewContr...
2 years ago

Conversion from objective-c to Swift "->" operator

Swift
I am trying to convert some code from objective-c to Swift and am having issues with the following code. Can someone provide me a Swift Example. Linp...
2 years ago

How can I detect whether an iOS device is in silent mode or not?

Swift
I've been looking for hours and I can't seem to find any API that explains how to detect whether an iPhone ringer is in silent mode or not. This is wh...
2 years ago

Picture in picture button disabled

Swift
I'm developing a live video player and I want to use the new Picture in Picture option. I based the player on an AVPlayerViewController and this is my...
2 years ago

How do I access a nested JSON value using Alamofire and SwiftyJSON?

Swift
I am trying to access nested JSON results using swiftyJSON and Alamofire. My print value is nill and I believe I am not doing this correctly. What sho...
2 years ago

Why array returns nil after appending to it elements?

Swift
I'm trying to work with JSON as MVC model, for this I did: // Country.swift import SwiftyJSON class Country { var code: String! var dialCo...
2 years ago

How to get enum from variable in Swift

Swift
I have some enum for example let variable: String = "SALESMAN" enum Job { SALESMAN = "Salesman" POSTMAN = "Postman" } and I'm getting from da...
2 years ago

Comparing same dates returns OrderedAscending

Swift
Given this function: func isLessThanDate(dateToCompare: NSDate) -> Bool { var isLess = false print(self) print(dateToC...
2 years ago

Swift : Dropbox image upload fails due to RegEX pattern match failing

Swift
I am using SwiftyDropbox API to upload images to dropbox. I have image in project directory and trying to upload it like this : // Verify user is...
2 years ago

Excluding a property/field from fetching - Core Data

Swift
How do you exclude a field from fetching? For example I have 3 Fields: username : String? password : String? capturedImages : NSSet? of Images // I ...
2 years ago

Value of type 'CollectionViewCell' has no member 'imageView'

Swift
My build fails due to the following two errors Value of type ExploreCollectionViewCell has no member 'imageView' Value of type ExploreCollectionView...
2 years ago

Swift: Create button that leads to new view

Swift
I wanted to know how I'd programmatically, without the use of the storyboard, be able to make a button that when pressed leads you to another viewCont...
2 years ago

Swift error: Cannot call value of non-function type "SKSpriteNode"

Swift
I tried to translate this github code that was in Swift 1 to Swift 2. That makes a rope like in this video. My translated Rope.swift finished looking...
2 years ago