image for nav bar button item swift

Swift
I want to display an image in the left hand side of my nav bar in swift. I have tried adding a nav bar button item and setting an image there. The p...
3 years ago

Difference between declaring a variable in ios Swift?

Swift
I am learning Swift recently and I found that there are two types of declaration for a variable. var indexArray = NSMutableArray() //and var ind...
3 years ago

Trim end off of string in swift, getting error at runtime

Swift
I'm making a calculator app in Swift, once my answer is obtained I want to display it in a UILabel. Only problem is I want to limit said answer to 8 c...
3 years ago

how to hide tab bar when push and show tab bar when back. swift

Swift
I want view controller 1: tab bar is showed view controller 2: tab bar is showed view controller 3: tab bar is not showed. I wrote // prepareFor...
3 years ago

How can I only have one item highlighted?

Swift
I have a collection view of labels and you can select a label. Currently you can select as many as you like, but I want to limit that to only one. Onl...
3 years ago

Passing coordinates of selected Annotation to new View Controller Swift 2.0

Swift
I am trying to pass the coordinates, title, and subtitle of a selected MKAnnotation from ViewController1 (VC1) to ViewController2 (VC2) when the Detai...
3 years ago

Find key-value pair in an array of dictionaries

Swift
I have two arrays of dictionaries. I want to iterate through the first array by searching for either 1) the entire dictionary or 2) a key-value pair w...
3 years ago

Swift compiler 2.1.1 hang forever on dictionary

Swift
I was building a class for a sqlite library, and suddenly the compiler hang forever. I finally get a test case for it, and found is related to a dict...
3 years ago

How to access the index of the selected cell in UICollectionView

Swift
I have a few cells in my UICollectionView in which I create buttons: func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath ind...
3 years ago

Uber API sandbox request status is not updating correctly

Swift
I'm building an iOS app with Swift that uses the Uber API ride request endpoint. Using Sandbox I'm having trouble changing the ride request status pro...
3 years ago

Ambiguous use of subscript using [indexPath.section][indexPath.row]

Swift
After I updated to Xcode 7.2 an error popped up saying "Ambiguous use of subscript" at the following: func tableView(tableView: UITableView, cellForR...
3 years ago

Swift - TableView, change font of even rows to bold

Swift
I have a tableview and i want to change the font of even rows, Here is my code: func tableView(tableView: UITableView, cellForRowAtIndexPath indexPat...
3 years ago

Create JSON Object from Class in Swift

Swift
I'm pretty new to iOS development and Swift (so please bear with me). I have a class object defined like this: class LocationPoint { var x: Doub...
3 years ago

Swift 2: Spawning a new sprite every 30 seconds

Swift
Looking for a method to spawn a new sprite in the center of the screen every 30 seconds. And it has to be affected by gravity. I have managed to spaw...
3 years ago

How to get an array of JSON objects from NSData object

Swift
So I'm using an HTTP GET method which returns an array of JSON objects, which are stored in NSData. The array looks like this: [{"created_at":"2013-...
3 years ago

return data in DetailTableView (swift)

Swift
In my app I have two table views. The first table view has a set number of cells. These cells will always be the same and will never change The above ...
3 years ago

How to group search regular expressions using swift

Swift
In regular expressions you can group different matches to easily "pattern match" a given match. while match != nil { match = source.rangeOfString(r...
3 years ago

Swift language NSClassFromString

Swift
How to achieve reflection in Swift Language? How can I instantiate a class [[NSClassFromString(@"Foo") alloc] init]; ...
3 years ago

CMMotionActivityManager authorization status

Swift
I'm trying to figure out a way to handle the authorization statuses for Motion activity Here's what I came up with so far : manager = CMMotionActiv...
3 years ago

How to record date, time, and score in swift

Swift
I am creating a simple quiz app. I am planning to show some kind of "history" where the user can see the following: Date and time of playing Score f...
3 years ago