小编Sao*_*ood的帖子

使用Metal Kit iOS从底部到顶部的水流量

我正在创建一个应用程序,其中水将从底部流到顶部.我使用来自https://github.com/FlexMonkey/ParticleLab的源做了很多更改

请在下面的链接上找到视频,这看起来像牛奶,但我想把它变成真正的水流. http://expirebox.com/download/6e3c11ca4fb969df976b51628d1d9c89.html

在此输入图像描述

func resetParticles(edgesOnly: Bool = false, distribution: Distribution = Distribution.Gaussian)
{
    func rand() -> Float32
    {
        return Float(drand48() * -20.005)
    }

    func rand2() -> Float32
    {
        return Float(drand48() * 4)
    }

    let imageWidthDouble = Double(imageWidth/8)
    let imageHeightDouble = Double(Float(imageHeight)/1)
    let randomSource = GKRandomSource()
    let randomWidth: GKRandomDistribution
    let randomHeight: GKRandomDistribution

    switch distribution
    {
    case .Gaussian:
        randomWidth = GKGaussianDistribution(randomSource: randomSource, lowestValue: 0, highestValue: Int(imageWidthDouble))
        randomHeight = GKGaussianDistribution(randomSource: randomSource, lowestValue: 0, highestValue: Int(imageHeightDouble))

    case .Uniform:
        randomWidth = GKShuffledDistribution(randomSource: randomSource, …
Run Code Online (Sandbox Code Playgroud)

ios swift metalkit

6
推荐指数
0
解决办法
562
查看次数

显示使用 SFSafariviewController 进行打印的打印活动按钮

在 sfsafariviewcontroller 屏幕中,共享按钮仅显示没有打印选项的默认活动选项,但我想仅显示打印活动选项。

有委托方法返回活动。我想返回 UIPrintActivity 选项。

func safariViewController(控制器:SFSafariViewController,activityItemsForURL URL:NSURL,标题:字符串?) - > [UIActivity]

ios uiactivity sfsafariviewcontroller

5
推荐指数
0
解决办法
399
查看次数

如何将第三方 iOS pod 库添加到 kotlin 原生项目中?收到错误“SharedCode:cinteropAFNetworkingIos 失败”

我创建了 Kotlin 原生项目以在 iOS 和 android 之间共享代码。我对 cocoapods 进行了集成,以便使用 POD 文件在 iOS 项目中使用,项目在 iOS 和 Android 上成功运行,但是当我尝试在 Kotlin 原生项目中使用 iOS pod 库时,我开始收到以下错误。

我知道我必须先从 Xcode 运行 pod install 才能在 Kotlin 本机项目中编译库。

所以 iOS pod 库应该通过 cinterop 进行转换,以便在 Kotlin Native 项目中使用。

我运行下面的命令只是为了检查框架是否成功编译。

./gradlew :SharedCode:packForXCode

得到这个错误


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':SharedCode:cinteropAFNetworkingIos'.
> Cannot perform cinterop processing for AFNetworking: cannot determine headers location.

  Probably the build is executed from command line.
  Note that a …
Run Code Online (Sandbox Code Playgroud)

android kotlin gradle-kotlin-dsl kotlin-native kotlin-multiplatform

5
推荐指数
1
解决办法
2072
查看次数

如何在Xcode storyboard颜色选择器中添加自定义颜色?

我打算在应用程序中制作UI元素的主题颜色.我们如何在选择器菜单中显示自定义颜色(金色),如黑色

在此输入图像描述

可能吗?就像我们可以添加自定义属性一样,如snapsho所示在此输入图像描述Ť

xcode ios

3
推荐指数
3
解决办法
6190
查看次数