Segmented control does not work as expected on segment 0

I have a segmented control that alters 5 images on one of my View Controllers (see image below) but I want Segment 0 to be selected straight away when someone goes into the Casting Tab. At present it only gets selected when i go onto either Segment 1

How to delete all UserDefaults data? - Fast

This question already has an answer here: Delete all keys from a NSUserDefaults dictionary iOS 14 answers I have this code to remove all UserDefaults data from the app: let domain = Bundle.main.bundleIdentifier! UserDefaults.standard.removePersistent

indexPath.row does not receive data from the table

I've created a PFQuery to get some strings from my parse server and the put this in a couple of arrays var packsAvailable = [""] var packsImage = [""] var packsDescription = [""] If I print the value of the array in the for l

How to find the simulator directory

I'm looking for the specific location in the filesystem of the iOS simulators that were downloaded via Xcode. I've been looking in the usual locations like /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs o

Sort alphanumeric table Swift3

I have a function I was using in Xcode 8 Beta, which sorted an array alphabetically then numerically. The function I used was: func sortArray(arrayToSort: [String])->[String]{ let sortedArray = arrayToSort.sorted { (first, second) in first.compare(se

NSFastEnumerationIteration.member Swift 3

I have some difficult to convert my Swift 2.2 app to Swift 3.0. I have some errors and I don't find the solution yet. Currently, my worst problem is with NSFastEnumerationIteration, I try to get records from JSON but with this error I can't. This is

Retrieve paired devices that are connected via bluetooth in iOS

I have connected Barcode Scanner device Barcode Scanner Information I want to know the paired status of it. Whether it is connected with device or not. - (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripher

Scroll down the table view when you use the dynamic cell height

How can I scroll my table view to the bottom when using dynamic cell height? For some reason this code does not work in this scenario: [self.tableView scrollRectToVisible:CGRectMake(0, self.tableView.contentSize.height - self.tableView.bounds.size.he

How to add a custom UIView to running UITableViewCell?

I have a TableView having multiple custom cell. I want to add custom View on top of the cell runtime. I have cell like this. Now I want to add the HR Channel top view on the same cell runtime so that the it should look like this. As example : Think a

How to press more icons in a navigation bar or toolbar

I am trying to get just one more icon into my Navigation Bar, but can't figure out how to adjust the width to get more room. Using standard BarButtonItems and using the storyboard to build, there seems to be a limit of 14 icons in portrait mode on iP

Reset the current NavigationController and present another tab

I have an app (with a UITabBarController) that can reach the final payment view via two tabs, each with their own NavigationController. (The illustration only shows the two tabs in question) When payment is successful I want to reset both NavigationC

Alpha does not change the barTintColor of UINavigationBar

I want to set the color of UINavigationBar to black with alpha 0.6 to see my interface. But if i use this code: self.navigationController?.navigationBar.barTintColor = UIColor(red: 0/255, green: 0/255, blue: 0/255, alpha: 0.6) self.navigationControll

direction in building a block function for iOS

I have built a self destructing messaging app with Parse.com and now i want to create a blocking feature to stop any unwanted messages from people i do not want messaging me. what i already have: NSString *usernameBlock = [self.blockUser.text]; PFUse

How to unload self.view of UIViewController in Swift

According to View Controller Programming Guide, we can explicitly unload self.view from UIViewController by assigning nil to self.view. But in Swift, view property in UIViewController is declared as var view: UIView It's not UIView! and thus followin

How to create an empty SKSpriteNode in Swift?

How do I create an empty SKSpriteNode in Swift? I need a SKSpriteNode which I can add SKSpriteNode children to. The equivalent of this in Objective-C: SKSpriteNode *textSprite = [SKSpriteNode new]; Let type inference do the work of figuring out the t

Access the database using sections in UICollection

I am developing small application in iOS (I am complete beginner). I have made a menu Core Data entity where I have categoryName and imageNamed saved. I want my UICollectionView in sections. But I am stuck in defining different indexPaths for differe

How to remove extra spaces above UITableView?

I'm have been trying to get the header of the table scrolling along with the UITableView. It's finally working, however, now there's a whitespace showing up right under the map view (see screenshot). I had difficulty getting the map in the table head

How to save data in iOS

I'm making a game and when I close the app (close at multitask manager), all my data is gone! So, My question is very simple: How do I save the data?Let's say you want to save score and level, which are both properties of an object called dataHolder.

How to get the remaining download time of asynchronous request?

I m trying to upload an Image from iPhone to Server. I m Able to Do so But i need to show an Indicator.My code is NSData *imageData = UIImageJPEGRepresentation(newImage, 90); // setting up the URL to post to NSString *urlString = [NSString stringWith

view on the top of the table appears below

I have a on top of my tableview another view with 3 buttons on it. You can see my storyboard over here. When I build and run. This view shows up at the bottom of my tableview. Someone has an idea how this is possible? Kind regards.Your UIView is subv

Is the database updated when an application is updated?

I have an App in my Device, that contains database, if I update that app from the App Store, then database of App will be updated or it uses the same database of previous App.If you stored your data in NSDocumentDirectory or NSLibraryDirectory, your

Downloading large files with AFNetworking?

Im working on a app that generates large files (100Mb+) that I would like to upload to a web server. By loading the file in to a NSData object that will kill the app due to memory usage (which is the only way I see in the AFNetworking docs), is there

How to clear the contents of the subview before drawing

i use two blocks to draw some buttons on my subview dynamically. One calculates frames for Portrait mode and the other does for Landscape. It works well but when i rotate, it writes over the old ones. Hence, some of my buttons come twice. Here is my

Does the iCloud API allow access to the music library from iOS?

I understand that not all information is official yet, and that some information about the new OS is under lock and key, but is it publicly known yet whether the iCloud API will support iOS app access to the user's cloud music library?It has not been