Declaring a method for generating from a .m file

I have a class that has all public methods. Today I decided to delete some of the methods that I no longer need, so I started to clear my file .m.

Now I would like to generate method declarations for my methods from .min the header file. I started copying all attachments, removing the implementation and adding ;at the end, but we live in the 21st century, and there may be some tools that can do this for me.

Is there a quick way to do this in AppCode and / or Xcode? I heard something about accessorizer, but this tool is paid, and I can not test it.

[EDIT]

I found an application called Accessorizer: http://www.kevincallahan.org/software/accessorizer.html but it paid and I can’t check if it solves my problem.

+4
source share
2 answers

AppCode has many cool features to make things easier.

You can set the method using alt-enter on it:

enter image description here

You can also call a private (not public) method, and it will offer you to set it. (alt-enter with error highlighted)

I often do the opposite, “programming by intuition,” as they call it. First write a call to a method that does not exist and it will prompt you to create its stub (with the declaration .h / .m)

+2

, AppCode, bash script :

#!/bin/bash

if [[ -z "$1" ]]; then
    echo "Usage $0 file"
    exit 1
fi

while read -r line; do
    if [[ "$line" =~ (\+|-)\ ?\( ]]; then
        echo "${line% {};"
    fi
done < $1
+1

Source: https://habr.com/ru/post/1547746/


All Articles