Why is the data returning nil?

Swift
I am trying to access the data within an object, but I am getting a nil when I print it. Why is that happening and how do I fix it? print("card \(...
3 years ago

How do I detect when a user swipes in a certain direction on a specific node?

Swift
I have different 6 colored circles falling from the top of my screen. With each node, you are supposed to swipe in a different direction to score a po...
3 years ago

How can I create a navigation stack with TabBarViewController as the root?

Swift
My TabBarVC is the core of my app. I have 3 view controllers. Each view controller is "embedded" in a navigation controller. TabBarVC -> UINaviga...
3 years ago

Checking network status in Swift, observer does not get called

Swift
I have imported Reachability.h .m files like written here into my Swift project, but observer / event handler will not get called after start, why? f...
3 years ago

How to handle click event of BackBarButtonItem in nav bar? using SWIFT

Swift
I tried to handle an action when navigation bar back button is pressed. Yet I have set segue for it for another viewController. Though I need to main...
3 years ago

How to display 3 cell per row UICollectionView

Swift
As per the header, I'm using UICollectionView to display images. I need to display 3 cells per row, something like how Instagram does it. Because the...
3 years ago

swrevealviewcontroller navigation item and bar button missing

Swift
hello I have implemented SWRevealViewController in my swift app. The problem I am having is If I set SWRevealViewController as my initial ViewControll...
3 years ago

Spritekit - not loading @3x images from SKTextureAtlas

Swift
Since my sample project was deleted (I thought this would be much easier to test), I will post some code and images to illustrate my point. Here are ...
3 years ago

How do I change the z index or stack order of UIView?

Swift
I've stacked a UIView on top of an existing controller in an effort to create a gradient layer. However, when I load the view the new UIView (naturall...
3 years ago

Remove all children, how to make exceptions

Swift
I'm looking for a simple way to make exceptions when removing all children from its parent Node. Like: "Remove Tom, Ted, Tony,. but keep Lisa"
3 years ago

Check if array is nil / or has been loaded in Swift / iOS?

Swift
What is the best practice to check if an array of objects has been loaded in Swift? Say, if I declare an array in a class, and it is lazily loaded. A...
3 years ago

Swift 2.0 Get Mirrored Superclass Properties

Swift
I need to get the properties of my class as a dictionary. For simplicity, I created a protocol which has a default implementation as follows: protoco...
3 years ago

Navigation bar not appearing?

Swift
I am currently using a form building library called Eureka(https://github.com/xmartlabs/Eureka) and for some reason whenever I build a form,the navig...
3 years ago

Are the words Element and Sequence reserved in Swift?

Swift
In my (chemistry related) project, I'd like to use the words Elementand Sequence for data structures. Will there be a conflict with the same names tha...
3 years ago

Why does this random function code crash on an iPhone 5 and 5S.

Swift
I have view that displays an image in the background. The image is picked from an array of images and I am using a random function to pick them. On do...
3 years ago

Compiler condition for target membership running in Swift?

Swift
There is the available compiler check in Swift that was introduced in Swift 2.0, but it doesn't seem to work with Target Membership. For example, I ha...
3 years ago

Cannot convert from UITableViewCell to specified type

Swift
I am converting an app from objective-c to swift. I did not write the objective c code. One if the functions which code is below... func tableView (t...
3 years ago

How to print a string from plist without "Optional"?

Swift
I load a value from a dictionary in a plist but when I print it to the console, it prints: Optional(Monday Title) rather than just "Monday Title". Ho...
3 years ago

How do I add a tuple to a Swift Array?

Swift
I'm trying to add a tuple (e.g., 2-item tuple) to an array. var myStringArray: (String,Int)[]? = nil myStringArray += ("One", 1) What I'm g...
3 years ago

Getting response data from Alamofire error

Swift
I've been using Alamofire in one of my iOS projects, but recently when upgrading to Alamofire 3.0 the format changed slightly for returning results. I...
3 years ago