swift4

    1热度

    1回答

    如何在类似情况下检查对象是否符合协议'可表示'? protocol Representable { associatedtype RepresentType var representType: RepresentType { get set } } class A: UIView, Representable { enum RepresentType: Str

    0热度

    1回答

    我正在编程一个应用程序,它应该去一个按钮按下另一个视图控制器,但相反,它崩溃时,我运行它。编辑器显示:并带有编辑器突出显示:但在控制台中没有错误。 Here is the code for the viewcontroller that does the segue: // // DoTodayViewController.swift // Paley Foundation: Starfish

    -1热度

    1回答

    我有一个UIpicker模态窗口。一切工作正常,除了一件事。当用户单击输入文本字段时,带有UIpickerView的模式窗口按预期打开。如果所选的行是正确的,并且用户单击确定按钮,则当前代码无法注册该值。 // Set the default row, so if user click ok without changing it is recorded self.picker.selectRo

    2热度

    1回答

    This is NOT a duplicate of In Swift, how can I declare a variable of a specific type that conforms to one or more protocols? . This question is about a specific use case where I needed a metatype and

    0热度

    1回答

    在使用可解码协议在Swift 4中创建DotA2 iOS应用程序时,我遇到了这个错误。 keyNotFound(DotaPal.MatchPlayerDetail.CodingKeys.personaname, Swift.DecodingError.Context(codingPath: [DotaPal.MatchDetail.CodingKeys.players, Foundation.(_

    2热度

    1回答

    我正在尝试将ARKit添加到其中一个现有应用程序,并且当您单击按钮时将该过渡转换为视图。我只有在你拥有iOS 11时才可以使用按钮,所以你只能使用iOS 11进入该视图,但是如何摆脱故事板的这个错误? 类不可用ARSCNView iOS的11.0之前 谢谢!

    1热度

    1回答

    你知道我如何让edittext对用户不可编辑,但允许它使用文本字段自己的清除按钮来删除它吗? 我尝试使用: textField.isEnabled = false 和 textField.isUserInteractionEnabled = false ,而是因为它禁止一切

    0热度

    2回答

    我使用的Xcode 9,斯威夫特4 我尝试使用下面的代码,以显示从URL ImageView的图像: func getImageFromUrl(sourceUrl: String) -> UIImage { let url = URL(string: sourceUrl) let dict = NSDictionary(contentsOf: url!) let

    10热度

    4回答

    我从CocoaPods安装Google地图SDK后出现此错误。 CoreData: annotation: Failed to load optimized model at path '/Users/nabeel/Library/Developer/CoreSimulator/Devices/96078737-8063-4BC1-97DB-7FECEC6835D9/data/Containers

    1热度

    1回答

    当我试图让店里的坐标上的浏览器我得到通过此链接JSON结果没有错误: "https://maps.googleapis.com/maps/api/place/radarsearch/json?location=24.712587,46.673184&radius=5000&name=ستاربكس&key=#####" 但是当我做HTTP请求通过Alamofire在Xcode let url =