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

How to save a UIImage to documents directory?

I’m trying to save both a recorded video’s file path, and a thumbnail from the video to the documents directory. Then, set those two values to an object using the file paths so I can use the object to populate a collection view. With the code I have currently (below), after I record a video, […]

UITableView Drag & Drop Outside Table = Crash

The Good My drag & drop function almost works wonderfully. I longPress a cell and it smoothly allows me to move the pressed cell to a new location between two other cells. The table adjusts and the changes save to core data. Great! The Bad My problem is that if I drag the cell below […]

UISearchBar Scope Bar Position?

I am here on an iPad Application and i would like to know if its possible to move the Scope Bar from right to my UISearchBar to another position? I would like to have my Scope Bar under my Search Bar. Is that possible? Thanks in advance.

Swift error using initialized properties in expressions before super.init

This isn’t critical, and there are workarounds, but it is perplexing. See the minimal example below. I’m referring to an initialized property, but before calling super.init(). Why does the indicated statement below have a compile error? Is there something special about using the property in the right hand of an expression versus the left hand? […]

How to present a ViewController with a UIImagePickerController

I’m attempting to present an ImagePicker, and there after the user has selected an image, present an image editing ViewController where the user can manipulate the image and then send the edited image back to the original ViewController. Question: Is there a standard or best practice approach starting with an initial ViewControlle, then present an […]

SKTexture nearest filtering mode doesn't work (Making Pixel Art)

I used a relatively small image (44pixel tall) and scaled it up to have a pixel art look. I tried to change the filtering mode to nearest so the anti-aliasing would disappear but it didn’t. It appears with blurry edges. I tried the same with a background getting the same result. let myNode = SKSpriteNode() […]

Error: Value of type string has no member componentsSeparatedByCharactersInSet

The following code throws the following error: “Value of type string has no member componentsSeparatedByCharactersInSet” This code is from another project that worked before in swift versions 1 or 2 but no longer works. import Foundation extension String { func split() -> [String] { return self.componentsSeparatedByCharactersInSet( CharacterSet.whitespaceAndNewlineCharacterSet()) .filter({$0 != “”}); } } extension Array { […]

Send Image and Text With Whatsapp

I need to send an image from my app with a text, I know how to send just an image or just a text, but I don’t know how to combine both of them. Just an Image: let image = UIImage(named: “Image”) // replace that with your UIImage let filename = “myimage.wai” let documentsPath = […]

Implementing NSValueTransformer for Transformable attributes in Swift

I’m trying to implement a NSValue Transformer, which should help me to save an Double Array into Core Data using a Transformable attribute. So I tried to implement the transformedValueClass. But NSArray.class() is crossed out. Unfortunately I didn’t find a reason for this. My method looks like this class PacePerK:NSValueTransformer{ class func transformedValueClass() -> AnyClass! […]

Swift – Integrate GameCenter to use leaderboards

I am making a game in Swift. I want to be able to post the users’ score using GameCenter, so that scores from all my users’ can be seen. However, I have spent the past day trying to figure out how to do this, but I haven’t found any helpful instructions. I am pretty new […]