我想在我的应用程序中添加3d touch.我试图让用户在UITableViewCell上使用强制触摸,如此项目中所示.我正在运行此代码:
if traitCollection.forceTouchCapability == UIForceTouchCapability.Available {
registerForPreviewingWithDelegate(self, sourceView: view)
} else {
print("unavailable")
}
Run Code Online (Sandbox Code Playgroud)
我试过在iPhone 6s +上运行它,但我在日志中收到"不可用".为什么我不能在支持3d touch的设备上使用3d touch?谢谢你的帮助.
我在 Xcode 中有一个包含一些目标的项目。当我打开故事板文件时,项目开始构建。这是一个缓慢的过程...
当我打开故事板时,如何停止这个构建过程?
谢谢!
我的应用程序涉及用户创建数据并将其保存到其私有数据库.数据会占用iCloud帐户中的空间,还是会成为我的CloudKit存储配额的一部分?谢谢!
我在屏幕上有一个 UIButton。UIButton 没有宽度限制。我喜欢将 UIButton 扩展为指定的文本。但结果如下:
这是实现:
self.translatedPhraseButton.setTitle(self.selectedPhrase.translatedPhrase, for: .normal)
self.translatedPhraseButton.sizeToFit()
self.translatedPhraseButton.titleEdgeInsets = UIEdgeInsets(top: 0.0, left: 5.0, bottom: 0.0, right: 5.0)
self.translatedPhraseButton.layer.cornerRadius = 10.0
self.translatedPhraseButton.layer.masksToBounds = true
self.translatedPhraseButton.backgroundColor = UIColor(fromHexString: "2aace3")
Run Code Online (Sandbox Code Playgroud) 我目前正在使用 Xcode 7.5 betas 和 Swift 2 进行开发。我选择让我的项目在所有 iPhone 上运行。但是,我不想在 iPhone 4s 上运行它,因为屏幕尺寸太小。无论如何,我可以让它仅在 iPhone 5 - 6s 上运行吗?
我正在尝试向下滑动键盘以关闭它。我正在为我的键盘使用 UITextField。我见过类似的问题;然而,他们使用的是 UIScrollView/UITextView。使用:
scrollView.keyboardDismissMode = .Interactive
Run Code Online (Sandbox Code Playgroud)
我如何将它用于 UITextField?谢谢你的帮助。
我无法安装Firebase iOS SDK(v3.2.0).我按照Firebase的说明进行操作,但它将安装旧版SDK v2.5.1
Podfile看起来像
platform :ios, '9.0'
target 'FireBaseTestApp' do
use_frameworks!
pod 'Firebase', '>= 2.5.1'
pod 'Firebase/Core'
end
Run Code Online (Sandbox Code Playgroud)
错误
[!]无法满足以下要求:
Firebase/Core 需要的 Podfile您的规范来源都没有包含满足依赖关系的规范:Firebase/Core.
您有:*可以更新的过期源代码库pod repo update.*错误输入了名称或版本.*未将承载Podspec的源代码添加到您的Podfile.
我见过类似的多个问题; 但是,他们都没有解决我的问题.我的计时器太慢了.我只使用0.01秒的间隔.这是我的代码:
@IBOutlet var timerLabel: UILabel!
var miliseconds = 0
var seconds = 0
func updateLabel() {
if miliseconds == 0 {
timerLabel.text = "\(seconds).00"
} else if miliseconds < 10 {
timerLabel.text = "\(seconds).0\(miliseconds)"
} else {
timerLabel.text = "\(seconds).\(miliseconds)"
}
}
var timer = NSTimer()
func updateTime() {
miliseconds++
if miliseconds == 100 {
miliseconds = 0
seconds++
}
updateLabel()
}
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
if timerState == 1 {
timer = …Run Code Online (Sandbox Code Playgroud) 不久前,我记得把我的几个应用程序放到我的iPhone上.但是,一旦我升级了手机的软件,我的应用程序都无法运行.我不得不用新版本的Xcode重新安装它们.我最近发布了一个应用程序,我不确定它是否会在iOS 9.3发布时崩溃.我不希望这种情况发生,我想知道我能做些什么来解决它.我的Xcode项目目前允许所有软件大约9.0.
编辑所以人们对我所谈论的内容感到困惑.这就是我发生的事情,我有Xcode 7.0.1或者其他东西,而我的手机是9.0我在手机中内置的应用程序工作正常当我升级我的iPhone软件时,我的应用程序崩溃了.他们没有打开.
我在App Store发布了一个应用程序我想知道我的应用程序是否会在iOS 9.3中崩溃时希望更具体.
编辑:没关系
ios ×8
swift ×6
xcode ×2
cloudkit ×1
cocoapods ×1
firebase ×1
force-touch ×1
icloud ×1
iphone ×1
keyboard ×1
nstimer ×1
private ×1
storage ×1
storyboard ×1
swift2 ×1
time ×1
uitextfield ×1
xcode7 ×1
xcode7-beta5 ×1