Dynamic typealias Swift 3

I'm trying to set a typealias with a conditional like this: typealias dataType = (x == y ? ButtonTableCell : InputTableCell) Where both ButtonTableCell and InputTableCell are classes, so later I can use dataType like this: let cell = tableView.de...
more »

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

Create IBAction for CollectionViewCell

I've got a collection view with multiple cells created programically. I want to update a variable to a different value when the user taps a specific cell. So eg: Cell 1 is tapped -> var test = "cell1" , cell2 is tapped var test = "cell2". Usually I'd...
more »

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

One of two collection views not showing up

I've been trying to diagnose the problem here but I really can't figure out what went wrong. I had a collection view (of messages) showing up fine, until I added an additional collection view in the navigation bar. This is the setup for the second c...
more »

2017-04-17 16:04 (0) Answers

iOS upload image php return empty

In php: The Upload method: /** * ### this function is file upload * auto file name and file path * @param $FILES File to file * @param string $A * @param string $B * @return bool|string */ protected func...
more »

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

How can we hide the Sensitive Data in xCode iOS

I am new to iOS Development and have no much idea about secure iOS coding and my requirement is to hide API & Secrete Key in my xCode project. Is there any secure technique or location in xCode where I can keep the data so the it would not be acc...
more »

2017-04-17 09:04 (1) Answers

Airplay Screen Mirroring

I want to make an Airplay Server like AirServer. I follow the Unofficial AirPlay Protocol Specification and have got the Post/stream request { authTime = "514438570.684865"; channel = 36; configTime = "0.005387008190155029"; connectTime = "0.070...
more »

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

How to play .mts file in iOS

Currently im working with a wifi-camera device, which is able to send only videos in .mts format. As i have investigated in google, it leads to conclusion that it is not possible to play the video in iPhone or may be using Objective C. Now my probl...
more »

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

How to accelerate massive SKNode actions?

iOS SpriteKit API is easy to use. However, if I run massive actions (about 5000+) on a lot of SKSpriteNode (about 2000+) at the same time, the fps drops very low. But the GPU usage in this situation is far less than CPU usage. Is there any method to ...
more »

2017-04-17 05:04 (0) Answers

SpriteKit SKNode User Data returning nil

I am using the userData of an SKSpriteNode to save custom data into it. I have initialized the userData with value through this line of code: oscIcon.userData = NSMutableDictionary() oscIcon.userData?.setValue("0.01",forKey: "rValue") print("init va...
more »

2017-04-17 03:04 (0) Answers

Coding a SpriteKit Game

Hey everyone my question is relatively simple, how to i get my two blocks switch positions every time i tap the left side of the screen... like if i tap once the two blocks switch positions, then if i tap again they go back to their initial positions...
more »

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

Part of UIScrollView doesn't respond to touches

I have a UIScrollView with 7 UIButtons on it. 5 buttons are working fine but the other two (which the scroll view needs to be scrolled for the buttons to be reached) doesn't work most of the times (if I tap a lot of times they sometimes work but mos...
more »

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

animating path in swift 3

following code creates a red 270 degree ring let result = Measurement(value: 270, unit: UnitAngle.degrees) .converted(to: .radians).value let circlePath = UIBezierPath(arcCenter: CGPoint(x: 200,y: 200), radius: CGFloat(90), startAngle: CGF...
more »

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

Searching with NSFetchResult Controller

I've been looking on how to search using a NSFetchResultController but most post I came across are from 2 years ago. Okay I'm trying to filter the objects, which in my case are Pokemon. Here is my function I'm using. func attemptPokemonFetch(generat...
more »

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

How to fit an image on a uiview programmatically

I added a uiview as a subview on a view controller programmatically (called contentView). I also added an image on that uiview programmatically. Every time I run the app on the iPad the image is stretched! How do I fix the image so that it fits the i...
more »

2017-04-15 23:04 (4) Answers

How to import and use big CSV files in Swift

I am building an iphone app that will provide the user with information about public transport departure times. Now I have all of these data stored in huge CSV files (120 000 rows in total, about 60 MB). What is the most convenient way to import thes...
more »

2017-04-15 22:04 (0) Answers

NSLayoutConstraints on objects swift 3.0

Currently I am using this line of code to set the origin on a UILabel at the top left corner... addConstraint(NSLayoutConstraint(item: messageLabel, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1, constant:...
more »

2017-04-15 20:04 (3) Answers

One To Many Relationship setter

this is my first time working with Core Data in swift. I'm really enjoying it but it's also a challenge making sure my Appdelegate saves etc. The Problem Basically I am creating an budgeting app. Once a budget ends I need to take the current budget...
more »

2017-04-15 15:04 (2) Answers

How do I attach Scroll View's delegate method?

I have collection view which contains a scroll view. Scroll view has custom class which has scrollViewDidScroll function. Whenever I scroll, the scrollViewDidScroll method doesn't trigger. I tried attaching it's delegate to it's own class, and all t...
more »

2017-04-15 12:04 (1) Answers