Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
折叠所有功能的快捷方式⌘⌥⇧←;不再在Xcode 10.1中工作?_Xcode_Xcode10.1 - Fatal编程技术网

折叠所有功能的快捷方式⌘⌥⇧←;不再在Xcode 10.1中工作?

折叠所有功能的快捷方式⌘⌥⇧←;不再在Xcode 10.1中工作?,xcode,xcode10.1,Xcode,Xcode10.1,与共享的一样,快捷方式⌘ ⌥ ⇧ ← 可用于折叠所有功能。然而,当我在Xcode 10.1上尝试时,它无法工作 ⌘ ⌥ ← 工作(折叠一个功能) 在Xcode 10.1中是否删除了此默认快捷方式 显然,⌘ ⌥ ⇧ ← 仅对函数崩溃有效。如果代码中没有函数,则什么也看不到。但是⌘ ⌥ ← 在类、枚举等方面工作 例如,下面的代码在使用时看不到任何效果⌘ ⌥ ⇧ ← extension UIColor { open class var brightRedColor: UIColor {

与共享的一样,快捷方式⌘ ⌥ ⇧ ← 可用于折叠所有功能。然而,当我在Xcode 10.1上尝试时,它无法工作

⌘ ⌥ ← 工作(折叠一个功能)


在Xcode 10.1中是否删除了此默认快捷方式

显然,⌘ ⌥ ⇧ ← 仅对函数崩溃有效。如果代码中没有函数,则什么也看不到。但是⌘ ⌥ ← 在类、枚举等方面工作

例如,下面的代码在使用时看不到任何效果⌘ ⌥ ⇧ ←

extension UIColor {
  open class var brightRedColor: UIColor {
    return UIColor(red: 255.0/255.0, green: 59.0/255.0, blue: 48.0/255.0, alpha: 1.0)
  }
  open class var brightGreenColor: UIColor {
    return UIColor(red: 76.0/255.0, green: 217.0/255.0, blue: 100.0/255.0, alpha: 1.0)
  }
  open class var brightBlueColor: UIColor {
    return UIColor(red: 0.0, green: 122.0/255.0, blue: 1.0, alpha: 1.0)
  }
}
但按下后,下面确实会看到效果(包括
类func
)⌘ ⌥ ⇧ ←

class BugFactory {

    // MARK: Properties

    static let bugTints: [UIColor] = [.black, .brightBlueColor, .brightRedColor, .brightGreenColor]
    static let shakeRotations = [Double.pi/16, Double.pi/8, Double.pi/8, Double.pi/24]
    static let shakeDurations = [0.3, 3.0, 0.1, 0.5]
    static let bugSize = CGSize(width: 128, height: 128)

    enum BugType: Int {
        case basic, slow, fast, smooth
    }

    var currentBugType = BugType.basic

    // MARK: Create Bug

    func createBug() -> UIImageView {
        let bug = UIImageView(frame: CGRect(x: -100, y: -100, width: 128, height: 128))
        bug.image = UIImage(named: "spider")
        bug.tintColor = BugFactory.bugTints[currentBugType.rawValue]

        // add simple "shake" key-frame animation
        // for explanation, see http://www.objc.io/issue-12/animations-explained.html
        let shakeAnimation = CABasicAnimation(keyPath: "transform.rotation")
        shakeAnimation.toValue = 0.0
        shakeAnimation.fromValue = BugFactory.shakeRotations[currentBugType.rawValue]
        shakeAnimation.duration = BugFactory.shakeDurations[currentBugType.rawValue]
        shakeAnimation.repeatCount = Float.infinity
        shakeAnimation.autoreverses = true
        shakeAnimation.isRemovedOnCompletion = false
        bug.layer.add(shakeAnimation, forKey: "shake")

        return bug
    }

    // MARK: Shared Instance

    class func sharedInstance() -> BugFactory {

        struct Singleton {
            static var sharedInstance = BugFactory()
        }

        return Singleton.sharedInstance
    }
}

显然,⌘ ⌥ ⇧ ← 仅对函数崩溃有效。如果代码中没有函数,则什么也看不到。但是⌘ ⌥ ← 在类、枚举等方面工作

例如,下面的代码在使用时看不到任何效果⌘ ⌥ ⇧ ←

extension UIColor {
  open class var brightRedColor: UIColor {
    return UIColor(red: 255.0/255.0, green: 59.0/255.0, blue: 48.0/255.0, alpha: 1.0)
  }
  open class var brightGreenColor: UIColor {
    return UIColor(red: 76.0/255.0, green: 217.0/255.0, blue: 100.0/255.0, alpha: 1.0)
  }
  open class var brightBlueColor: UIColor {
    return UIColor(red: 0.0, green: 122.0/255.0, blue: 1.0, alpha: 1.0)
  }
}
但按下后,下面确实会看到效果(包括
类func
)⌘ ⌥ ⇧ ←

class BugFactory {

    // MARK: Properties

    static let bugTints: [UIColor] = [.black, .brightBlueColor, .brightRedColor, .brightGreenColor]
    static let shakeRotations = [Double.pi/16, Double.pi/8, Double.pi/8, Double.pi/24]
    static let shakeDurations = [0.3, 3.0, 0.1, 0.5]
    static let bugSize = CGSize(width: 128, height: 128)

    enum BugType: Int {
        case basic, slow, fast, smooth
    }

    var currentBugType = BugType.basic

    // MARK: Create Bug

    func createBug() -> UIImageView {
        let bug = UIImageView(frame: CGRect(x: -100, y: -100, width: 128, height: 128))
        bug.image = UIImage(named: "spider")
        bug.tintColor = BugFactory.bugTints[currentBugType.rawValue]

        // add simple "shake" key-frame animation
        // for explanation, see http://www.objc.io/issue-12/animations-explained.html
        let shakeAnimation = CABasicAnimation(keyPath: "transform.rotation")
        shakeAnimation.toValue = 0.0
        shakeAnimation.fromValue = BugFactory.shakeRotations[currentBugType.rawValue]
        shakeAnimation.duration = BugFactory.shakeDurations[currentBugType.rawValue]
        shakeAnimation.repeatCount = Float.infinity
        shakeAnimation.autoreverses = true
        shakeAnimation.isRemovedOnCompletion = false
        bug.layer.add(shakeAnimation, forKey: "shake")

        return bug
    }

    // MARK: Shared Instance

    class func sharedInstance() -> BugFactory {

        struct Singleton {
            static var sharedInstance = BugFactory()
        }

        return Singleton.sharedInstance
    }
}