CocoaPods问题:
我已经创建了一个与内部静态库捆绑在一起的框架,具体取决于AFNetworking和资源包(基于这两个教程来创建FWKs http://www.blackjaguarstudios.com/blog/programming/2012/11/22/xcode- 45-creating-ios-framework-and-hold-my-hand-im-3-years-old和https://github.com/bclubb/iOS-Framework)
我想创建一个podspec,以便人们只需在他们的Podfile中添加一行,如果需要,可以在pod安装时添加我的框架和AFNetworking.
这可能吗?
我有这段代码:
begin
complete_results = Timeout.timeout(4) do
results = platform.search(artist, album_name)
end
rescue Timeout::Error
puts 'Print me something please'
end
Run Code Online (Sandbox Code Playgroud)
然后我启动包含此代码的方法,以及这里是堆栈跟踪的开始:
Exception message : execution expired Exception backtrace : /***/****/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:64:i
所以我天真地认为我的通话时间已经过去了.但是,"打印我喜欢的东西"永远不会被打印出来,并且complete_results假设是超时状态返回值(无论是真还是假,如文档中所提到的),最终都不是布尔值.
难道我做错了什么?
我正在尝试做一些在我脑海中非常直接的事情。
我想要一个 VStack 的子视图根据其内容动态更改其高度(下面示例中的 ProblematicView)。
它通常工作得很好,但在这种情况下, ProblematicView 包含一个 GeometryReader (以模拟多行的 HStack)。
但是, GeometryReader 贪婪地占用所有空间(如果您删除 GeometryReader 及其内容,则会发生预期的行为)。不幸的是,在父视图(下面示例中的 UmbrellaView)上,UmbrellaView VStack 将自身的 50% 分配给 ProblematicView,而不是显示视图内容的最小尺寸。
我花了几个小时玩 min/ideal/maxHeight 框架参数,但无济于事。
我想要实现的目标可行吗?
我在底部添加了图片以在视觉上澄清。
struct UmbrellaView: View {
var body: some View {
VStack(spacing: 0) {
ProblematicView()
.background(Color.blue)
ScrollView(.vertical) {
Group {
Text("A little bit about this").font(.system(size: 20))
Divider()
}
Group {
Text("some").font(.system(size: 20))
Divider()
}
Group {
Text("group").font(.system(size: 20)).padding(.bottom)
Divider()
}
Group {
Text("content").font(.system(size: 20))
}
}
}
}
}
struct ProblematicView: View {
var body: …Run Code Online (Sandbox Code Playgroud)