-
Notifications
You must be signed in to change notification settings - Fork 53
I can't find some API method or parameter in library
Alexey Kudryavtsev edited this page Mar 24, 2019
·
1 revision
You can add new section/method/parameter to the library and make pull request with these changes. Bellow text describes how to make changes in different cases.
NOTE: If you have never made pull requests on Github, please read this topic
If you need to add new parameter:
- Open
./Library/Sources/API Supporting/Parameters
file. - Scroll to end of
Parameter
enum. - Add new method like this:
case nameOfMethodInCamelCase = "name_of_method_in_snake_case"
If you need to add new method:
- Go to
./Library/Sources/API/
. Files in this section matches with VK API method sections. - Open file where to add new method.
- Add new parameter like this:
case newMethodNameInCamelCase(Parameters)
If you need to add new section of methods:
- Go to
./Library/Sources/API/
. Files in this section matches with VK API method sections. - Add new file like this:
extension APIScope {
/// https://vk.com/dev/nameOfSection
public enum NameOfSection: APIMethod {
// List of methods like this
case methodNameInCamelCase(Parameters)
}
}
- Add all section's methods to new file.
It's fastest and easiest way if you don't want to create pull request. But it's not recommended way because it's avoid swift's strong typed nature, and it's local crutch which make you code worse.
VK.API.Custom.method(name: "sectiion.method", parameters: ["parameter": "value"])
After this, please create issue about it here. It allows to add new method or parameter into library in next releases.