OpenCV read files in Swift IOS project

I am trying to read "classifications.xml" and "images.xml" from a tutorial which was working fine in a VisualStudio project. How do I point the C++ library in my Swift XCode project to the files now? Drag and dropping them into the project did not wo...
more »

2017-04-19 21:04 (1) Answers

Integrating Vapor and React

I'm building a classic database backed, dynamic website, that will allow users to share leads. I'm a little old school, and want to implement my system using a pure MVC architecture. I'm considering using React in a pure 'V' mode, with Vapor fulfil...
more »

2017-04-19 21:04 (0) Answers

PromiseKit with optional promises

I am currently investigating if I should integrate PromiseKit in an existing project. My main issue is that I need to implement a business logic that can call up to 5 web-services. Some of them are called depending on the result of previous ones. M...
more »

2017-04-19 16:04 (1) Answers

Inheritance Protocol with associatedtypes

I have protocol 'MK' with associatedtype 'Heroe'. Protocol 'Heroe' has constaint protocol 'Kan'. If I remove constaint 'Kan', then code is compile. Why error occurs? This code has compiled error. public protocol Kan { } public protocol MK { ...
more »

2017-04-19 13:04 (0) Answers

Changing a Views textLabel from a different View

I have a custom class called colorChangerViewClass that inherits from UIView: class colorChangerViewClass: UIView { @IBOutlet weak var controller: ViewController! override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { ...
more »

2017-04-19 13:04 (2) Answers

Combining tab bar controllers and nav controllers

I'm just learning how tab bar controllers and nav controllers work together. I have the following storyboard but I've also experimented with nav controllers too but can't seem to make things work how I want: I have added a segue between the table ...
more »

2017-04-19 11:04 (1) Answers

Setting time for tomorrow in Swift 3

I need to get a Date object set for tomorrow at a certain time. I can figure out how to change the date to tomorrow but not how to set the time. Here is my function: func getTomorrowAt(hour: Int, minutes: Int) -> Date { let calendar = Calendar...
more »

2017-04-19 11:04 (2) Answers

Xcode scene editor bug - applyImpulse bug?

I'm working on a new tvOS game using the scene editor in Xcode. Is there any reason why applyImpulse is more powerful when further away from the scenes anchor point? For example I can drive the car to the right of below scene and it spins faster th...
more »

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

Does swift copy on write for all structs?

I know that swift will optimize to copy on write for arrays but will it do this for all structs? For example: struct Point { var x:Float = 0 } var p1 = Point() var p2 = p1 //p1 and p2 share the same data under the hood p2.x += 1 //p2 now has its...
more »

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

found nil while unwrapping optional in UIImage

I am very new to swift and cant figure out how to programmatically change the picture in a UIImageView. i have tried this so far: if let image = UIImage(named: "mouse.jpg") { imageView.image = image print("image set") } but it causes the ...
more »

2017-04-18 22:04 (1) Answers

How to use Realm objects with Swift generic type?

I have generic class Child. At some point I want to check if Child object conforms to MyProtocol and I get the error EXC_BAD_ACCESS. At this point I dont know if this is related to Swift or to Realm library. protocol MyProtocol: class { } class Ch...
more »

2017-04-18 21:04 (0) Answers

Implementing search to map view controller

In my project i have a mapView with a lot of annotations & i would like to add a search functionality to the map so i can search those annotations and quickly find the annotation i want. I followed a tutorial i found on the web but it searches g...
more »

2017-04-18 19:04 (1) Answers

Initialize struct from Data in Swift 3

I have a Struct named MyContiguousStruct whose memory layout has no padding. struct MyContiguousStruct { let ivar1: UInt8 let ivar2: UInt8 let ivar3: UInt16 let ivar4: UInt16 } My initializer works (great) like this: init?(data: D...
more »

2017-04-18 18:04 (1) Answers

Avoid fetching image again when cell in view

I have managed to get some code working where Instagram pictures are fetched (via Alamofire) when a table row comes into view. However, once fetched, I don't want another call being made when the table row comes into view again. How can I avoid this ...
more »

2017-04-18 17:04 (2) Answers