草庐IT

TLSV1_ALERT_PROTOCOL_VERSION

全部标签

ios - 在具有透明背景的 Alert ViewController 中心添加图像

如何在警报ViewController的透明背景下在警报ViewController的中心显示图像。我写了下面的代码。letimage=UIImage(named:"ic_no_data")letimageView=UIImageView(frame:CGRectMake(220,10,40,40)letalertMessage=UIAlertController(title:"image",message:"",preferredStyle:.Alert)letbackView=alertMessage.view.subviews.last?.subviews.lastbackVie

Swift 协议(protocol)继承和协议(protocol)一致性问题

protocolBasePresenterProtocol:class{}protocolDashboardPresenterProtocol:BasePresenterProtocol{}finalclassDashboardPresenter{weakvarview:DashboardPresenterProtocol?init(){self.view=DashboardViewController()}functest(){print("Hello")}}extensionDashboardPresenter:DashboardViewProtocol{}protocolBase

ios - 类是否可以显式调用协议(protocol)扩展的方法?

假设存在以下协议(protocol),其中包含扩展提供的someFuncWithDefaultImplementation()的默认实现。那么MyClass2是否有可能同时提供自己的someFuncWithDefaultImplementation()实现,它还从扩展中调用该方法的默认实现?protocolMyProtocol:class{funcsomeFuncWithDefaultImplementation()funcsomeFunc()varsomeInt:Int{getset}}extensionMyProtocol{funcsomeFuncWithDefaultImplem

ios - 协议(protocol)中的默认实现不适用于我的情况

我在这个例子中模拟了我的情况:protocolMyProtocol{funcdoSomething()}extensionMyProtocol{funcdoSomething(){print("Dosomething")}}classMyViewController:UIViewController,MyProtocol{letbutton=UIButton()overridefuncviewDidLoad(){super.viewDidLoad()button.addTarget(self,action:#selector(doSomething),for:.touchUpInsid

Vue ui/vue create创建项目报错:Failed to get response from https://registry.npmjs.org/vue-cli-version-ma

1、错误截图,会发现是版本的问题,但是即使卸载重装也无济于事,所以还是要找一下源头2、原因分析:Failedtogetresponsefromhttps://registry.npmjs.org/vue-cli-version-ma翻译为:从/vue-cli-version-marker获取响应失败 3、解决方案(哪个合适用哪个)(1)可能是受hadoop环境中包含的yarn环境影响,如果之前因为使用到hadoop的相关依赖环境的,去环境里边删除hadoop的相关环境,卸载之后yarn可以重新安装:链接转载找到环境变量(2)如果第一个也没用,去C:\Users\自己主机的用户名 发现此处"us

ios - 仅获取协议(protocol)中定义的属性在修改对象的内部属性时导致编译错误

考虑这样的代码:protocolSomeProtocol{varsomething:Bool{getset}}classSomeProtocolImplementation:SomeProtocol{varsomething:Bool=false{didSet{print("somethingchanged!")}}}protocolMyProtocol{varmyProperty:SomeProtocol{get}}classMyClass:MyProtocol{varmyProperty:SomeProtocol=SomeProtocolImplementation(){didSe

npm i 报错:This version of npm is compatible with lockfileVersion@1, but package-lock.json

一、报错二、原因  npm是lockfileVersion@1的,但package-lock.json是源于lockfileVersion@2;npm版本不匹配三、解决方法1、升级一下npmnpminstall-gnpm方法2、更新本地全局包到最新:npmi-gnpm@latest或者更新到指定版本: npminstall-gnpm@x.x.x 方法3、以上方法若无法解决:直接重装nvm来管理node版本\自动下载npm补充:npm-v查看npm版本号

ios - 静态成员不能用于协议(protocol)元类型

我想要完成的是制作代理协议(protocol),将我的类(class)路由到适当的服务。我为每个代理提供3种类型的服务:OnlineService、OfflineService、DemoService,每种服务用于一种模式(在线、离线、演示)。我创建了协议(protocol):protocolProxy{associatedtypeServiceProtocolassociatedtypeOfflineServiceType:OfflineServiceassociatedtypeOnlineServiceType:WebServiceassociatedtypeDemoService

ios - API 调用给出协议(protocol)错误

我正在使用swift构建一个iOS应用程序。我使用URLSession进行API调用。我使用ip地址进行了所有API调用,并且一切正常。现在为了将应用程序放入商店,我将ip地址更改为域名。API由postman提供。但在我的代码中它给出了错误:“HTTP加载失败(错误代码:100[1:100]),完成错误-代码:100,操作无法完成。协议(protocol)错误”。我已经使用了任意负载true。我尝试将“https”和“http”作为协议(protocol)。我错过了什么?swift3Xcode9测试设备iOS11编辑:如果我使用服务器的ip地址,则不会出现此问题。因此我认为我的请求或

ios - Swift:在协议(protocol)一致性中覆盖协议(protocol)扩展的关联类型

所以,我正在努力实现这一目标:有一个带有associatedtype的协议(protocol),该协议(protocol)将处理json解析到他的扩展中。关联类型必须符合Decodable:protocolMyProtocol{associatedtypeResponseType:DecodablefunchandleResponse(data:Data)->ResponseType}我想要做的是将responseType的默认类型设置到我的扩展中,然后,如果需要,将该类型覆盖到类或结构一致性中。像这样。extensionMyProtocol{typealiasResponseType