Taking a screenshot and adding a text/watermark on top in Swift

Swift
Im trying to allow the ability for a user to share a screenshot of an App and share it. I have got the taking of a screenshot and sharing but was inte...
3 years ago

Play Audio when device in silent mode - ios swift

Swift
I am creating an application using xcode 7.1, swift. I want to play an audio. Everything is fine. Now my problem I want to hear sound when the device ...
3 years ago

How to convert code objective c to Swift to save image?

Swift
I have seen this code in other post, for save pictures: // Create path. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, ...
3 years ago

Swift two question marks optional chaining

Swift
I'm experimenting something with an optional chaining and two question marks but I can't understand one thing. I have this part of the code: if let d...
3 years ago

Calling parent method from a class

Swift
I am fairly new with Swift and iOS development so please excuse any/all statements and terminology used... I am creating a new Downloader object (sim...
3 years ago

How to achieve same behavior as with strongify in Swift?

Swift
I have a closure with a weak self, I need to ensure that self will be retained during execution of closure, and released by closure after execution is...
3 years ago

Swift 2.0 - Unable to Write to Text File (OS X)

Swift
I have a text file that I will be reading and writing to. I have gotten the code to read successfully, but am unable to write to the text file again....
3 years ago

print without newline in swift 2.0

Swift
In swift 2.0, print() automatically adds a newline character. In swift 1.2, println() and print() used to be separate functions. So how do I print som...
3 years ago

Contextual type 'AnyObject' cannot be used with dictionary literal?

Swift
I am in the process of trying to convert an Objective-C example to Swift 2, but I am running into a small issue. The original Objective-C snippet: NS...
3 years ago

Removing lagging latency during continuous period of drawing UIBezierPath in Swift

Swift
The code below draws lines by overriding touches, however lagging begins to occur over a period of continuous non stop drawing. This lagging accumulat...
3 years ago

How to add circular mask on camera in swift

Swift
Now I am swift newbie but I want to learn how to add circular mask on Camera in swift. Now I am using Xcode7.2.1, swift 2.1, but I have no idea for th...
3 years ago

Changing ScrollViews subview dynamically in iOS 8

Swift
I'm using a ScrollView in my main page to scroll vertically the content in an view like this (Ipad resolution) : For this I set a View in the top a...
3 years ago

Confusion Regarding Overriding Class Properties in Swift

Swift
I have read the Swift docs and searched here, but I still am not sure about how to implement a class hierarchy where each subclass sets custom value f...
3 years ago

How to add multiple subviews on view without hiding the last added subview?

Swift
This is my code var button = [UIButton?](count:3, repeatedValue: UIButton()) for i in 0...2{ button[i]!.tag = i button[i...
3 years ago

Use of unresolved identifier '_ComboItemId'

Swift
Hello friends I am getting a strange error while creating a model class Though i have created the class it shows an error any suggestion !! Thank you...
3 years ago

How to change return button to Done in UIAlertViewStylePlainTextInput Xcode

Swift
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:APP_NAME message:@"Please enter amount" ...
3 years ago

Space issue with UIBarButtonItem

Swift
I am trying to add a Cancel UIBarButtonItem to my navigation bar using following code: func setupNavBar() { self.navBar = UINavigationBar(frame: ...
3 years ago

How do I know how to confirm to a specific protocol in Swift?

Swift
When I declare a class that I want to conform to a protocol, Swift will show me a message saying that I don't conform to that protocol until all of th...
3 years ago

Binary operator '==' cannot be applied to two `CGAffineTransform` operands

Swift
I am trying to compare transform value like this but there is a compiler error Binary operator '==' cannot be applied to two CGAffineTransform ...
3 years ago

Swift: Only appendContentsOf to unique elements

Swift
Given two array var array1 = [['id':0], ['id':1], ['id':2], ['id':3]]; var array2 = [['id'=3], ['id':4], ['id':5], ['id':6]]; how can I do a arr...
3 years ago