xcode6

Launch Screen Image size for all iOS screen sizes

牧云@^-^@ 提交于 2021-02-18 03:24:08
问题 I am trying to create a lunch screen image for my iOS app. But I am not sure whats the right size for it. According to apple website for iPhone 6 the size should be 750 x 1334 (@2x) for portrait. But my question is, how to create a launch screen image that will fit for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc? Whats the correct way of doing this? 回答1: Go to images.xcassets there you can see launch image sizes.Just Enable iOS version from right side. iPhone Portrait iOS 8:-

checking UIButton Title in Swift

走远了吗. 提交于 2021-02-16 15:52:33
问题 I have a button and title of the button is an integer. correctAnswer = randomNumber1 + randomNumber2 button1.setTitle("\(correctAnswer)", forState: UIControlState.Normal) I am trying to check the title of the button so convert it to an integer and use it in an if statement, but couldn't make it work. button1.titleLabel?.text?.toInt() if button1.titleLabel == correctAnswer { //most probably I am making a mistake here. scoring() } else { println(button1.titleLabel?.text!) I am new to swift , I

Accessing data from HealthKit with Swift

一曲冷凌霜 提交于 2021-02-11 15:16:53
问题 I'm a complete noob at Swift (and Xcode), as a matter of fact, the only programming language I (somewhat) know is Javascript. I'm trying to make a Swift SpriteKit game, and I would like to access the number of calories burned in HealthKit. The idea is that my game will provide more points the more calories you burn using other apps like Endomondo. My app does not actually track anything, I would just like to access other data left by other apps in the Health App. Is this even possible? (I'm

XCode: add build phase is disabled

大憨熊 提交于 2021-02-06 07:56:44
问题 I want to add Crashlytics plugin to my iOS project that demands to add Run script phase. But no matter what I do - for add build phase all options are disabled: I select Target -> Build Phases I have proper scheme My project runs well - no issues, I run Xcode 6 回答1: I answer on my question because took me time to find right solution. Its really strange that the same issue migrates from old versions to XCode 7+. I found solution in one of the comments of similar problem: how-to-add-a-copy

Sharing classes between Xcode projects

ぃ、小莉子 提交于 2021-01-28 19:43:44
问题 A while ago I developed an iOS application using Xcode that and created a bunch of classes that work together to communicate with a RESTful API. Now I'm creating a second app, totally separate but communicates with the same API. I want to reuse these classes, what is the best way to approach this? Should I be do the via some Version control system? Or should I use an Xcode workspace? Thanks in advance for any help. 回答1: In similar situation I done it using XCode Workspace and Static Library.

How to successfully add an image in Storyboard in Xcode 6 in Swift?

…衆ロ難τιáo~ 提交于 2020-07-03 02:23:08
问题 I'm very new to Xcode (2 days) and so far I'm finding it fairly frustrating. I'm just trying to add an image to my app's ViewController via he Storyboard, but it does not appear on the simulator. Could someone assist me? 回答1: if you are trying an example project of XCode, you may find a "Images.xcassets" folder in project. Drag your image into this folder. then go to storyboard, focus on your "Image View". in the attributes list, "Image" field, you can choose the image in it's drop-down menu.

CMake+Xcode: Archive fails for an app depending on a library in the same solution. Make Archive build in the BUILD_TREE instead of Xcode/DerivedData?

大憨熊 提交于 2020-06-26 05:21:30
问题 We ported our codebase to use CMake for build management some weeks ago. We realize now that there is a major problem when we are trying to Archive an application that depends on one (or several) library built in the same Xcode solution. The linker fails because it cannot find the depended upon library (and the library is indeed not present where it is looking for it). minimal example Here is a minimal example producing the issue: In CMakeLists.txt ## ## The library ## project(library) add

Xcode 6.3.1 “A signed resource has been added, modified, or deleted” issue

杀马特。学长 韩版系。学妹 提交于 2020-06-26 04:33:45
问题 My xcode version is 6.3.1, my app is a swift project with a WatchKit target. Xcode showed this message "A signed resource has been added, modified, or deleted" when I ran it on my iPhone 6. It works fine on iPhone 5s, iPad and simulator, so I guess this is not a certificate issue, right? I tried deleting the "derived data" suggested in the question xcode 6 beta 7:A signed resource has been added modified or deleted. After I delete the "derived data", the first time I run, it stopped

Using UIDocumentPickerViewController to import text in Swift

倖福魔咒の 提交于 2020-05-26 17:52:24
问题 I'm currently taking an iOS development course and as part of my project, I'm tasked with using UIDocumentPickerViewController to import text. Every example I've found is either a) written in Objective-C or b) is for importing UIImage files. How do I set the delegate method for a text file? Here's what I've got so far: I have the iCloud capability set up. Works The delegate is specified, as follows: class MyViewController: UIViewController, UITextViewDelegate, UIDocumentPickerDelegate I have

Is it not possible to use “Analyze” with swift?

纵然是瞬间 提交于 2020-05-26 10:17:09
问题 Previously with objective-c code, I could "Analyze" - CMD + Shift + B and Xcode would warn me of all kinds of wrongdoings on my part. It seems that with Swift, I can do no wrong! No warnings of any kind! But clearly there is a memory leak in my code. Is there some setting I have to enable to get Swift to analyze my code properly? (I am aware I should use the profiler and test on an actual device, which I do, but I wonder why "Analyze" doesn't do anything. 回答1: Unfortunately no. Even many