- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在尝试访问 documented 时遇到构建错误UIScreen 的属性。
尝试编译 -
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print(UIScreen.availableModes)
}
}
Build target ass of project ass with configuration Debug
Create product structure
/bin/mkdir -p /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator/ass.app
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd /Users/maximveksler/Developer/ass
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name ass -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -target x86_64-apple-ios9.2 -g -module-cache-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -enable-testing -I /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -F /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -c -j8 /Users/maximveksler/Developer/ass/ass/ViewController.swift /Users/maximveksler/Developer/ass/ass/AppDelegate.swift -output-file-map /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ass-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ass.swiftmodule -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-generated-files.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-own-target-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-all-target-headers.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-project-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources/x86_64 -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ass-Swift.h -Xcc -working-directory/Users/maximveksler/Developer/ass
CompileSwift normal x86_64 /Users/maximveksler/Developer/ass/ass/ViewController.swift
cd /Users/maximveksler/Developer/ass
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/maximveksler/Developer/ass/ass/ViewController.swift /Users/maximveksler/Developer/ass/ass/AppDelegate.swift -target x86_64-apple-ios9.2 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -I /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -F /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-generated-files.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-own-target-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-all-target-headers.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-project-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources/x86_64 -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/maximveksler/Developer/ass -emit-module-doc-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController~partial.swiftdoc -Onone -module-name ass -emit-module-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController~partial.swiftmodule -serialize-diagnostics-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController.dia -emit-dependencies-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController.d -emit-reference-dependencies-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController.swiftdeps -o /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/ViewController.o
/Users/maximveksler/Developer/ass/ass/ViewController.swift:16:15: error: instance member 'availableModes' cannot be used on type 'UIScreen'
print(UIScreen.availableModes)
^~~~~~~~ ~~~~~~~~~~~~~~
CompileSwift normal x86_64 /Users/maximveksler/Developer/ass/ass/AppDelegate.swift
cd /Users/maximveksler/Developer/ass
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/maximveksler/Developer/ass/ass/ViewController.swift -primary-file /Users/maximveksler/Developer/ass/ass/AppDelegate.swift -target x86_64-apple-ios9.2 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -I /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -F /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-generated-files.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-own-target-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-all-target-headers.hmap -Xcc -iquote -Xcc /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/ass-project-headers.hmap -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources/x86_64 -Xcc -I/Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/maximveksler/Developer/ass -emit-module-doc-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc -Onone -module-name ass -emit-module-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule -serialize-diagnostics-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate.dia -emit-dependencies-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate.d -emit-reference-dependencies-path /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate.swiftdeps -o /Users/maximveksler/Library/Developer/Xcode/DerivedData/ass-endgssgsbtcuwefqpkdefxgnlbqo/Build/Intermediates/ass.build/Debug-iphonesimulator/ass.build/Objects-normal/x86_64/AppDelegate.o
最佳答案
availableModes 是一个属性,应该在 UIScreen 实例上使用。
print(UIScreen.mainScreen().availableModes)
我试图使用 UIScreen 类上的属性,但它不起作用。从 API POV 来看,这也完全有意义,因为抽象屏幕的投注屏幕模式没有多大意义。
关于ios - 实例成员 'availableModes' 不能用于类型 'UIScreen',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34364414/
我最近做了并更新了我的 Xamarin iOS 项目,我曾经能够调用以下代码来检索屏幕宽度和高度: if (orientation == UIInterfaceOrientation.Landscap
我想创建一个没有任何 Storyboard的项目。 我已删除 Main 和 LaunchScreen Storyboard。 像往常一样,我添加到我的 applicationDidFinishLaun
我想将内容全屏放置在外部屏幕上(现在是使用 Air Server 的 MacBook Pro),并在平板电脑上放置一个屏幕。 我正在使用 https://github.com/quellish/Air
我正尝试在屏幕打开时推送通知,但我不知道如何检测到。有没有办法检测 UIScreen 何时打开? 最佳答案 简短的回答是否定的。与 UIScreen 关联的唯一(公共(public))通知可以在 UI
我有一个方法负责加载有关事件的详细信息(查询 sqlite 数据库中的标题、描述、缩略图路径等),因为我需要为大量事件调用它,所以我正在调度使用 Grand Central Dispatch 到后台线
window = UIWindow(frame: UIScreen.mainScreen().bounds) 在这一行我得到了上面的错误。根据以前的帖子,我看到它在 Swift 3.0 中发生了变化,
如何将代码简化为一行? CGRect screen = [[UIScreen mainScreen] bounds]; NSLog(@"%@", screen.size.width); 感谢您的宝贵
我在 info.plist 文件中禁用了除纵向模式之外的所有方向模式,因为我不希望应用程序旋转。但是我希望一个 View Controller 仅处于横向模式。我可以在 View Controller
只需这样做: [[UIScreen mainScreen] setBrightness:0.2]; 不起作用。对应用程序完全没有影响。是否需要设置其他设置才能使其正常工作? 最佳答案 它可以在设备上运
这个问题在这里已经有了答案: App not sized properly iOS 8 iPhone simulator (1 个回答) 关闭 8 年前。
我正在制作一个 iPad 应用程序,它从纵向开始,但可以旋转到横向。在 -(void) loadView 中,我调用函数 drawView。在 drawView 中,我有这行代码: CGRect r
我想从包括状态栏在内的 View 中截取快照。 下面的代码可以在模拟器中运行,但不能在物理设备上运行。 extension UIScreen { class func screenshot()
您好,我正在以编程方式启动一个 rootViewController(只有门户,没有风景) 这是代码使用 CGRect appFrame = [[UIScreen mainScreen] bounds
我在 iOS 5.0.1 中的 [UIScreen screens] 中看到了奇怪的行为,在我们记录到 Flurry 崩溃的报告中。有时 [UIScreen screens] 会返回一个空数组。我们的
目前我正在尝试创建一个应用程序来调整设备的亮度。在 iOS5 中,mainScreen 新增了 brightness 属性,可以设置屏幕亮度。我正在使用以下代码: [[UIScreen mainScr
为什么我在 Apple 的一些示例代码(例如 PhotoScroller)中看到我应该在 loadView 中执行以下操作: CGRect frame = [[UIScreen mainScreen]
我有点生气。我有一个应用程序,其状态栏在主窗口中可见。因为我想动态设置我的 View 及其框架大小(例如,状态栏在通话期间可能占用 40 像素)。 我可以执行以下两个操作之一: [[UIScreen
我正在尝试在没有镜像模式的情况下使用 Airplay 在 Apple TV 上显示图片。但是 [UIScreen screens] 方法在镜像关闭时总是返回 1 个屏幕(主屏幕)。我希望我的图片显示与
我正在尝试在没有镜像模式的情况下使用 Airplay 在 Apple TV 上显示图片。但是 [UIScreen screens] 方法在镜像关闭时总是返回 1 个屏幕(主屏幕)。我希望我的图片显示与
我在尝试访问 documented 时遇到构建错误UIScreen 的属性。 重现 Xcode 版本 7.2 (7C68) iOS 9.2 swift 尝试编译 - import UIKit clas
我是一名优秀的程序员,十分优秀!