草庐IT

current_tags

全部标签

ios - 有没有 "tag"通讯员?

我想知道是否还有诸如标签之类的东西?我已经在我的图像上使用了标签,但我必须使用多个标签来创建我的代码,我还没有找到一种方法...因此我想知道是否还有其他事情可以类似于标签?另一种“标记”图像的方法?(image.tag=1)--->标签示例。 最佳答案 您可以构建一个单例类来跟踪UIImage和标签之间的关系。classTaggedImages{staticletsharedInstance=TaggedImages()privatevardict=[Int:Set]()privateinit(){}funcadd(tag:Int,

ios - 将文件转换为 Swift 3 : unable to infer closure type in the current context

我正在转换我的应用程序中的一些库代码,但我不知道如何将该文件从Swift2.3转换为Swift3importUIKitstructConstraint{varidentifier:String?varattribute:NSLayoutAttribute=.centerXvarsecondAttribute:NSLayoutAttribute=.notAnAttributevarconstant:CGFloat=0varmultiplier:CGFloat=1varrelation:NSLayoutRelation=.equal}funcattributes(attrs:NSLayou

ios - 为什么 Locale.current.identifier 无效?

当设置“语言和地区”(设置=>通用=>语言和地区)时出现问题,如下所示:“iPhone语言”到“英语(加拿大)”。“地区”到“约旦”。但是,(如提到的答案:Howtogetdetailedlanguageofdeviceinswift调用:print(Locale.current.identifier)日志:en_JO这是一个无效localidentifier(按理来说,约旦是一个中东国家,母语是阿拉伯语,不是英语)。我还检查了availableIdentifiers:print(Locale.availableIdentifiers)而且-显然-它不包含“en_JO”。另外,我试过:

xcode - iOS8.0 的 CompileSwift 状态为 "the current deployment target does not support automated __weak references"

我正努力在Swift应用程序中使用静态库(从ObjectiveC编译)。我有一个包含相关header的ObjectiveC桥接header。构建应用程序时出现此错误../someDirectory/Xcode/FirstSteps/headers/Acme.h:89:thecurrentdeploymenttargetdoesnotsupportautomated__weakreferencesAcme类确实使用弱引用,但部署目标是iOS8.0,它应该支持它们。我是不是找错树了?Acme.h的第89行显示:-(void)addTopicListener:(__weakNSObject*

ios - 苹果 swift : how to get current seconds in 1/100 or 1/1000?

funcupdateTime(){vardate=NSDate()varcalendar=NSCalendar.currentCalendar()varcomponents=calendar.components(.CalendarUnitSecond,fromDate:date)varhour=components.hourvarminutes=components.minutevarseconds=components.secondcounterLabel.text="\(seconds)"varmyIndicator=counterLabel.text?.toInt()ifmyI

ios - swift 3.0 : Unable to infer closure type in the current context , PromiseKit

我在swift3.0中有以下代码,我在其中使用PromiseKit。funccalculateTravelTime(from:CLLocation,to:CLLocation)->Promise{Promise{completion,reject->Voidinletrequest=MKDirections.Request()request.transportType=.walkingletfromPlacemark=MKPlacemark(coordinate:from.coordinate)lettoPlacemark=MKPlacemark(coordinate:to.coord

ios - iOS 的 NFC Tag Writer 示例或教程?

我想将一组NSDictionary数据写入NFC标签,并在他们点击NFC贴纸时获取。如何从我的iOS应用写入NFC标签数据?在谷歌搜索后,我找不到任何将数据从我的iOS应用程序写入NFC标签的引用资料。谷歌给出的示例仅针对iOS11app读取NFC标签。但是iTunes中的某些应用程序可以选择读取和写入NFC标签数据。他们是怎么做到的?提前致谢! 最佳答案 2019年更新-NDEF写入在iOS13中可用Apple刚刚在WWDC上宣布他们正在添加NFCwitingofNDEFformatteddata.

ios - UIDevice.current.setValue(value, forKey : "orientation") does not work if phone held in landscape and tilted 45 - 90 degrees

我在用letvalue=UIInterfaceOrientation.landscapeRight.rawValueUIDevice.current.setValue(value,forKey:"orientation")强制呈现ViewController以横向显示。这是导航Controller流程的一部分。这按预期工作,但如果手机横向放置并倾斜45到90度,View将以纵向显示。该方法被调用并且预期值是正确的,但景观没有发生变化。这可以在带有导航Controller的基本项目中重现。有谁知道是什么导致了这种行为? 最佳答案 我也

swift - GTM (Google Tag Manager) 6.0 和 Firebase Analytics 5.0 版本冲突

新的Firebase版本5.0导致与Google跟踪代码管理器发生版本冲突。有人对此有解决方案吗?播客文件:#Analyticspod'Firebase/RemoteConfig','~>5.0.0'pod'Firebase/Core','~>5.0.0'pod'GoogleTagManager','~>6.0'pod'GoogleIDFASupport'pod'GooglePlaces','~>2.7.0'错误我开始pod安装:[!]CocoaPodscouldnotfindcompatibleversionsforpod"FirebaseAnalytics":InPodfile:F

ios - Locale.current 在设备上报告错误的语言

我正在尝试在iOS应用程序中设置货币值的格式,并且我正在使用设备上的当前区域设置来使用适当的货币格式。在模拟器中,一切似乎都运行良好:当使用currencyFormatter.locale=Locale.current时,它采用正确的区域设置并以正确的货币格式打印数字。然而,在我的iPhone上,它以法语配置并具有法国区域设置,我希望使用另一种格式(例如:1234,56€)。但它不起作用,并且似乎使用了英文格式样式(例如:€1234,56)。事实上,如果我在设备上打印我的应用程序的当前语言环境,它不会像我期望的那样返回fr_FR:NSLog(Locale.current.identif