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 =