FAQ Database Discussion Community


Using the device simulator for iOS 8 with Xcode 7

ios8,xcode7,ios9
I thinking about port my App to Swift 2 and Xcode 7. But the device simulator only targets iOS 9 and I see no way to download iOS 8. I have parallel Xcode 6.3 installed. Is there any way to test and debug my app under iOS 8 with the...

XCode 7 error: “A launch storyboard or xib must be provided unless the app requires full screen”

ios,swift,uistoryboard,xcode7
I don't use a storyboard/xib for launch screen and get this error in XCode7 / Swift2.0.

Xcode 7 beta 1 view doesn't fit [on hold]

ios,iphone,xcode,swift,xcode7
In all previous versions of Xcode, my storyboard for this app was fine, but since updating to the Xcode 7 beta, running on the simulator and on device (iOS 9) the view size seems to be distorted. Similar to an app that hasn't been optimised for iPhone 6/6 Plus, but...

Int is not convertible to UIInterfaceOrientationMak for supportedInterfaceOrientations()

swift,int,uiinterfaceorientation,swift2,xcode7
I have another problem with Xcode 7. I have tried some research but cannot come up with a solution. The error is Int is not convertible to UIInterfaceOrientationMask. The code below: override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { if visibleViewController is KINWebBrowserViewController { return Int(UIInterfaceOrientationMask.All.rawValue) } return Int(UIInterfaceOrientationMask.Portrait.rawValue) } Thanks...

(ios9) HangTracer interval is 0, forcing to 1s, while using Contact Framework

ios,contact,ios9,xcode7
I was working with Contact Framework (just adding a contact). And It was saved without any problem (I double checked in Contact List) but recently I notice that this message appears on console: 2015-06-12 09:57:39.723 AddingContactToAddressBook[819:291346] HangTracer interval is 0, forcing to 1s 2015-06-12 09:57:39.725 AddingContactToAddressBook[819:291346] made new hangtracer connection:0x332e10...

After installing Xcode 7, Xcode 6.3 shows errors about converting to Swift 2

xcode,swift,swift2,xcode7
After installing Xcode 7 to play with Swift 2 in Playgrounds, I've got a weird problem: when I open an existing Xcode 6.3 project with Xcode 6.3, it throws lots of errors about conversions to Swift 2. This project was just cloned from the repository and hasn't been opened with...

Binary operator '&&' cannot be applied to two Bool operands [duplicate]

