xcode7

Swift Generics and Protocol Extensions

女生的网名这么多〃 提交于 2019-12-23 04:22:51
问题 I have a protocol Reusable that has a static function static func reuseId() -> String and a protocol extension that defines the default implementation for the function. Then, I implemented a extension on UITableViewCell to conform to the Reusable protocol. I can now use the function on my TableViewCells without a problem: SomeTableViewCell.reuseId() . The Problem I have is with Generics. I have a generic class that has a generic parameter of the type UITableViewCell : internal class SomeClass

Black screen when launching the app on device since XCode7 update

一世执手 提交于 2019-12-23 02:43:12
问题 I've updated XCode7 and like everyone, i have to amend a part of my code to be compliant with Swift2. But i have a problem, when i m testing the app on the simulator i have no problem. But when i m trying directly on my real device (Iphone 5S IOS9), a black screen displays just with the level of the battery. I have tried during 3 days to find something on stackoverflow, but nothing seems working. This topic seems to be the same problem, but doen't work actually. IOS 7 launch image, displaying

iOS: “no such module” with Alamofire

萝らか妹 提交于 2019-12-23 02:18:11
问题 I have this error when I try to archive my app (adHoc or distribution) "NO SUCH MODULE" I followed all the instructions in the official page https://github.com/Alamofire/Alamofire#manually (manually installation) But when I RUN my app it works fine, and when I try to ARCHIVE it to get ipa for distribution or adHoc version, I get the error in the image above. What happen? p.s. I use xCode 7.0.1 with swift 2.0 Thanks 回答1: This is a strange issue being seen with Xcode 7.0.1, Swift 2.0. Even I am

iOS: “no such module” with Alamofire

廉价感情. 提交于 2019-12-23 02:18:08
问题 I have this error when I try to archive my app (adHoc or distribution) "NO SUCH MODULE" I followed all the instructions in the official page https://github.com/Alamofire/Alamofire#manually (manually installation) But when I RUN my app it works fine, and when I try to ARCHIVE it to get ipa for distribution or adHoc version, I get the error in the image above. What happen? p.s. I use xCode 7.0.1 with swift 2.0 Thanks 回答1: This is a strange issue being seen with Xcode 7.0.1, Swift 2.0. Even I am

How to use NSRegularExpression in Swift 2.0 in xcode 7

你离开我真会死。 提交于 2019-12-22 18:21:10
问题 //The error is here let regex = NSRegularExpression(pattern: "(<img.*?src=\")(.*?)(\".*?>)", options: nil, error: nil) //The error is:*** cannot find an initializer for type nsregularexpression that accept an argument of type (pattern: string,ption:nil,error:nil) 回答1: There are 2 changes with regards to the syntax in Swift 2.0: (1) you wrap the call in a try ... catch block instead of supplying an error parameter; and (2) options should be a Set , not a numerical or of the individual options.

Xcode Simulators: How to recreate simulators automatically?

拈花ヽ惹草 提交于 2019-12-22 14:09:09
问题 My XCode simulators names started appearing with simulators identifiers (like iPad Air - xxxxxxxxxxxxx ) instead of iOS versions in simulator selections menu, How can I fix it correctly? Is there anyway to recreate all simulators automatically? Thanks, 回答1: Script to recreate XCode Simulators I found following solution to recreate XCode simulators automatically and its works like a charm. For XCode7 : https://gist.github.com/cabeca/3ff77007204e5479f7af For XCode 6 : https://gist.github.com

Xcode Simulators: How to recreate simulators automatically?

梦想的初衷 提交于 2019-12-22 14:08:56
问题 My XCode simulators names started appearing with simulators identifiers (like iPad Air - xxxxxxxxxxxxx ) instead of iOS versions in simulator selections menu, How can I fix it correctly? Is there anyway to recreate all simulators automatically? Thanks, 回答1: Script to recreate XCode Simulators I found following solution to recreate XCode simulators automatically and its works like a charm. For XCode7 : https://gist.github.com/cabeca/3ff77007204e5479f7af For XCode 6 : https://gist.github.com

Force a UITextField to lowercase while typing and retaining cursor position

≯℡__Kan透↙ 提交于 2019-12-22 10:37:55
问题 (programming in swift 2) I have a UITextField that when the user types into it should be automatically converted to lower case WHILE typing (so NOT after form validation). I have gotten this far: func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { //only convert to lowercase for username field if textField == textFieldUsername { //let stringRange = NSRange(location: range.location, length: range.length) let

XCode 7: Unable to Convert OCUnit to XCTest

北战南征 提交于 2019-12-22 10:34:18
问题 I upgraded the XCode to 7.0 and ran into compilation issues. XCode asked me to convert my test target to use XCTest and I followed the wizard screen. I'm unable to find any test targets and cannot finish converting. Does any one know how to fix this ? Thanks. 回答1: Make sure you have selected the scheme of your test target (in the top-left scheme selector), then select Edit -> Convert -> To XCTest... This will make Xcode recognize the appropriate target. 来源: https://stackoverflow.com/questions

Fixing “Install of Apple Watch Application never finished”

痞子三分冷 提交于 2019-12-22 10:28:25
问题 For the past 4 weeks, I've had no success in testing a Watch app for my current app project. Initially, I was using Xcode 7 beta 5. However, I'm noticing this behavior in the Xcode 7 GM as well. I created a radar for this with Apple, but they closed it as a duplicate without explaining how to fix this. I have already reviewed the questions here and here, and have attempted every answer they have suggested. But the issue still isn't resolved. My issue: I have an existing iPhone application. I