Tag: swift

Passing data of table view (row select) to view controller

mi problem is this: I want to select the first, second… row and the view controller must show the information according to the row selected(label, images, etc), I trying a lot of thing but, not work. I use protocol and this: func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 4 } func […]

Auto-Resizing tableViewCells in iOS8 still truncate UILabel text

I have been trying to use the new way to resize UITableView cells in iOS8 and to an extent, it works. I first make sure that the label is attached to the cell’s container view at the top, bottom, trailing side and leading side which i was told to do on an online tutorial, though […]

Swift 2 Cannot invoke 'FSEventStreamCreate' with an argument list of type

Using Swift 2 and Xcode 7 beta 2 (Build: 7A121l) I get this compile error using FSEventStream API and @convention(c). Any advice would be awesome, thanks! internal class FileSystem { init () { let allocator: CFAllocator? = kCFAllocatorDefault // Create FSEventStream and return valid FSEventStreamRef // Alias FSEventStreamCallback – CFunction typealias FSEventStreamCallback = @convention(c) (ConstFSEventStreamRef, […]

Getting path for resource in Command Line Tool

I’m trying to get the path of a resource in a Command Line Tool in Xcode (8 beta 2). Here’s what I’ve got: The resource, file.xyz, has been dragged into the project and the target membership matches the main project. Under Build Phases -> Copy Files, the destination is set to “Resources” and the subpath […]

Swift Generics: More specialized than generic?

XCode 6: Beta 5: Goal: I am trying to write generic code for types that are semantically compatible but do not share (or appear to share) sufficient protocols to base my generics on a subset of shared protocols. So far, I have not been able to find a solution, and am wondering I am missing […]

How to import LinkedIn SDK in a Swift project?

I need to add the LinkedIn SDK into my Swift project. I’ve downloaded their latest version (1.0.4), dragged and dropped the SDK files into XCode (with “Copy items if needed” and “Add to target” checked). I can see the framework in the “Linked Frameworks and Libraries” section of my target. I’m stuck though when I […]

_GSRegisterPurpleNamedPortInPrivateNamespace – App Store Crash (code attached)

After 3.5 months on the App Store, I got my first crash report. This was discovered in iTunes Connect this morning. Within XCode, I went to Window > Organizer > Crashes > [App + App build that reported the crash]. The first screenshot below is the crash report GUI: I then clicked “Open in Project” […]

Swift and Parse (and xCode) problems

Get some troubles with Parse and Swift. I’m trying to use Facebook Login with Parse class PFFacebookUtils. That’s the code: // LOG IN or SIGN UP with FACEBOOK @IBAction func FacebookLogin() { PFFacebookUtils.logInWithPermissions(permissions, {(user: PFUser!, error: NSError!) -> Void in if error == nil { if user == nil { NSLog(“Uh oh. The user cancelled […]

How do i keep the header cell moving with the tableview cells in Swift 2.0

I am trying to create a tableview which starts the header in the middle of the tableview and then can be scrolled up with the added tableView Cells to the top then stops, and then the tableview cells can just scroll “under” it. I got the header to be in the middle of the tableview, […]

Mouse events (NSTrackingArea) in Playground not working

I have a a subclass of NSView which contains the following NSTrackingArea code. But for some reason the mouse events won’t trigger in Playground. The viewWillMoveToWindowis being called, but nothing else seems to fire. Does anyone have a clue to what is missing? class MyView: NSView { private var trackingArea: NSTrackingArea = NSTrackingArea() // Other […]