xcode6

Example handling JSON with SwiftyJSON

我怕爱的太早我们不能终老 提交于 2020-01-28 05:34:29
问题 I would like to handle json with SwiftJSON, but I stacked. Does anyone show me example code? I tried to use this library. https://github.com/SwiftyJSON/SwiftyJSON Although I placed SwiftyJSON.swift in the same project, I have error "No such module "SwiftyJSON"" So correct my code or show me example code handling json from web with swiftyJSON lib. Here is my code: import UIKit import SwiftyJSON // No such module "SwiftyJSON" class ViewController: UIViewController { override func viewDidLoad()

Swift Equatable Protocol

坚强是说给别人听的谎言 提交于 2020-01-26 16:28:53
问题 I was folling this tutorial for Swift: https://www.raywenderlich.com/125311/make-game-like-candy-crush-spritekit-swift-part-1 and came across this code: func == (lhs: Cookie, rhs: Cookie) -> Bool { return lhs.column == rhs.column && lhs.row == rhs.row } I wrote exactly that, but Xcode is giving my these errors: Consecutive declarations on a line must be separated by ';' Expected declaration operators are only allowed at global scope I found this code from apple's documentation: https:/

Swift Equatable Protocol

给你一囗甜甜゛ 提交于 2020-01-26 16:28:16
问题 I was folling this tutorial for Swift: https://www.raywenderlich.com/125311/make-game-like-candy-crush-spritekit-swift-part-1 and came across this code: func == (lhs: Cookie, rhs: Cookie) -> Bool { return lhs.column == rhs.column && lhs.row == rhs.row } I wrote exactly that, but Xcode is giving my these errors: Consecutive declarations on a line must be separated by ';' Expected declaration operators are only allowed at global scope I found this code from apple's documentation: https:/

Apps built with Xcode 6 don't run on iOS8

霸气de小男生 提交于 2020-01-24 22:12:30
问题 I recently updated to Xcode 6 beta 3 . When I run my app in Xcode 6 beta 2 it runs fine. When I run my app in beta 3 on an iOS7 device it runs fine. However, when I run using beta 3 and iOS8 beta 3 , it builds, claims it is running (in the toolbar feedback); and – about 5 seconds after that – it shows "finished running" in the toolbar. The app isn't installed on the phone after all this. There isn't anything logged in the console. Everything from Xcode 's side appears fine. I did manage to

Xcode 6 beta color picker issue

独自空忆成欢 提交于 2020-01-24 17:42:10
问题 Problem: The color picker isn't picking up the exact color. This is the same problem listed here: Wrong color in Interface Builder's color picker I've tried: Color picker -> gear button next to sliders -> select Generic RGB. System Preferences -> Displays -> Color Profile -> Generic RGB Profile. Disabled any apps that may affect color profile (Datacolor SpyderPro, Flux). I've looked at these questions already: Wrong color in Interface Builder's color picker Weird colors in XCode Interface

Swift can't show back button after hiding it

元气小坏坏 提交于 2020-01-24 17:04:45
问题 I have a UITableViewController with static cell that has a custom back button. I hide the back button in viewDidLoad with the code: var cancelBtn = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Plain, target: self, action: "closeSettings") self.navigationItem.hidesBackButton = true self.navigationItem.leftBarButtonItem = cancelBtn If I don't have the self.navigationItem.hidesBackButton = true line in place, the back button arrow still appears. With that line in the code, the

How to make a table from a dictionary with multiple content types in Swift?

青春壹個敷衍的年華 提交于 2020-01-22 10:33:51
问题 I have made an NSArray with NSDictionary objects containing contents downloaded from an api. I also made a tableview object on main.storyboard with a prototype cell with a UIImage label and two text labels as its contents. How can I put the data from array to table so that each cell with same style as my prototype shows contents of NSDictionary from the array. 回答1: You have to implement UITableViewDataSource methods Remember to set dataSource property of tableView to ViewController Than you

Cannot access repositories on OS X Server 3.2.1 with Xcode 6.0.1

大城市里の小女人 提交于 2020-01-22 02:57:05
问题 EDIT: The problem is apparently solved with OSX Server Version 4. Original post: I have some git repositories on OS X server. Earlier I could access them from a remote Xcode without problems. After the upgrade to OS X Server 3.2.1 with Xcode 6.0.1 , I can no longer access them: If I try to add the server to a the Xcode via Preferences / Accounts, it says Xcode Server is unavailable If I try it via the terminal with the command git clone <repository path> it is asking for the password (i.e. it

Xcode 6 GM Seed - iPhone 6 simulator does not show the home button

笑着哭i 提交于 2020-01-22 02:53:26
问题 I am creating a game in Xcode-6-GM-Seed and am having an issue that the home button is not showing up in the simulator. I need to be able to press the home button to be able to quickly delete the app from the phone but am not seeing the home button. How do I get around this? Is there some sort of command to use or do I need to do it programmatically until they add the home button? Is there another way to delete the app and it's content? 回答1: Use Command + Shift + H for pressing Home button.

“No such module 'LocalAuthentication'” when trying to import in Xcode 6 using Swift

梦想与她 提交于 2020-01-21 11:46:10
问题 I wanted to build a simple demo app using the new LocalAuthentication framework and Swift. I made a new Single View project, and added one line to the top of the ViewController.swift file: import LocalAuthentication Whereupon Xcode tells me there is no such module. Obviously very new to Swift, what am I doing wrong? 回答1: Same problem occurs with Objective-C code. Seems like it is an issue of beta 1. If you run your project on an iOS 8 device (tested on a 5s iPhone), it will work. But it doesn