Swift dates are equivalent under 30 nanoseconds

I noticed that when comparing two instances of a Swift Date with ==, they qualify as the same date when the difference in DateComponents.nanoseconds is less than 30. For example: let calendar = Calendar(identifier: .gregorian) let startComps = DateC...
more »

2017-09-11 20:09 (1) Answers

Adding a UICollectionViewController inside UiView

Hi am new to Ios development and I am trying to develop a simple view with imageView, pickerView and collectionView. I have a separate UICollectionViewcontroller, I want to add that UIcollectionviewController inside the UiView in New MainVC. When ...
more »

2017-09-11 08:09 (1) Answers

DispatchQueue not working in while loop

Edit: I once I restarted the computer and tried the simulator agian terminal displayed the message, Terminal has detected that the system is running low on swap space. Scrollback buffers may automatically be timmed to conserve swap space. I am not ...
more »

2017-09-10 21:09 (0) Answers

iPhone and Apple Watch not sharing App Group

I've been pulling my hair out over this problem for two days now. I generate a small movie file in the iPhone App that I want to send from the iPhone to play on an Apple Watch. As I proof of concept, I put a similar .mov in the Bundle of the Apple ...
more »

2017-09-10 14:09 (1) Answers

WKWebView add as a subview

From iOS 8.0+, I am supposed to use WKWebView, but in the official Apple documentation, they add it by setting the view as the WKWebView. I need to add it as a subview, for numerous reasons. I have to add buttons/labels above the WKWebView. I can a...
more »

2017-09-10 13:09 (1) Answers

Move view with keyboard using swift 3

I have an app that has a text field on the lower half of the view and I have a navigation controller bottom of page. How would I go about moving the view upwards while typing so I can see what i'm typing and then moving it back down to its original ...
more »

2017-09-10 12:09 (1) Answers

Smooth custom paging for UIScrollView

I have two (possibly more) views in a UIScrollView and want to use paging with it. The problem arises when I try to use the default Paging option for UIScrollView, since the views have different widths it can not page properly. So I have implemente...
more »

2017-09-10 10:09 (3) Answers

How to change navigationBar height in iOS 11?

Apparently changing the navigationBar height faced a new approach in iOS 11. in previous iOS versions it was possible to change the navigationBar height by hiding the default navigationBar and adding a new one with custom frame: self.navigationContr...
more »

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

How to zip app after Xcode adds Swift libraries?

Try this: git clone git@github.com:walles/bubblemon.git cd bubblemon git checkout walles/swiftify git checkout 708e8dc96e5f3ceae234f7ebe4b19872dae25392 Now look at the Bubblemon Build Phases and notice how the zip script invocation is the last of ...
more »

2017-09-09 19:09 (0) Answers

To-Do list Share with Friends?

I have a To-Do list and want to share it with friends and they can edit the list and add some tasks or delete some. What do i need to share to Dropbox or to some other clouds? Maybe a cocoaPod? And how is it possible that everyone can edit the fil...
more »

2017-09-09 19:09 (0) Answers

How to create SDK for iOS in Swift?

I have my own Xcode project which contains some controllers. I want to make its SDK, for use it in another application. In parent application it works as child. Parent app will share some data with my controller and my controller works on it and give...
more »

2017-09-09 08:09 (1) Answers

Capture UDP packets while iOS app is in background

I have a simple UDP client program bound to a port which takes CallerID information from a UDP broadcast that is sent by hardware purchased by the app's user. While the application is in the foregound everything works fine, but when the application i...
more »

2017-09-08 22:09 (0) Answers

How to clear the ImageView?

I know how to clear the imageView when panning but when I do it clears the image with sharp edges but what I want is to clear the ImageView with soft/smooth edges when panning on the ImageView in iOS using Swift3 ? Hope I am clear with my question. ...
more »

2017-09-08 11:09 (1) Answers

Safely unwrap optional value

I am using this code to create a new array of colors. Everything is working fine. But I don't want to force unwrap $0.color! because the app crashes sometimes when the value is nil. How can I leave it as an optional? If I just delete the ! I get ...
more »

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

Is there any way to override guard statement?

I know it looks impossible and also may get negative marks for that but still I want to know if we can do something to override the guard statement so that we can get method call whenever we call guard statement. For Example - guard let string = t...
more »

2017-09-08 08:09 (1) Answers

Swift 4 Decodable - Additional Variables

Something I havent figured out or have been able to find online as of yet. Is there a way to add additional fields onto a struct containing the decodable protocol in which are not present in the JSON Data? For example and simplicity, say I have an ...
more »

2017-09-07 22:09 (1) Answers

swift animate spritekit with damping effect

I've been searching on the internet for several days, I didn't find what I'm looking for. I'm working on an iOS game and I would like to move some sprites using usingSpringWithDamping (to have some rubber effect when moving my sprites). I have found...
more »

2017-09-07 21:09 (2) Answers

Swift - iOS 11 Translation

I'm currently testing my app on iOS11 and I spot a problem in a controller where I translate a view. The controller is composed of a table view at the top and at the bottom a field to type text. On iOS9 & 10, the following code allows the bottom ...
more »

2017-09-07 11:09 (1) Answers