Keep active cell in collectionview in one place

I'm working on a tvOS application where I want the active cell of a collectionView always in the same position. In other words, I don't want the active cell to go through my collectionView but I want the collectionView to go through my active cell. ...
more »

2017-08-17 23:08 (1) Answers

Swift OSX Audio pass thru while recording

I'm programming in Xcode 9 - swift 4 - macOS NOT IOS I have a basic recording audio setup below for recording a singer with headphones and a microphone. I would like it to react like Logic X. In Logic X you put the track you want to record into rec...
more »

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

Animated shadow in Swift?

My app shows an animation of rotating fan blades in front of the fan body and background. The image of the blades is a PNG with transparency residing in a UIImageView and I have no problem applying a drop shadow to it, or making that view rotate nic...
more »

2017-08-17 17:08 (0) Answers

Why my code does not go to the next view

No error at debug. The code does not proceed to the next page after the login is accepted... help pls if (emailValue == userEmail || passValue == userPassword) { //store user information in the app to maintain session let defaults = UserDe...
more »

2017-08-17 15:08 (1) Answers

Swift 4 collection of Codable objects

I have a Codable class with a variable that holds a dictionary with String keys and values that may be Strings, Ints or custom structs conforming to Codable. My question is: How do I define a dictionary with values that are Codable? I hoped it woul...
more »

2017-08-17 14:08 (2) Answers

Root class of all classes in Swift?

The Apple's developer documentation says: NSObject is The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system. I wonder what is the root class of all classes in Swift in the ...
more »

2017-08-17 12:08 (1) Answers

Create several buttons

I want to create 10 buttons in the ViewController. These buttons move the user to the next ViewController. If I use a storyboard, do I have to create 10 buttons or is there an easier way to solve the problem? It should also satisfy following conditi...
more »

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

how to handle backspace in uitextfield

I have 6 uitextfield.And i did the autofocus. once user enter one value in one textfield.They will automatically redirect to next textfield. But i dont know how to handle the backspace .Like when user in last textfield and press backspace to delete t...
more »

2017-08-17 10:08 (4) Answers

Swift - layout - stretch UILabel

I have this layout with UILabel and UIImageView: I want the UILabel to have maximal possible length, while UIIMageView minimal. Basically, I want "xxx" label to be stretched and have same width as "text_1_____xxx" label. How to achieve this? Elem...
more »

2017-08-17 09:08 (3) Answers

Get WatchOS Digital Crown value

I've been doing some research about making Apple Watch apps, but I'm having some trouble getting the value of the Digital Crown. I looked at the WKCrownSequencer but not sure what to do with it. Could someone show me how I would go about getting a va...
more »

2017-08-17 06:08 (2) Answers

Do not copy swift libraries with Xcode 8?

How to not automatically embed Swift dynamic libraries in Xcode 8? I've tried setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to "No" (defaults to "No" anyway) yet it still copies Swift dynamic libraries into the app bundle. I'm creating a helper app...
more »

2017-08-17 00:08 (0) Answers

Swift Get UIImage from layers of UIView

I have CAShapeLayers in my UIView and I want UIImage from the view. So I am trying thru below function but getting an error at UIGraphicsGetCurrentContext() extension UIView { func getImgFromVyuFnc() -> UIImage { UIGraphicsBeginIm...
more »

2017-08-17 00:08 (1) Answers

Read text file from network URL

My code currently looks like import UIKit if let url = URL(string: "https://s3.eu-west-2.amazonaws.com/sliptip/test.rtf") { do { let contents = try String(contentsOf: url) print(contents) } catch { // contents could...
more »

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

actual date plus 14 days

i working with swift 3 for osx. i have this calendar: this calendar should show the actual date plus 14 days. Generally it is correct, because 30 - 16 = 14 days between. this is my code for this: datePicker.dateValue = Calendar.current.date(byAd...
more »

2017-08-16 16:08 (2) Answers

Realm RLM Exception when calling Realm()

I am using Realm for swift 3.1 and have imported it via import RealmSwift and import Realm. When I this line is executed in my swift code I get this error let realm = try? Realm() (or ...= try! Realm()... or let r = ...) >2017-08-16 19:39:53.66...
more »

2017-08-16 14:08 (1) Answers