标签: xcode8-beta3

Xcode 8 Beta 3使用Legacy Swift问题

我在Xcode 8 Beta 3中有一个Objective-C项目.自更新以来,每当我尝试构建时,都会收到以下错误:

对于使用Swift的目标,需要正确配置"使用Legacy Swift语言版本"(SWIFT_VERSION).使用[Edit> Convert> To Current Swift Syntax ...]菜单选择Swift版本或使用Build Settings编辑器直接配置构建设置.

有没有遇到过这个?由于它是一个Objective-C项目,因此没有构建设置来配置Swift.我还确保没有项目依赖项或CocoaPods使用Swift.我唯一的解决方案是使用Beta 2.任何想法如何解决这个问题?

我还应该提到我正在运行OSX 10.12 Beta 2.

swift xcode8 xcode8-beta3

200
推荐指数
6
解决办法
10万
查看次数

如何从iOS Xcode Simulator中删除应用程序?

为了以防万一,我们可以通过重置内容和设置来删除应用程序,但也可以从Xcode 7中的模拟器中删除单个应用程序.Xcode 8中不是这种情况.如何实现?我有一个强制触摸触控板,是否会影响从模拟器中删除应用程序?

force-touch ios10 xcode8-beta3

59
推荐指数
6
解决办法
2万
查看次数

Timer.scheduledTimer swift 3兼容iOS 10

我需要安排一个Timer来每秒触发一个函数,但是我发现在xcode 8 beta 3中,scheduledTimer仅适用于iOS 10.在iOS 9或之前版本中使用计时器有没有其他选择?

Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (timer) in print("Hi!")})
Run Code Online (Sandbox Code Playgroud)

ios swift ios9 ios10 xcode8-beta3

28
推荐指数
3
解决办法
5万
查看次数

Swift 3.0:如何调用CGImageCreateWithImageInRect()?

我需要在Swift 3.0中实现这个Objective-C代码(我正在使用Xcode 8 Beta 3):

// Note: this code comes from an Obj-C category on UIImage
CGImageRef imageRef = CGImageCreateWithImageInRect(self.CGImage, cropRect);
UIImage *image = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation];
Run Code Online (Sandbox Code Playgroud)

我在最新的文档中找不到任何内容CGImageCreateWithImageInRect().

cgimage swift swift3 xcode8-beta3

13
推荐指数
1
解决办法
8257
查看次数

如果App终止,则不会调用UNUserNotificationCenter didRecieve Response

如果应用程序未处于活动状态(甚至不在后台或已终止),则在3D Touch之后单击"通知中的操作按钮聊天"时不会调用UNUserNotificationCenter功能.我在Xcode中使用"附加到名称处理"来在应用程序终止时调试应用程序.这是代码:

import UIKit
import Mixpanel
import UserNotifications

@UIApplicationMain

class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        //setup mixpanel

        self.handlePushNotificationWithUserInfo(launchOptions: launchOptions)

        //ask for push notification perms
        return true
    }
Run Code Online (Sandbox Code Playgroud)

当通知弹出窗口(从MixPanel发送)时,首先调用此函数,

致电1:

    func handlePushNotificationWithUserInfo(launchOptions: [NSObject: AnyObject]?) {
        //Handle PushNotification when app is opened
    }
Run Code Online (Sandbox Code Playgroud)

然后它就在这里,

电话2:

    //register for notification
    func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {

        if #available(iOS 10.0, *) {
            let center = UNUserNotificationCenter.current() …
Run Code Online (Sandbox Code Playgroud)

apple-push-notifications swift3 ios10 xcode8 xcode8-beta3

6
推荐指数
1
解决办法
1万
查看次数

如何让SpriteKit Playgrounds在Xcode 8 beta中运行?

我希望能够在Playgrounds中轻松构建我的Sprite Kit代码原型.这在Xcode 7中工作正常

import UIKit
import SpriteKit
import XCPlayground


let sceneView = SKView(frame: CGRect(x:0 , y:0, width: 480, height: 320))

let scene = SKScene(size: CGSize(width: 480, height: 320))
sceneView.showsFPS = true
sceneView.presentScene(scene)
XCPlaygroundPage.currentPage.liveView = sceneView

let square = SKSpriteNode(imageNamed: "square")
square.name = "shape"
square.position = CGPoint(x: scene.size.width * 0.25, y: scene.size.height * 0.5)

let circle = SKSpriteNode(imageNamed: "circle")
circle.name = "shape"
circle.position = CGPoint(x: scene.size.width * 0.50, y: scene.size.height * 0.5)

let triangle = SKSpriteNode(imageNamed: "triangle")
triangle.name = "shape"
triangle.position …
Run Code Online (Sandbox Code Playgroud)

ios sprite-kit swift-playground swift3 xcode8-beta3

6
推荐指数
1
解决办法
2357
查看次数

无法提取xcode 8 beta 3

我已经下载了3次.徒步旅行两次,镀铬一次.

每次我都无法使用默认工具或Unarchiver取消归档.

基于这个苹果开发者线程,我试过:

$ xar -xf Xcode_8_beta_3\ \(1\).xip 
Error while extracting archive:(Content): archived-checksum sha1's do not match (No such file or directory)
Run Code Online (Sandbox Code Playgroud)

然后:

$ cpio -it < Xcode_8_beta_3\ \(1\).xip 
Content
cpio: Truncated input file (needed 4433260676 bytes, only 4433260317 available): Unknown error: -1
Run Code Online (Sandbox Code Playgroud)

我的驱动器上有25个可用空间,存在此文件(但如果是磁盘空间问题,为什么说我的压缩存档太小了〜250个字节?)

我正在使用OSX 10.11.4

谁知道发生了什么事?

xar xcode8 xcode8-beta3

5
推荐指数
1
解决办法
7269
查看次数

模拟度量标准"方向"下拉列表丢失

"属性"检查器中的"模拟指标"菜单缺少xCode 8.0 beta 3中的"方向"下拉选项.

例

我选择了根视图控制器.该选项不适用于任何视图.

xcode xcode8-beta3

4
推荐指数
1
解决办法
1534
查看次数