Newest xcode Questions

Q&A for professional and enthusiast programmers

Xcode Swift 3 ~ Make speed into an integer [duplicate]

I understand that Int() is how to make something and integer but this doesn't work when using it with speed. Here is my code: var speed: CLLocationSpeed = CLLocationSpeed() speed = location....

UIView transform with 3D Sphere effect

I'm using google map SDK to display a map, and i would add a 3D effect on the UIView, to look like a sphere 1/ First, i initialized the map mapView2 = [GMSMapView mapWithFrame:CGRectMake(0, 0,100,...

Working with multi storyboard Xcode

I'm currently working with multi storyboard project for avoid storyboard conflict. I'm using XCode 8.2.1 and it's very easy if I use Storyboard Reference. But when I change deployment target to 8.0 it'...

Textures won't show on OpenGL and Xcode

I have a problem in OpenGl and Xcode. It's driving me crazy. My textures won't show up on screen, just the colored square. I collocated a condition and a cout sentence to let me know if the image is ...

In Swift how do I access data in my second ViewController from my third ViewController?

I an trying to run the code below so that my ThirdViewController can mirror its "myOrder" variable based off of the one in SecondViewController. But I am getting a runtime error "Swift dynamic cast ...

XIB not outletting to class

I'm trying to make a template for a view I'll be using multiple times with a XIB file. I need to be able to change the label inside the view so I'm trying to make a custom class for the view, but when ...

How to create an Application for Image search [on hold]

How to create an application? I have an idea, having Knowlege in Java, Spring, Hibernate, and Xcode. where to start and how to implement.

UINavigationController + UINavigationController in container (push and pop)

I have main navigation controller (N1) and another one (N2) in container on his root view controller. When I just make push from N1 or N2 – it's OK. My case: N2 has view controllers in the stack and I'...

Get file size from a URL in Swift 3

I'm developing an ios application and I need your help to get size of files hosted on a remote web server. When my app starts for the first time, it downloads different files in the user's ...

Main thread runs asynchronously or synchronously in iOS? please explain with Example

Is Main thread runs asynchronously or synchronously in iOS?Is Main thread runs asynchronously or synchronously in iOS

How to declare a UIImage Object in the Xcode 8.2

let hopAnimation:[UIImage] = UIImage(named:"background") I do this but Xcode tells me: Expected ',' separator Fix-it insert ','

iOS map doesn't zoom in after updating with annotation and multiple route lines

My iOS mobile device receives a packet from an embedded GPS device. Packet contains multiple (about 7) sets of LAT & LON GPS coordinates. Mobile annotates a pin onto map at 1st coordinate, and ...

How to implement custom font in Xcode playgrounds

I want to change the font of a label with a custom font, but the compiler is giving me an issue: Unexpectedly found nil while unwrapping an Optinal value. I think that this issue is due to Xcode not ...

Xcode linker error Bulk_Assembly-CSharp-firstpass_0.o

