问题标签 [xcode10.1]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
xcode - 在 xcode 10.1 上添加可本地化的字符串
我有一个 swift 应用程序,现在我想使用 NSLocalizedString 为应用程序中使用的一些字符串添加翻译。
为了做到这一点,我在项目中添加了一个名为 Localizable.strings 的文件,并按下文件检查器中的“本地化”按钮,以便向其中添加多种语言。然而,本地化列表中只出现了英文,我似乎无法添加更多内容。
在查看了 SO 并四处搜索之后,许多关于如何执行此操作的文章都提到我应该在构建设置下为我的项目添加更多语言。但是我可以在本地化下更改的唯一设置是一个名为“本地化字符串宏名称”的设置,并且没有添加语言的选项。也没有“使用基本国际化”标记来检查。
我还尝试单击我的项目,然后单击编辑器-> 添加本地化,但是所有语言都显示为灰色,我无法选择其中任何一种。
因此,我认为您应该在最新版本的 xcode(10.1 atm)中以不同的方式执行此操作。谁能帮我弄清楚你应该怎么做?
swift - Xcode10 - dyld:没有为框架中安装的 pod 加载库
我有一个带有目标框架的项目。
- 主应用目标
- 框架A
FrameworkA 是唯一使用某个 pod 的,因此在我的 pod 文件中我有类似的东西
构建成功没有问题,但是当我在模拟器上运行应用程序时,应用程序立即崩溃并显示以下错误消息:
我尝试了所有常见的嫌疑人(删除派生数据,清理,pod deintegrate ...)到目前为止没有任何效果。
知道为什么会发生这种情况,以及如何在不必在两个目标上安装所有 Pod 的情况下使其工作吗?
该应用程序在 Swift 4.2 中。
ios - 设备上的退出代码 1
我为我的网站制作了一个 WebView 应用程序。在 Xcode 中应用程序启动得非常好。当我尝试在我的 iPhone Xcode 上启动它时,给我一个错误代码 1。使用 iPhone XS Max Simulator 它运行良好。当我尝试在我自己的 iPhone 上启动该应用程序时,我收到此错误:
错误:失败,退出代码为 1
任何人都可以帮助我吗?
ios - 未找到 GStreamer Xcode 10.1 gst/gst.h
Xcode 10.1 中出现未找到 GStreamer gst.h 文件错误。有没有人能够找到它的解决方案???
即使我使用 Objective-C 作为 iOS 项目的主要语言,也会出现此错误。
swift - WKWebView 不能通过键盘交互
一般来说,我是 swift 和苹果开发的新手(来自 JS 世界)。我正在尝试通过包装 WKWebView 来做一个简单的桌面应用程序。ViewController 创建 webView 的部分工作正常。至少看起来是这样:它加载了一个网页:)
但是当我单击任何输入字段时,我无法写任何东西。该字段中甚至没有可见的光标。
基本上只有通过鼠标/触摸板点击才有效。但鼠标光标悬停在元素(例如按钮和文本字段)上时不会改变。在我看来,网页上方有某种蒙版/图层。单击会传播到页面本身,但不会传播到悬停和击键
应用程序中是否有任何特殊的项目设置/权限启用键盘?如何使页面输入可编辑?
更多细节:
- 单击文本字段有效(它会根据焦点选择器更改边框颜色)
- 单击
<a>
webview 作品中的链接 - 鼠标右键单击似乎有效(它显示复制/粘贴选项等)
- 通过鼠标右键单击粘贴到现场工作
代码:
Ww
是 WebKit 视图Ww
覆盖所有View
区域(鼠标拖放)
感谢您的任何回答或提示!
ios12 - How Do I Hit Test A SubView's Layers?
I have encountered a challenge in my application. I want to be able to tap in a subview and determine which of the subview's layers was tapped. I (naively?) chose to use the hitTest(:CGPoint) method of the subview's root layer. The results were not what I expected. I have created a playground to illustrate the difficulty.
The playground (code below):
- Creates a view controller and its root view
- Adds a subview to the root view
- Adds a sublayer to the subview's root layer
Here is what it looks like:
- The root view's root layer is black
- The subview's root layer is red
- The subview's sublayer is translucent gray
- The white line is there for illustrative purposes
With the playground running I start tapping, beginning at the top of the white line and moving down. Here are the print statements produced by the tap gesture handling method:
Root view tapped @(188.5, 12.5)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)Root view tapped @(188.5, 49.0)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)Root view tapped @(188.5, 88.5)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)Sub view tapped @(140.0, 11.0)
Sub view tapped @(138.5, 32.5)
Sub view tapped @(138.5, 55.5)
Sub view tapped @(138.0, 84.0)
Sub view tapped @(139.0, 113.0)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)Sub view tapped @(138.0, 138.5)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)Sub view tapped @(140.0, 171.5)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)Sub view tapped @(137.5, 206.5)
Hit test returned "Sub View -> Sub Layer" with frame (50.0, 100.0, 175.0, 268.0)Sub view tapped @(135.5, 224.0)
Hit test returned "Sub View -> Sub Layer" with frame (50.0, 100.0, 175.0, 268.0)
You can see that as I tap in the root view things are "normal". As soon as I enter into the subview the hit test no longer finds a layer until I am more than 100 points below the top of the subview; at which point the subview's root layer is encountered. 100 points after that the sublayer of the subview's root layer is encountered.
What is going on? Well, apparently, when the subview was added to the root view, the subview's root layer became a sublayer of the root view's root layer and its frame was altered to reflect its placement in the root view's root layer instead of in the sub view.
So, may questions are:
- Am I correct regarding what has apparently happened?
- Is it normal and expected?
- How do I deal with it?
Thank you for taking the time to consider my question.
Here is the playground code:
Update: Problem Solved
With guidance from the always knowledgeable Matt Nueburg (and his most excellent book), I modified the tap gesture handler method to the following:
Now the console output looks good:
Root view tapped @(186.0, 19.0)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)
Root view tapped @(187.0, 45.0)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)
Root view tapped @(187.0, 84.5)
Hit test returned "Root View -> Root Layer" with frame (0.0, 0.0, 375.0, 668.0)
Sub view tapped @(138.0, 9.0)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)
Sub view tapped @(137.5, 43.5)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)
Sub view tapped @(138.5, 77.5)
Hit test returned "Sub View -> Root Layer" with frame (50.0, 100.0, 275.0, 468.0)
Sub view tapped @(138.0, 111.0)
Hit test returned "Sub View -> Sub Layer 1" with frame (50.0, 100.0, 175.0, 268.0)
Sub view tapped @(138.5, 140.5)
Hit test returned "Sub View -> Sub Layer 1" with frame (50.0, 100.0, 175.0, 268.0)
Sub view tapped @(139.5, 174.5)
Hit test returned "Sub View -> Sub Layer 1" with frame (50.0, 100.0, 175.0, 268.0)
Second Update - Clearer Code
I am circling back with the code that I ended up using to detect touches on sub layers. It is, I hope, more clear than the playground code above.