我正在构建一个要在私有 pod 规范存储库中使用的私有框架。让我们将框架称为“IOSExampleFramework”。
我在尝试将 plist 与我的源文件捆绑在一起时遇到问题。我的 pod 规范的一个例子是:
Pod::Spec.new do |s|
s.name = "IOSExampleFramework"
s.version = "0.0.2"
s.summary = "IOSExampleFramework Framwork"
s.description = <<-DESC
This framework is an example framework for stack overflow question purposes.
DESC
s.homepage = "http://example.com"
s.license = { :type => "Custom", :text => <<-LICENSE
Copyright Stephen Biggerstaff
LICENSE
}
s.author = { "Stephen Biggerstaff" => "stephen.biggerstaff@example.com" }
s.ios.deployment_target = "8.0"
s.source = { :git => "https://exampleRepo.git", :tag => "0.0.2" }
s.source_files = "Classes", "IOSExampleFramework/IOSExampleFramework/*.{h,m}"
#s.resource = …Run Code Online (Sandbox Code Playgroud) 我想将一个浮点数向下舍入,这样我就可以得到0.5到7之间的任何值(任意小数位数),同时舍入任何低于0.5到0.5的值.
例如,
0.1, 0.11442, 0.46 would all be 0.5.
1.1, 1.43, 1.35 would all be 1.
1.56, 1.6, 1.8 would all be 1.5.
Run Code Online (Sandbox Code Playgroud)
超过5的任何一个将向下舍入到5.
我想要的最终数据集是0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5.
我不知道任何向下舍入的函数Objective C,而不是整数.