【原】关于使用openshift-V3无法自定义DNS解析

前段时间,参加2016红帽北京论坛,进一步了解了openshift相关内容,发现正符合我长久以来的需求,于是当天晚上便开始着手测试,测试过程中一切OK,唯独创建DNS解析的时候,V3的openshift好像不像是V2那样,直接提供测试链接。(至少我翻了半天没找到)

于是查手册查资料,最后在官方文档这里找到相关解释。(传送门:点我

e21c6def-cbdd-45c4-a202-630b6d1202e9

看到这行,终于找到DNSPOD的显性/隐性URL应该是啥了。

当然,<route-name>比较方便的就找到了(点击”Applications->Routes”,”Name”列即是。假设是”BBBBB”);可是, <namespace>又是在哪呢?我第一次开始搞的时候,没有留意这个namespace,于是采取了一个繁琐的方法,如下:

点击”Applications->Pods”,进入Pods列表界面,右上角有个”Actions”,点击,选择”Edit YAML”,在弹出的modal层中会看到”namespace: AAAAAA”。

综上,就可以组装成DNS的显性/隐性URL记录了,比如:

BBBBB-AAAAAA.44fs.preview.openshiftapps.com

最后进入DNSPOD解析页面,添加显性/隐性URL记录即可。

附官方教学视频(除DNS相关有不同外,其他可参考):Creating your first application with OpenShift Enterprise 3.0

【原】关于swift3及iOS10发布后,定时动画无法执行问题

前言:好坑啊,前段时间把现有的APP的开发语言更新到swift3.0以后,APP各种问题不断,即使语法正确,也不一定能正常工作;昨天又发现一个动画移动问题,让我一时不知道从何下手,查了查资料没有与之相关的内容,排解了一段时间终于发现问题了。

问题代码:

self.timer = Timer.scheduledTimer(timeInterval: 0.08, target: self, selector: #selector(setNeedsDisplay(_:)), userInfo: nil, repeats: true)

此行代码的含义在此就不赘述了,如有不明白之处,请自行找度娘。

那么具体应该怎么修改呢,好,只需要改一个地方,将上述代码的“setNeedsDisplay(_:)”修改为“CALayer.setNeedsDisplay”即可,如下:

self.timer = Timer.scheduledTimer(timeInterval: 0.08, target: self, selector: #selector(CALayer.setNeedsDisplay), userInfo: nil, repeats: true)

恩,基本就这样。

PS:对了,记得重写draw方法哈,其次。。。最重要的一点!!这行代码坑死我了,竟然是这么玩的。

【原】ios开发之使用swift3.0画虚线

近期需要在界面中画虚线,想了想没有啥好的办法,于是百度求解,都是用OC写的,完全不考虑我们swift开发者的感受,于是根据OC转了下swift3.0,经测试没啥问题。

        let shapeLayer: CAShapeLayer = CAShapeLayer.init()

        shapeLayer.bounds = self.view.bounds

        shapeLayer.position = self.view.center

        shapeLayer.fillColor = UIColor.clear.cgColor

        shapeLayer.strokeColor = UIColor.init(hexString: “63747F”).cgColor

        shapeLayer.lineJoin = kCALineJoinRound

        shapeLayer.lineDashPattern = [NSNumber.init(value: 3 as Int32),NSNumber.init(value: 2 as Int32)]

        let path: CGMutablePath = CGMutablePath()

        path.move(to: CGPoint.init(x: self.accountTextField.frame.origin.x, y: self.accountTextField.frame.origin.y+self.accountTextField.frame.height))

        path.addLine(to: CGPoint.init(x: self.accountTextField.frame.origin.x+self.accountTextField.frame.width, y: self.accountTextField.frame.origin.y+self.accountTextField.frame.height))

        shapeLayer.path = path

        self.view.layer.addSublayer(shapeLayer)

附上原文参考链接:http://blog.csdn.net/u012976984/article/details/46785597