iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Swift Mirror reflection not returning properties on UIVIew

Trying to get all properties of UIView or UIViewController with the follownig: func propertysNames()->[String]{ var s = [String]() for c in Mirror(reflecting: self).children { if let name = c.label{ s.append(name) } } return s } This works on UIVIewController, but UIView does not seem to return properties, any advice?

Stop / Pause swift app for period of time

My app uses multiple threads of NSTimer Object. Within the one function (called randomly at random times, not a fixed delay) I want it to pause the whole app, pause the threads for 1 second only. I have the following code: [self performSelector:@selector(subscribe) withObject:self afterDelay:3.0 ]; Which is objective C, and I tried translating it […]

NSKeyedUnarchiver error after renaming Xcode project

I just renamed my Xcode project and when I ran it I got this error: 2015-11-14 05:32:42.337 Buck Tracker[3537:1456100] * Terminating app due to uncaught exception ‘NSInvalidUnarchiveOperationException’, reason: ‘* -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (iBudgeter.Record) for key (NS.objects); the class may be defined in source code or a library that is not linked’ […]

Swift: remove layer, without removing UIView in UITableViewCell

I have UITableViewCell with UIView in it. I made some CABasicAnimation and attach it to new CAShapeLayer, then I add this layer to my super layer in my UITableViewCell: self.layer.addSublayer(myLayer!) All nice except that myLayer (and his animation) showing above my UIView. I want that label be below UIView. I achieve this by adding my […]

SpriteKit: How can I get the pixel color from a point in SKSpriteNode?

I’m making a maze game and i’m using a SKSpriteNode as the actual 2d maze. I want to detect if the point on the SKSpriteNode a user is touching is black or white. I’ve made a UIImage which is the same image as the SKSpriteNode, and I’m using a method on the UIImage to get […]

AVFoundation exporting orientation wrong

I’m attempting to combine an image and a video. I have them combining and exporting however it’s rotated side ways. Sorry for the bulk code paste. I’ve seen answers about applying a transform to compositionVideoTrack.preferredTransform however that does nothing. Adding to AVMutableVideoCompositionInstruction does nothing also. I feel like this area is where things start to […]

Map Object into 2D Array Swift for TableView Sections

I could not figure out a better way of doing this. I am mapping all the properties of the Student Object into a 2D Array. So my TV has sections. I cannot use a Static Tableview either, if so this problem would not exist. So my code in the TVC let currentUser = PFUser.currentUser()! as! […]

iOS8 Swift UISearchController hides navigationbar

I implemented a search function for an UITableViewController like this: self.resultSearchController = ({ let controller = UISearchController(searchResultsController: nil) controller.searchResultsUpdater = self controller.dimsBackgroundDuringPresentation = false controller.searchBar.sizeToFit() self.tableView.tableHeaderView = controller.searchBar return controller })() The problem I’ve been experiencing is that if I click on it, my navigation bar and my navigationcontrollers header disappear. Is there a solution […]

App crash on device but works on simulator iOS

App wasn’t developed by me, but now I have to add some features. Code compiles add launches on simulator but immediately crash on real device (didFinishLaunchingWithOptions never calls). Xcode doesn’t show any errors. I think the problem may be in pods and frameworks but don’t know how to check if this so. I reinstalled pods […]

How to print the content of a variable type Data using swift?

This question already has an answer here: How to convert Data to hex string in swift 4 answers