ios

Subclassing MKCircle in Swift

心已入冬 提交于 2021-01-27 04:06:50
问题 I'd like to subclass MKCircle (e.g. MyCircle ) by adding another String property, let's call it " code ". This property shall not be an optional and constant, so I have to set it from an initializer, right? Of course MyCircle should also get center coordinate and the radius. These two properties are read-only, so I also need to set them via initializer. In the end I need an initializer that takes 3 parameters: coordinate , radius and code . Sounds pretty easy but Swifts designated and

iOS - use of @import when modules are disabled error

℡╲_俬逩灬. 提交于 2021-01-27 04:06:50
问题 I am receiving this error when using the DCPathButton library (through podspec). Modules are enabled in my project settings. Do i need to do anything else to enable modules in pods? 回答1: If "Link Frameworks Automatically" is already set to YES in the Build Settings, you have to set "Enable Modules (C and Objective-C)" as well. 回答2: Set the "Link Frameworks Automatically" to YES 来源: https://stackoverflow.com/questions/27479248/ios-use-of-import-when-modules-are-disabled-error

iOS - use of @import when modules are disabled error

时光毁灭记忆、已成空白 提交于 2021-01-27 04:06:37
问题 I am receiving this error when using the DCPathButton library (through podspec). Modules are enabled in my project settings. Do i need to do anything else to enable modules in pods? 回答1: If "Link Frameworks Automatically" is already set to YES in the Build Settings, you have to set "Enable Modules (C and Objective-C)" as well. 回答2: Set the "Link Frameworks Automatically" to YES 来源: https://stackoverflow.com/questions/27479248/ios-use-of-import-when-modules-are-disabled-error

iOS - use of @import when modules are disabled error

放肆的年华 提交于 2021-01-27 04:06:23
问题 I am receiving this error when using the DCPathButton library (through podspec). Modules are enabled in my project settings. Do i need to do anything else to enable modules in pods? 回答1: If "Link Frameworks Automatically" is already set to YES in the Build Settings, you have to set "Enable Modules (C and Objective-C)" as well. 回答2: Set the "Link Frameworks Automatically" to YES 来源: https://stackoverflow.com/questions/27479248/ios-use-of-import-when-modules-are-disabled-error

Subclassing MKCircle in Swift

流过昼夜 提交于 2021-01-27 04:06:12
问题 I'd like to subclass MKCircle (e.g. MyCircle ) by adding another String property, let's call it " code ". This property shall not be an optional and constant, so I have to set it from an initializer, right? Of course MyCircle should also get center coordinate and the radius. These two properties are read-only, so I also need to set them via initializer. In the end I need an initializer that takes 3 parameters: coordinate , radius and code . Sounds pretty easy but Swifts designated and

How to find source file and line number from os_log()

Deadly 提交于 2021-01-27 03:55:31
问题 The Logging Apple reference for the new logging system in iOS 10 and macOS Sierra explicitly say not to include line number and source file info, because it is automatically captured. Don’t include symbolication information or source file line numbers in messages. The system automatically captures this information. But I have yet to be able to find any way of viewing these supposedly captured values. In the Console app I can see subsystem, category, process ID, etc, but nothing about file and

Download ICS file with Google Chrome on iPhone

a 夏天 提交于 2021-01-27 03:54:21
问题 I have an ICS file ('text/calendar' MIME type) stored on my server. In JavaScript I call: window.open("/path/to/file.ics"); It works on all browsers, even on Safari on my iPhone. But when I try on Chrome (the iPhone version) nothing happens. Nothing downloads. There are no errors on the screen―nothing. Maybe someone has been there before and has some suggestions. Thanks in advance! 回答1: It should also be possible to use the good old create a download link, append it to the document, click it,

How to find source file and line number from os_log()

℡╲_俬逩灬. 提交于 2021-01-27 03:54:10
问题 The Logging Apple reference for the new logging system in iOS 10 and macOS Sierra explicitly say not to include line number and source file info, because it is automatically captured. Don’t include symbolication information or source file line numbers in messages. The system automatically captures this information. But I have yet to be able to find any way of viewing these supposedly captured values. In the Console app I can see subsystem, category, process ID, etc, but nothing about file and

UI Tests: Simulate a shake gesture with Swift

老子叫甜甜 提交于 2021-01-27 03:52:36
问题 Using UI tests, I'd like the app to respond to shake gestures, and I would like to programmatically trigger a shake gesture in my swift UI tests. Triggering the shake gesture while recording during a UI test session yields no added code. Is there a way to do this? Thanks in advance! 回答1: As far as I know, currently you cannot do it directly from XCUITest. So instead, maybe programmatically call it using launch arguments that then call the relevant section of the code to simulate the gesture.

UITextView custom spelling and autocorrect

主宰稳场 提交于 2021-01-27 02:56:16
问题 I want to make an iOS text editor for a certain rare human language, and I want it to support my own spell checking and autocorrect systems for that language. In iOS, is it possible to get UITextView to use a custom spell checker and autocorrect system, rather than those of the system's current locale? Or do I have to resort to creating a text view from scratch using Core Text? 回答1: I don’t think there’s a way to actually change the spell-checking mechanism of UITextView . A good approach