beta,swift2,xcode7
This question already has an answer here: Swift 2 migration saveContext() in appDelegate 2 answers I recently updated Xcode to the new 7.0 beta. I did the migration with the assistant but there are a few more issues. func saveContext () { if let moc = self.managedObjectContext { var...

AVAudioPlayer no longer working in Swift 2.0 / Xcode 7 beta

ios,xcode,beta,xcode7
For the var testAudio declaration in my iPhone app, I am receiving an error here "Call can throw, but errors cannot be thrown out of a property initializer" import UIKit import AVFoundation class ViewController: UIViewController { var testAudio = AVAudioPlayer(contentsOfURL: NSURL (fileURLWithPath: NSBundle.mainBundle().pathForResource("testAudio", ofType: "wav")!), fileTypeHint:nil) This happened when I...

How to iterate over an NSArrayController contents in swift?

swift,nsarraycontroller,for-in-loop,xcode7
I have an array controller which stores managed objects of entity 'Student', I am trying to iterate over its content using below code: for (index, element) in downloadingFilesArrayController.arrangedObjects{ // want to do some useful things on element } for some reasons it is showing compilation error: 'Type AnyObject does not...

Storyboard reference in Xcode, where should we use it?

ios,xcode,xcode7
There is one new control in Xcode7 beta named as Storyboard Reference. Below is its image. It has its description as Provides a placeholder for a view controller in an external storyboard. Segues connected to this placeholder will instantiate the referenced view controller at runtime. So the questions are In...

Iterate through a String Swift 2.0

swift,swift-playground,swift2,xcode7
I am trying to do a very simple piece of code in Swift playgrounds. var word = "Zebra" for i in word { print(i) } However, I always get an error on line 3. 'String' does not have a member named 'Generator' Any ideas on why this doesn't work? Note:...

Using Xcode7's UI tests to create app screenshots for the App Store

ios,swift,xctest,xcode7,ios9
Every time we change something in the UI, we have to manually prepare and take 375 (= 5 screenshots * 5 device types * 15 languages) screenshots for iTunes Connect's listing. I'm trying to "exploit" iOS 9's new UI testing to automatically prepare and take these screenshots for each language....

When and why should I work with a “beta SDK”? [closed]

objective-c,beta,ios9,xcode7,osx-elcapitan
Currently, I'm developing an iOS App in Objective-C (iOS8, OS X 10.10, Xcode 6). Apple submit yesterday a new beta of his SDK environment and i'm thinking about the interests to work with an unstable environment (iOS9, OS X 10.11, Xcode 7). When a developer have to work with "beta...

iOS Swift 2.0 - AvAudioPlayer is not playing any sound

ios,swift,xcode7
Lately I have run into an issue while using the beta version of Xcode (7.0). I am not able to hear the sound that I play through this code: (It is a ViewController from the Main.storyboard, there is a button connected to buttonTouchUpInside()) import UIKit import AVFoundation class ViewController: UIViewController...

How to make a CocoaPods project work on OS X El Capitan & Xcode 7 Beta?

xcode,xcode7,osx-elcapitan
I've updated to OS X El Capitan & Xcode 7 Beta released today and now my CocoaPods projects no longer work because of the new Swift syntax requirements. The automated Xcode project update breaks the code. Has anyone already figured this out already? Thanks.

canEvaluatePolicy Extra argument 'error' in call Swift Xcode 7

ios,xcode,ios8,xcode7
I work with Xcode 7 with swift and I would use the Touch Id. Only I have a error when I use canEvaluatePolicy. I understand my error, I call an argument too. Only if I do not call, it makes me a error because I did not manage my error...

Linking error when building Parse in Xcode 7

swift,parse.com,ios9,xcode7,swift2
I am trying to add the Parse.com SDK to my Xcode 7 project. I have followed the getting started guide and I have managed to do it before in Xcode 6. However this time I am being shown this error message when I try to build: ld: framework not found...

iOS 8 simulators not visible in XCode 7 beta

ios8,xcode7
I'm using the XCode 7 beta that Apple released during WWDC2015, and it looks like iOS8 simulators are not there in it. I tried downloading them using the Xcode > Preferences > Downloads > Components, but it doesn't list the simulators. I have Xcode 6.3.2 also on the mac, and...

Swift 2 NSURLSession.sharedSession().dataTaskWithURL Cannot invoke with an argument list of type

swift2,xcode7
Cant seem to get the following code to compile with Xcode 7, I get error "Cannot invoke 'dataTaskWithURL' with an argument list of type" Looks like completionHandler is no longer optional, cant figure out how to rewrite the following code. Any help appreciated, Thanks let session = NSURLSession.sharedSession() let url...

Can't create simulator in Xcode 7

xcode7
When I open Xcode 7.0 beta version, I cannot create a simulator. I click the blue button and nothing happens at all. No error message is displayed and I get no feedback. Xcode -> Preferences - > Downloads does not show any SDKs to download. ...

I have a bug when I run my project with xcode7,ios9

xcode7,ios9
After running function - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions there is a crash: Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit- *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', `enter code here`reason: 'Application windows are expected to have a root view controller at the end of application launch' *** First throw call stack:...

Xcode 7 beta made my apps storyboard files inaccessible

interface-builder,xib,xcode7
I installed the Xcode 7 beta 1 and it asked me to convert my code to Swift 2, which I did. All worked fine, there were only some problems with my apps test target. When that was solved, I built and ran the app and the error said: com.apple.interfacebuilder error...

Cannot subscript a value of type [CLPlacemark] with an index type int

ios,xcode,swift,ios8,xcode7
I would like to retrieve the current location. I work with on swift Xcode 7. I looked PLUSIEUR tutorials, but every time they use the same method. Here is my code and my error: ! Error : Cannot subscript a value of type [CLPlacemark] with an index type int import...

Install app on iOS without Apple Developer Program (Xcode 7)

ios9,xcode7
On June 8th, Apple announced that with Xcode 7, everyone would be able to install any apps they develop on their devices without an Apple Developer Program Certificate. The Apple Developer website says you only need to log in with your Apple ID. I already did that on Xcode, but...

Update button image on swift 2.0

ios,uibutton,swift2,xcode7
When I try using this solution to update an UIButton image (Xcode 7 beta 1), it gives me this error: "Cannot invoke 'setImage' with an argument list of type '(UIImage?, forState: nil)'" Here's the code: if counter % 2 == 0{ playButton.setImage(UIImage(named: "pause"), forState: nil) } else if counter %...

How to run apps on iPhone/iPad using Xcode 7 without enrolling to Apple's developer program?

ios9,xcode7
I have a Macbook with OSX 10.10.3, Xcode 7 beta and a iPhone 4. I haven't enrolled to Apple's Developer Program. I think that from the latest WWDC any developer can run apps on their device. So my question is how to achieve that on a real device in Xcode...

Cannot subscript a value of type '[String]' with an index of type 'Int'

ios,xcode,swift,swift2,xcode7
I'm recently trying to build a custom UITableViewCell Class by adding a minor improved UITextField. I am also coding in swift 2 and I realised this error by recompiling the project in Xcode 7 beta. I initialised the array by call a custom init method. Heres is my Code: INIT...

Xcode 7 run on Mac OSX 10.10 Yosemite

swift,osx-yosemite,swift2,xcode7,osx-elcapitan
Am I missing something or Xcode 7 should run only on new(beta) OSX 10.11 El Capitan? I downloaded beta and after some code changes to comply with Swift 2.0 my project compiles and runs fine under OSX 10.10.3. Am I missing something or Apple changed the game somehow?...

Fixing NSURLConnection Deprecation from Swift 1.2 to 2.0

swift,xcode7,swift2,ios9
I have a function written in Swift 1.2, that checks for Reachability of Address or IP. Here it is : func isHostConnected(hostAddress : String) -> Bool { var response : NSURLResponse? let request = NSMutableURLRequest(URL: NSURL(string: hostAddress)!) request.timeoutInterval = 3 let data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &response, error: nil) return ((response...

How to send data from Iphone to Watchkit in OS2 in SWIFT

swift,watchkit,xcode7,ios9
I want to send a dictionary from iPhone to Watchkit in watchOS 2. In watchOS 1 it works fine for me with appgroups but in watchOS 2 I know that we have to use WCSession but I don't know how to use it. Please help me find the solution....

UIAlertView deprecated in iOS 9, How to update code?

ios,xcode,swift,swift2,xcode7
I have the current line of code in one of apps, it is a simple UIAlertView. However with the new Swift 2.0 update on various other updates apple has made, this is now deprecated. let alertView = UIAlertView(title: "Oops!", message: "This feature isn't available right now", delegate: self, cancelButtonTitle: "OK")...

Getting firmware related warning in Xcode 7.0

xcode,swift,frameworks,xcode7
error I'm receiving is this directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks' I have no idea why this is coming is this related to framework ?...

“Variable 'xxx' was never mutated; consider changing to 'let' constant” ERROR

swift2,xcode7
I have the following problem. I use this code below and I get the issue "Variable 'characteristic' was never mutated; consider changing to 'let' constant" for var characteristic:CBCharacteristic in service.characteristics ?? [] { print(str) _selectedPeripheral!.writeValue(str.dataUsingEncoding(NSUTF8StringEncoding)!, forCharacteristic: characteristic, type: CBCharacteristicWriteType.WithoutResponse) } When I change to "let", there's an Error: 'let' pattern...

Could not cast value of type 'UIView' (0x112484eb0) to 'SKView' (0x111646718)

ios,swift,sprite-kit,xcode7,xcode6.3.2
Could not cast value of type 'UIView' (0x112484eb0) to 'SKView' (0x111646718). I keep on getting this error. Can anyone help me because the line of code is there by default. I converted the SK game into the latest swift syntax using the xcode 7 beta. The compiler was missing a...

Why is ActivityViewController displaying auto constraint errors in console?

ios,swift,uialertview,xcode7,ios9
I'm trying to implement a share button in my application and so naturally, I turned to UIActivityViewController. For some reason, any time I press the share button and it pops up, I get the following message in my log: Unable to simultaneously satisfy constraints. Probably at least one of the...

Swift Errors Thrown from here are not handled

json,swift,error-handling,xcode7
I have had my code working in Xcode 6 but since I got Xcode 7 I cannot figure out how to fix this. The let jsonresult line has an error that says Error thrown from here are not handled. Code is below: func connectionDidFinishLoading(connection: NSURLConnection!) { let jsonresult:NSDictionary = try...

Getting video from Asset Catalog using On Demand ressources

ios,xcode,xcode7,ios9,asset-catalog
I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like...

BETA iOS9 deployment to test devices

ios9,xcode7
Can I download iOS9 + Xcode 7 and still deploy test apps to devices that use the current version of iOS? Sorry for the relatively stupid question, I'm a new developer and not sure how it has worked in the past and I can't find anything on the developer site.......

Api Call Error in Xcode 7 / iOS 9 (how to setup App Transport Security in plist)

ios,httprequest,xcode7,ios9
I am using xcode 7 beta version. Now, I am working an API. If, I use the API in Xcode 6.3 it works fine but when same API I used in xcode 7 error message appears Unable to parse. here is the API i am using Please help me out....

Can't retrieve non jpg/png files from the Asset Catalog in Xcode 7

ios,xcode,asset-catalog,xcode7
I want retrieve non jpg/png files from the Asset Catalog in Xcode 7. I saw it was possible now to add any kind of data into to Asset Catalog. So the way I was doing it was working before moving gif/video from Xcode project into the Assets Catalog private struct...

Sorted is not working in Xcode 7

ios,swift,xcode7
I used sorted method in Swift in Xcode 6.3 as sorted(UIFont.fontNamesForFamilyName(familyName) as! [String]) I downloaded Xcode 7 beta, it says "sorted in unavailable, call sort on the collection". Any idea what is going wrong? ...

iOS : How to test app on real device without spend $99 buying an account[using Xcode7] [on hold]

ios,xcode,ios7,apple,xcode7
I am a new iOS developer. I am not rich , I wonder can I test my app on real device without spending $99 buying an account? Update I mean how to use Xcode7 to do this ? (step-by-step tutorial will be better Thx!)...

XCTest UI Record and Play - Simulator not updating UI

xctest,ios9,xcode7
Apple released a new UI Testing framework 2 days ago during WWDC2015. I'm trying to write a test case and when I try to record the UI testing, to generate the scaffolding code, it looks the code is being generated, however the UI on the simulator is not actually updating....

What does ENABLE_BITCODE do in xcode 7?

ios,iphone,xcode7,bitcode
I have problem with embedded bitcode term. What is embedded bitcode? When to enable ENABLE_BITCODE in new Xcode? What happens to the binary when ENABLE_BITCODE is enabled in the new Xcode?