草庐IT

SWIFT_WHOLE_MODULE_OPTIMIZATION

全部标签

ios - 在 swift 2 和 xcode 7 beta 4 中设置谷歌分析时出错

我使用cocoapods设置了我的xcode项目,添加了googleanalytics作为pod。之后,我直接在我的项目文件下导入了GoogleService-info.plist。还创建了桥头,并在AppdDelegate中添加了代码。在编译期间,一切运行良好,但是当我启动调试器时,我收到这些错误:2015-08-1416:45:25.866GetOut[30738:3729265]ClientIDmustnotbenilorempty.2015-08-1416:45:25.867GetOut[30738:3729265]ClientIDmustnotbenilorempty.201

ios - taskIdentifier 获取错误 [Swift]

下面是我的代码。varplacesTask=NSURLSessionDataTask()funcfetchPlacesNearCoordinate(coordinate:CLLocationCoordinate2D,radius:Double,types:[String],completion:(([GooglePlace])->Void))->(){varurlString="https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=\(apiKey)&location=\(coordinate.latitude

ios - 无效的 Swift 支持 - 适用于 iOS 9 的 Swift 2.0 项目(Xcode build 7A220)

我在Swift2.0foriOS9上的项目(Xcodebuild7A220)我尝试将构建上传到iTunesConnectforTestFlight,但上传几分钟后我收到一封电子邮件:InvalidSwiftSupport-ThefileslibswiftCoreAudio.dylib,libswiftCoreMedia.dylib,libswiftAVFoundation.dylibdon’tmatch/Payload/MyApp.app/Frameworks/libswiftCoreAudio.dylib,/Payload/MyApp.app/Frameworks/libswiftC

ios - Swift 2.1 - UIPickerView 不能正常工作

我使用了最新版本的Xcode和最新版本的Swift。我按照这个link的步骤操作但是pickerview没有出现在模拟器中。代码如下。有人可以帮我检查一下吗?非常感谢!importUIKitclassViewController:UIViewController,UIPickerViewDelegate{@IBOutletvarimageView:UIImageView!@IBOutletvarinfoLabel:UILabel!@IBOutletvarpicker:UIPickerView!//varfruits:[String]=[String]()varfruits=["Pick

ios - IBOutlet 为零,但在 Storyboard 中已连接(Swift 2)

我试图在UITableView的单元格中显示一些内容。该程序确实到达了cellForRowAtIndexPath:overridefunctableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell:EventTableViewCell=self.tableView.dequeueReusableCellWithIdentifier("eventCell")as!EventTableViewCellletdate=self.eventArray[i

iOS - 如何使用 SQLite.swift 进行变音符号不敏感搜索?

我正在使用SQLite.swift。有什么办法可以在SQLite中进行不区分变音符号的LIKE查询吗?例如,这个查询:SELECT*FROMusersWHEREnameLIKE"thu%"会返回:thửthuthưetc. 最佳答案 来自thedocumentation:WecancreatecustomcollatingsequencesbycallingcreateCollationonadatabaseconnection.trydb.createCollation("NODIACRITIC"){lhs,rhsinreturn

iOS swift : UIPickerView Text Alignment

尝试右/左对齐UIPickerView中两个组件中的文本。它在所选区域内正确显示,但文本在其他地方重叠。知道我在这里做错了什么吗?funcpickerView(pickerView:UIPickerView,viewForRowrow:Int,forComponentcomponent:Int,reusingViewview:UIView?)->UIView{letpickerLabel=UILabel()vartitleData:String!ifcomponent==0{ifpickerView.tag==0{titleData=weightData[row].descriptio

ios - Swift 2 - 将选定的 CollectionView 单元格放在其他单元格前面

我的ViewController中有一个UICollectionView。它已经设置好并且工作正常。我试图在按下单元格本身内的按钮时缩放单元格。我的代码缩放了单元格但是,我找不到强制选择的单元格转到其他单元格前面的方法。现在选择的单元格总是在选择之前的单元格之后。如何强制选中的单元格在其他单元格之前缩放?@IBActionfuncdetailBtnAction(sender:UIButton){letindexUser=(sender.layer.valueForKey("indexBtn"))as!IntletindexPath=NSIndexPath(forItem:indexUs

ios - 在应用程序运行时防止屏幕转到横向模式 - Swift

我使用Swift创建了一个应用程序,并在我的iPodtouch上对其进行了测试。问题是,有时我在玩游戏时不小心旋转了一点屏幕,这完全丢掉了一切。Swift中有没有一种方法可以做到即使玩家将设备横向旋转也永远不会变成横向模式? 最佳答案 你会想要点击左上角(显示项目导航器)选择您的项目名称查看General->DeploymentInfo->DeviceOrientation下的内容。相应地调整复选框。ScreenshotofDeviceOrientationinGeneralsettings

ios - 在 Swift 2 中从 slider 值执行计算

我正在尝试实时计算UISlider的值,但在Swift2中出现错误。这是一个简单的温度转换应用程序。有人可以看看吗?@IBOutletvarFahrenheit:UILabel!@IBOutletvarCelcius:UILabel!@IBOutletvarsliCelcius:UISlider!@IBActionfuncchangeTemp(sender:UISlider){lettempC=Int(sender.value)lettempF=tempC*9/5+32;Fahrenheit.text="\(tempF)"Celcius.text="\(tempC)"}