xcode7

Play video file (mp4 file) from an URL in swift 2 with xCode 7.3?

╄→гoц情女王★ 提交于 2019-12-22 10:19:56
问题 I try to play an mp4 file from an URL. Below is code: func playVideo(url: NSURL){ let player = AVPlayer(URL: url) let playerController = AVPlayerViewController() playerController.player = player self.addChildViewController(playerController) self.view.addSubview(playerController.view) playerController.view.frame = self.view.frame player.play() } And I've called it in viewDidAppear function: override func viewDidAppear(animated: Bool) { let fileURL = NSURL(string: "http://myserveraddress:8080

Attempting to run multiple tests using Xcode's new UI testing fails

六眼飞鱼酱① 提交于 2019-12-22 10:17:35
问题 When I try to run multiple UI tests at the same time in the new Xcode beta, it fails after the first test, with the error "UI Testing Failure: App state is still not terminated" for each test after the first. Anyone got a fix for this? 回答1: I have faced the same issue. It seems that, at least in my case, application had never been terminated. I solved it by putting the following statement in the setUp() method: continueAfterFailure = false This should stop a running test process after first

Getting video from Asset Catalog using On Demand ressources

和自甴很熟 提交于 2019-12-22 08:57:06
问题 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 : NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in let tokyoVideo = NSDataAsset(name: "tokyo") So I can do : tokyoVideo.data to access NSData but I'm using

Swift Errors Thrown from here are not handled

早过忘川 提交于 2019-12-22 07:24:22
问题 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 NSJSONSerialization.JSONObjectWithData(self.bytes, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary print(jsonresult) let number:Int = jsonresult["count"] as! Int print(number)

Alamofire Swift 2 - cannot submit for beta testing (Xcode 7 GM)

假装没事ソ 提交于 2019-12-22 07:04:48
问题 I have followed the instructions on installing the swift2 branch of Alamofire with cocoa pods. The app works well in the simulator, however, when I archive it for submission with Xcode 7 GM I receive an email with an error: "The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools" This issue definitely relates to the framework as without it I am able to submit for beta testing with the same version of Xcode. I have

Invalid Swift Support - Files not in right location

最后都变了- 提交于 2019-12-22 07:03:26
问题 I've been trying to upload a new build to iTunes Connect to update an app. I first used xCode 6 but got a email from Apple stating this: Dear Developer, We have discovered one or more issues with your recent delivery for "App". To process your delivery, the following issues must be corrected: Invalid Swift Support - The files libswiftDarwin.dylib, libswiftDispatch.dylib, libswiftCoreGraphics.dylib, libswiftUIKit.dylib, libswiftContacts.dylib, libswiftCore.dylib, libswiftCoreAudio.dylib,

Identifying a subclass with Swift Generics works with custom class but not with UITapGestureRecognizer

余生长醉 提交于 2019-12-22 05:47:11
问题 There's something I wanted to do in swift, but I couldn't figure out how to achieve it, that is to remove gesture recognisers given a Class Type, here's my code (and example), i'm using swift 2.0 in Xcode 7 beta 5: I have 3 classes that inherits from UITapGestureRecognizer class GestureONE: UIGestureRecognizer { /*...*/ } class GestureTWO: UIGestureRecognizer { /*...*/ } class GestureTHREE: UIGestureRecognizer { /*...*/ } Add them to a view var gesture1 = GestureONE() var gesture11 =

Xcode 7 retina 4" assets?

自古美人都是妖i 提交于 2019-12-22 05:15:33
问题 So just when I though my swift 2 upgrade could not get any worse its seems that you cannot add retina 4" 2x image assets anymore. I cannot fine any option anymore to add it, all my old assets still have the retina 4" image but I cannot create a new image set with a 4" retina image. Why? Any ways to fix this? 回答1: Edit Contents.json of the Image Set and add { "idiom" : "iphone", "subtype" : "retina4", "scale" : "2x" } You will see appear Retina 4 2x entry. 回答2: so I asked them again what we

Strange (bug ?) with Xcode 7 / iOS 9 b5 with dataWithContentsOfURL

↘锁芯ラ 提交于 2019-12-22 04:56:16
问题 I have a part of code who works as expected on all iOS versions, but not on iOS 9: NSData *response = [NSData dataWithContentsOfURL: [NSURL URLWithString: url] options:NSDataReadingUncached error:&error]; It's a simple json text. I got this error: Error Domain=NSCocoaErrorDomain Code=256 "The file “xxx.php” couldn’t be opened." UserInfo={NSURL= http://xxx.xxx.com/xxx/xxx.php?lang=fr } How this url can be intepreted as a file ? Response = nil... Thanks. 回答1: Technically is it because of the

Enabling Bitcode for iOS 9 increases IPA size 3x, is this the size on the app store?

耗尽温柔 提交于 2019-12-22 04:38:20
问题 Before iOS 9, our IPA size was roughly 6MB. After Archiving and exporting our IPA through Xcode 7, our IPA increased to about 17MB. Upon further investigation, we found out that enabling the "Bitcode" option in the export settings is what caused the large filesize jump. My question is this: if we enable this option, will our IPA size be 17MB in the store? Or does Apple do something with the bundle to make it roughly the same size as before (6MB). There's not much info about Bitcode out there