xcode6

iOS 8 - Swift - Xcode 6 Beta - working without interface builder (no nibs and no storyboard)

℡╲_俬逩灬. 提交于 2019-12-19 09:50:39
问题 I have been searching a lot in the inter webs and Stackoverflow. Unfortunately there doesn't seem to be much info around the new Xcode version, iOS 8 specifically with Swift and working without the Interface Builder. The Templates to choose from as a starting point now does not have the option to start with an empty application. The least setup you have is to take the single view application, which already gives you the ViewController and a basic Storyboard. I hate storyboards and I hate nibs

iPhone 4 Simulator for Xcode 6

自作多情 提交于 2019-12-19 09:27:26
问题 I need to simulate an iPhone 4 (NOT iPhone 4S). I get a whole list of iPhones but "4" isn't one of them. Pulling my hair out having Googled for an hour now, what am I doing wrong? I also tried messing with build settings to no avail... 回答1: There is no option for iPhone 4. What difference do you expect between the iPhone 4 and iPhone 4s simulators to warrant its inclusion? There was no such distinction in older versions of the iPhone Simulator which had just "iPhone Retina (3.5-inch)". 来源:

Optional type '$T11' cannot be used as a boolean; test for '!= nil' instead since installing XCode 6 beta 7

邮差的信 提交于 2019-12-19 07:50:52
问题 Here is the code where I'm getting the error: for (key, value) in info { let fieldValue: AnyObject? = value if (!fieldValue || fieldValue?.length == 0) { // this line gives the error informationComplete = false; } } This is what XCode suggests I use which causes another error: for (key, value) in info { let fieldValue: AnyObject? = value if ((!fieldValue || fieldValue?.length == 0) != nil) { //bool not convertible to string informationComplete = false; } } Help is appreciated. Thanks for your

Optional type '$T11' cannot be used as a boolean; test for '!= nil' instead since installing XCode 6 beta 7

余生长醉 提交于 2019-12-19 07:50:04
问题 Here is the code where I'm getting the error: for (key, value) in info { let fieldValue: AnyObject? = value if (!fieldValue || fieldValue?.length == 0) { // this line gives the error informationComplete = false; } } This is what XCode suggests I use which causes another error: for (key, value) in info { let fieldValue: AnyObject? = value if ((!fieldValue || fieldValue?.length == 0) != nil) { //bool not convertible to string informationComplete = false; } } Help is appreciated. Thanks for your

How to List discoverable Bluetooth devices and already paired devices in iOS, which method to use in swift?

孤街浪徒 提交于 2019-12-19 06:59:52
问题 I would like to include Bluetooth feature on my app using swift. I want to list all nearby/discoverable peripheral devices including those devices are already paired Which method i should use for listing the paired devices. Im using CoreBlutooth framework for implementing Bluetooth availability check. If Bluetooth works fine i would like to list out paired devices. And if possible please provide the method for connecting the device directly from the listed paired devices func

Subclassing a subclassed UIViewController that has a xib

痞子三分冷 提交于 2019-12-19 06:16:31
问题 I need to have a few UIViewControllers that look very similar yet have different behaviours, so I thought I'd make a general UIViewController subclass with a xib, then subclass it when I need to, for those different UIViewController's that look alike. I'm trying to achieve the following UIViewController subclass (that has a xib file associated) -> and being able to subclass it as many times as i'd like (without additional xib files for the children) what I've done so far : xib file represents

Subclassing a subclassed UIViewController that has a xib

和自甴很熟 提交于 2019-12-19 06:16:08
问题 I need to have a few UIViewControllers that look very similar yet have different behaviours, so I thought I'd make a general UIViewController subclass with a xib, then subclass it when I need to, for those different UIViewController's that look alike. I'm trying to achieve the following UIViewController subclass (that has a xib file associated) -> and being able to subclass it as many times as i'd like (without additional xib files for the children) what I've done so far : xib file represents

Counting unique items in array. (Swift)

拟墨画扇 提交于 2019-12-19 06:04:30
问题 How do you count the amount of unique items in an Array? Example: let array:Array<Int> = [1,3,2,4,6,1,3,2] Count function: array.count will give 8 but I want to count unique items and this will give 5 回答1: You can use NSSet to throw away duplicates: let array:Array<Int> = [1,3,2,4,6,1,3,2] let count = NSSet(array: array).count println(count) This prints: 5 回答2: As of Swift 1.2 , Swift has a native Set type. Use the Set constructor to create a set from your array, and then the count property

UIAlertView changes to landscape when App is locked in portrait only in iOS8

时间秒杀一切 提交于 2019-12-19 05:58:21
问题 I have an app and its orientation is locked as portrait mode, but when I have a UIAlertView and turn the iPhone to landscape, the alert changes the orientation and crops the alert's overlay. Only in iOS8. Anyone had this error? 回答1: Yes I did get this issue. I have developed my code in iOS7 but had to do compatible with iOS 8 also. So I came across This link. I got my solution as follows: When you are working with iOS7 UIAlertView works fine but if you are working with iOS8 you have to use

Setting a UITableView's contentInset through Storyboard in Xcode 6

半城伤御伤魂 提交于 2019-12-19 05:13:09
问题 On Xcode 6, it seems that the ability to set the content inset of a scroll view/table view through UIStoryboard has been taken away. See image below: the parameters on the left are from Xcode 6, whereas the parameters on the right are from Xcode 5 Does anyone know if the parameters have moved, or are we no longer able to set the content inset through UIStoryboard? I'd really like to keep this out of my code if possible.. 回答1: You can do that by using KVC Select table view Choose Identity