Compile Swift to WebAssembly

The LLVM infrastructure now supports compiling from LLVM IR to WebAssembly (at least experimentally). Swift uses the LLVM compiler infrastructure and can easily be compiled to LLVM IR. So I thought it would be straightforward to compile some Swift co...
more »

2017-10-04 20:10 (0) Answers

Photopicker & FB GrapSharer issues in iOS 11

My code was working fine on iOS 10 but after updating to iOS 11 nothing seems to work. This is my code For sharing video on facebook : internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [Strin...
more »

2017-10-04 12:10 (0) Answers

Loop is taking too long to process

I am using following to code to arrange the array of contacts in sections (for e.g. contact with prefix "A" should show under "A" section). If there are contacts 4-5 hundred then it takes 20 sec to process. Can you please check what is issue here? ...
more »

2017-10-04 09:10 (2) Answers

Swift Initializer Mystery

Few blocks of code: This works: import Foundation class Class1 { init(param1: String?) { print("hello") } convenience init() { self.init(param1: nil) } } class SubClass1: Class1 { } let obj = SubClass1() In th...
more »

2017-10-04 08:10 (1) Answers

print a web view content with a static header

Notice: I am working with with swift 4 for macOS. I have a NSTableview which can fill with data and save into core data. This tableview values I would like to print with a "design". I realize it like this: created a html template get the html code...
more »

2017-10-04 08:10 (0) Answers

CFSocket in Swift (4)

I try to establish a connection to a TCP server, unfortunately without success. Here is my actual way. Does anyone knows, where the error is? I'm getting the error at CFSocketConnectToAddress (I get the .error result, so my code results in the error ...
more »

2017-10-04 08:10 (0) Answers

Adding objects to nsmutablearray swift

I added the string objects inside the mutablearray : let photoArray: NSMutableArray = [] for photo in media { photoArray.add("\(photo.fileName ?? "")") } Then I get an output like: <__NSSingleObjectArrayI 0x1c02069e0>( ( "Car", ...
more »

2017-10-04 06:10 (1) Answers

How can I stop video when user is scrolling

I have a tableView which gets data from the database. Some of the cells in my TableView contain videos in them and when we come across a video it displays properly. My issue is that if someone keeps scrolling then that video still keeps playing. I w...
more »

2017-10-03 18:10 (1) Answers

Give UITextView a clickable URL link

Hi I've been on this problem for a while now, I read a couple of posts already an I can't understand how to make a clickable UITextView that sends on internet. Here is my code: func transformText(text: String, underlined: Bool, linkURL: String) ->...
more »

2017-10-03 16:10 (3) Answers

Show image in text field

I have added button in accessory view of text field. On click of this button i want show the image/icon in text of text field. How can i do this? I tried this : let fullString = NSMutableAttributedString(string: self.text ?? "") let image1Atta...
more »

2017-10-03 16:10 (0) Answers

Location Access Request in iOS 11

I am requesting the user location in my app. locationManager.requestAlwaysAuthorization() This line of code should return this alert message: However, I want the user to choose between "Don't Allow" and "Always Allow" only. how can I delete th...
more »

2017-10-03 15:10 (2) Answers

How to set unsafe area background color for ios 11

Creating some new view controllers with xcode 9 so now I have a few safe areas to deal with. I am currently trying to do something fullproof, meaning keeping the unsafe area as it is (since I always display the status bar) and having the background ...
more »

2017-10-03 12:10 (2) Answers

Ambiguous use of 'initialize()'

I am using third-party library which is implemented on objective c. I have to develop application in swift. The library code which I have to use is 'initialize' @interface VidyoClientConnector : NSObject {} +(BOOL) Initialize; +(BOOL) Set...
more »

2017-10-03 10:10 (1) Answers

Swift generic protocol function with self

I have a generic class that conforms to a delegate protocol. I want to be able to pass self in the protocol methods, but I can't figure out how. protocol BodyPartManagerDelegate: class { func doit(manager: BodyPartManager<Any>) } class B...
more »

2017-10-03 06:10 (1) Answers

Boxing Count-up / delay / timer

I created a boxing simulation and am now going back to add in animations. Now, I am adding a "Ref's Countup" to add suspence. I have tried numberous things, but none have gotten what I want. I tried the: Thread.sleep(forTimeInterval: 1) knockdown...
more »

2017-10-03 06:10 (1) Answers

How use Objective-c method in my Swift Class

Hello I want to use this method inside my swift class, already create the header, but I only manage to access the method (setApiKey). this is the code in objective c #import <Foundation/Foundation.h> @class CLQResponseHeaders, CLQError; @clas...
more »

2017-10-03 05:10 (0) Answers

Open Safari from XCTestCase

According to Apple's documentaion, I should be able to launch an app based on its bundle ID using the code below. // Open safariapp let safariApp = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari") // Launch safari app safariApp.launch() ...
more »

2017-10-02 22:10 (1) Answers