当我启用所有异常断点时,我的应用程序总是在AppDelegate中停止,但我能够继续执行程序,但它非常讨厌的原因总是把我带到appdelegate.有什么想法吗?

我正试图UIImageView在Swift中旋转180度的旋转
UIView.animateWithDuration(1.0, animations: { () -> Void in
self.arrowImageView.transform = CGAffineTransformMakeRotation(CGFloat(180 * M_PI))
}) { (succeed) -> Void in
}
Run Code Online (Sandbox Code Playgroud)
但根本没有动画.我想使用animateWithDuration,因为我想在某些时候使用它CGAffineTransformMakeIdentity
使用UIView动画有效.
UIView.beginAnimations(nil, context: nil)
UIView.setAnimationDuration(1)
UIView.setAnimationCurve(UIViewAnimationCurve.EaseIn)
let radians = CGFloat(180 * M_PI / 180)
arrowImageView.transform = CGAffineTransformMakeRotation(radians)
UIView.commitAnimations()
Run Code Online (Sandbox Code Playgroud) 我在VC中有一个全屏的containerView.如果我从一个故事板手动添加一个子容器到containerView做一个嵌入segue看起来很好:

但是如果我通过代码嵌入VC:
class BannerContainerVC: UIViewController {
@IBOutlet weak var container: UIView!
override func viewDidLoad() {
super.viewDidLoad()
let vc = storyboard?.instantiateViewControllerWithIdentifier("test") as UIViewController
self.container.addSubview(vc.view)
}
}
Run Code Online (Sandbox Code Playgroud)
我得到了超级奇怪的结果:

如何通过accessibilityLabel或标识符声明按钮存在?
func testExitsButton() {
XCTAssertTrue(app.windows.containing(.button, identifier: "Button Text").element.exists)
XCTAssertTrue(app.buttons["Button Text"].exists)
XCTAssertTrue(app.buttons["test"].exists) <- I want this, instead of accessing the text property I want by specific id, maybe the text property override the accessibilityLabel?
}
Run Code Online (Sandbox Code Playgroud)
我在自定义视图上创建了@ IBDesignable,以便从IB设置属性.但是我觉得这个类不是符合关键值的编码,尽管我在班上有这个属性.
@IBDesignable class ExclusiveSelectorView: UIView {
@IBInspectable var cellWidth: CGFloat?
}
Run Code Online (Sandbox Code Playgroud)
无法在(Test.ExclusiveSelectorView)上设置(cellWidth)用户定义的检查属性:[setValue:forUndefinedKey:]:此类不是密钥cellWidth的密钥值编码兼容.
我有一个返回Bool Observable的函数,具体取决于它是否正常.
func test() -> Observable<Bool> {
if everythingIsOk {
return just(true)
}
return just(false) <- how can i here return a custom error to retrieve what failed?
}
Run Code Online (Sandbox Code Playgroud) 当我尝试播放不同音高的音频时,我收到此消息:

我没有成功就用谷歌搜索了那个错误.如果我设置断点,它会在此处停止:

我测试打印所有对象,看看有什么是尼特,但我没有找到任何东西.最神奇的事情是,只发生在我的iphone6 +中,在我测试过的其他手机中没有破坏.然后搜索我调查的项目,添加这个声音效果,这是:https: //github.com/atikur/Pitch-Perfect 如果你运行它,它可以工作,直到你改变...
AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, error: &error)
Run Code Online (Sandbox Code Playgroud)
至:
AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, error: &error)
Run Code Online (Sandbox Code Playgroud)
然后繁荣(只有真正的设备连接到XCODE,它在模拟器中工作):
2015-03-21 11:56:13.311 Pitch Perfect [1237:607678] 11:56:13.311 ERROR:[0x10320c000] AVAudioFile.mm:496: - [AVAudioFile readIntoBuffer:frameCount:error:]:error -50 2015-03 -21 11:56:13.313 Pitch Perfect [1237:607678] *由于未捕获的异常'com.apple.coreaudio.avfaudio'终止app,原因:'error -50'*第一次抛出调用堆栈:(0x18687a530 0x1978040e4 0x18687a3f0 0x1851ea6c0 0x185232d38 0x1852130f8 0x185212ccc 0x100584fd4 0x100584f94 0x10058fdb8 0x1005882c4 0x1005925d4 0x100592208 0x198037dc8 0x198037d24 0x198034ef8)libc ++ abi.dylib:以NSException类型的未捕获异常终止
真正非常奇怪的是这个截图,由于某些原因,在打印audioEngine后,audioEngine.outputNode变为零?

我试图将 SwiftUI 标签的图像和文本垂直居中。我尝试覆盖图像的alignmentGuide,但它不起作用。有任何想法吗?
Label {
Text("Test fdasf \n adfsa dsfsd f asdf \n asd fasd fads sad fda")
} icon: {
Image(systemName: true ? "checkmark.circle.fill" : "circle")
.alignmentGuide(VerticalAlignment.top) {
$0[VerticalAlignment.center]
}
}
Run Code Online (Sandbox Code Playgroud)
我的项目中有自定义字体。但是我检测到 XCode 附带的一些字体也有同样的问题。由于未知原因,如果我将重音设置为大写字母(这在西班牙很常见,例如Á lgreba),文本的顶部将被剪切。
对于其他字体更清晰,因为我什至看不到半重音。我可以用 UILabel 设置高度约束来做一个技巧,但是这个技巧不适用于 UIButton 或导航栏的标题。我也在 UILabel 中尝试调用 sizeToFiT 但没有成功。
ios ×10
swift ×9
xcode ×2
autolayout ×1
avfoundation ×1
core-audio ×1
objective-c ×1
rx-swift ×1
storyboard ×1
swiftui ×1
xctest ×1