I have this error: "_getRewardItemDetailsWithKey", referenced from: _UnityAdsIosBridge_getRewardItemDetailsWithKey_m2540915321 in Bulk_Assembly-CSharp-firstpass_0.o (maybe you meant: ...

Exchange two cells in UICollectionView [on hold]

I'm working with UICollectionView and I wanted to exchange two cells witch an animation (dragging one of them). One of them is always empty an the other has a Image, so I want to drag the one with the ...

Creating a List of Custom Views in Xcode

I'm currently working on developing a desktop application for MacOS for downloading batches of audio files from URLs at one time I've run into a question about UI design that I can't figure out. I ...

Sending Multiple UNUserNotificationCenter Notifications

I'm creating an Alarm Clock app and using UNUserNotificationCenter to schedule future alarms. The user should be able to select Monday +/ Tuesday +/ Wednesday .. etc .. When creating a single ...

How can I simulate app being killed by the OS in background?

my iOS app behave weirdly when I reopen it after a long time (few hours). I bet the problem happen when the app is purged from memory by the OS. In such cases I need to kill and reopen the app. I'm ...

xcode: Image is axb, should be axb

I'm resizing some images for an ios LaunchImage collection (to create the splash page for an app) and xcode is telling me that one image should be dimensions axb, but that the image is axb: I'm using ...

How do I implement a video chat function in my app that already has a database?

The last couple of days I have been working on a chat-application. The normal 'text-bubble-chat-part' is done now. Now I want to add an video chat function in my app. I read a few articles online and ...

How to customise scene size in SpriteKite using initWithSize

I need to lay a new scene on top of the old one, so that an upper band of the old one remains visible at the top. How should I modify initWithSize below? - (id)initWithSize:(CGSize)size { self = [...

How to set minimum and maximum value of constraints on Xcode?

Hi, I made the above using the interface builder for the class size iPhone 6. However, when I switch to iPhone 5, Label B will overlap with imgC (which has a 'Align Trailing to' the box's right side). ...

How to properly update your tableView / cells in Xcode with Swift [duplicate]

I've been working on this ios app and I'm having a hard time trying to update a labels text field. at first I was having a problem because my TableView's are in different swift files but i believe i ...

Connect to local mac server from device

Im trying to connect to a ruby sinatra server that im running locally on my mac from an app using the following code: func load(finished: @escaping ()->()) { // Create destination URL let ...

How to find out which cpp compiler is used on Mac OS

Im using CLion on MacOS, compiler was installed before. I would know what compiler is used for c++. Is exist some kind of command for echo it in terminal?

Safari web inspector does not display app elements

I was able to build from Xcode and display my application on my phone, and when opening safari web inspector I can select the app, however, when the inspector opens sometimes none of the DOM elements ...

Swift 3 - Http post to Https wcf web service

In my xcode console application (10.12), i m using http post requests for sending data to wcf web service. If that web service works with http there is no any problem. But if i change to secure (https)...

Why does a UICollectionView not set isSelected to false for a cell that has isSelected set to true in cellForItemAt? [duplicate]

I'm working with a UICollectionView with the default selection rules (single selection only). In my custom UICollectionViewCell class, I've overridden isSelected like so: override var isSelected: ...

Absence of UI elements in tree on real device unlike it is on simulator

I go with XCUITest in Xcode to test UI of my application. And I have a problem with existing of some UI elements in tree on real device. These elements have accessibilityIdentifiers in source code. I ...

Main Platform Check in CMAKE

CMAKE version : 3.8.0-rc1, XCODE version : 8.3 beta2 (8W120l) Machine : macOS Sierra 10.12.3 I'm going to make a XCODE project with CMAKE. if(UNIX AND NOT APPLE) include(platform_unix) else if(...

Xcode 8 playground live view doesn't work

In my Swift playground, I entered the following code to test the live view feature: let view = UIView() PlaygroundPage.current.liveView = view But for some reason the live view doesn't display on ...

Failed to export archive to ipa (No applicable devices found)

Well, just tried to create an IPA build / package with no luck. I found similar issues on the web but they didn't fix the error. Here's the stack that it sends me while trying: [ERROR] : Failed to ...

Xcode: Change framework build number (DYLIB_CURRENT_VERSION)

I know the following command will change the build number for all the targets in the project: xcrun agvtool new-version -all 2.0.0 I have a framework inside a project. Is there a command that I can ...

How to debug “Fatal error: unexpectedly found nil while unwrapping an optional value (lldb)”? [duplicate]

I've been trying to figure out the reason for this error, but I just could not find it, does anyone know what the problem is here? The error is: fatal error: unexpectedly found nil while ...

Trouble trying to delete all nodes of value in a linked list

I am having trouble trying to delete all of the nodes in a linked list that contain the same integer. I am getting an EXC_BAD_ACCESS error on the commented line below when using the test node: [1, 2, ...

Unable to find a specification for `Google Places`

I'm trying to add Google Places SDK to my xcode project but keep getting the error Unable to find a specification for `GooglePlacePicker` This is my pod file # Uncomment the next line to define a ...

Xcode 8 - Building all schemes in background

I use Xcode (8.2.1) schemes to build a project with different configurations : Everytime time I change something in the code and hit Command + R to run the project, Xcode builds all the schemes : ...

How can I track a user's continuous location in iOS (Swift) whenever they enter or exit certain places?

I'm building an application which has the following requirements: There are X number of locations that the user can check-in or check-out from. Whenever the user enters any of the X locations, I need ...

Adding annotations to MKMapview - found nil error

ok, I'm getting a bit frustrated with this. I have a ViewController, which has two containers controlled by a segment controller. One is for a table view of data, the other is for a map view of data....

Autoplay mp3 from a URL

I have a simple button that opens a URL for an mp3 - is there a way to auto play the mp3 when the page loads? Otherwise the user has 2 essentially click twice to play the mp3 (once in the app and ...

C++ Error with linking files together

So I just started learning about header and source files and I am doing a project that requires me to use both. Before you ask, I have checked multiple other answers and forums, but either didn't find ...

Terminating app due to uncaught NSException of 'NSInvalidArgumentException'

I have two Xcode projects (SampleMain, SampleTest) programmed in Swift which is taken into a single workspace called Sample. Then I try to merge SampleMain's UIStoryboard (Main) to SampleTest's ...

Swift- fatal error: unexpectedly found nil while unwrapping an Optional value [duplicate]

The iOS app I develop consists two storyboards called Main.storyboard and Explore.storyboard which are merged using a UIBarButtonItem via a Storyboard Reference. Main.StoryBoard UIBarButtonItem ...

round number in swift to produce one int at a time in output

Ok guys, I am in a bit of a dilemma, so I got a collectionview and I am trying to find which image the user is on so i decided to create a variable x which is equal to the collectionviewcontentsize / ...

Import data in iOS App from MySQL Database

I am trying to read a row from my MYSQL Database and turn it into a String Array in my app. my php file: <?php $host = 'localhost'; $user = 'root'; $password = ''; $database = '...

Unwrapping values swift

So I am having some issues with unwrapping and optionals. I am using Google Places and passing the place.formattedAddress value twice...first from the GMSAutocompleteViewController to a UIView to be ...

Unable to add target and run function on UIBarButtonItem click in iOS Swift 3

I'm unable to detect on-click events on UIBarButtonItems in Swift 3. Can anyone help? I need to perform a segue to another storyboard and view controller on clicking the UIBarButtonItem.

How to Speed Up a Lagging Swift File?

I have a Swift file in my app that has about 4,500 lines of code, and will likely need to grow to at least 7,000. The amount, or some sections of this amount of lines, is causing my ability to type ...

Passed value lost after rotation in modal ViewController called by performSegue

I'm calling performSegue(withIdentifier: "editLetzteAnsetzung", sender: self) to perfom a segue. For preparation I do the following: override func prepare(for segue: UIStoryboardSegue, sender: Any?)...

How to execute terminal command in swift?

I am new to swift. How can i run this process from swift code. open terminal window execute command line -> cd Desktop/firebase-mac execute command line -> npm start What actually i am trying to do ...
Translating... 0%