Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements on Method comments. #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Montana
Copy link

@Montana Montana commented May 21, 2024

Hi all,

I've listed all my changes, and before and afters in this Hulu repo entitled GrannySmith.

Some of the first things I did were:

  • Added parameter and return type documentation for initialization methods.

  • Provided example usage for the fancyTextViewWithFrame:markupText: method.

Before:

/// The GSFancyText object for this view
@property (nonatomic, retain) GSFancyText* fancyText;

/// The content height of the fancyText object.
@property (nonatomic, assign, readonly) CGFloat contentHeight;

/** If matchFrameHeightToContent is set to YES, the view frame height will be set to match the content height
 * every time updateDisplay method is called.
 *
 * If it's set to NO, every time we call updateDisplay, only the new width will be used to affect the line height.
 */
@property (nonatomic, assign) BOOL matchFrameHeightToContent;


/** If it is set to YES, the view frame width will be set to match the content width (if the actually content is narrower than assigned width)
 * every time updateDisplay method is called.
 */
@property (nonatomic, assign) BOOL matchFrameWidthToContent;

After:

/// The GSFancyText object for this view.
@property (nonatomic, retain) GSFancyText *fancyText;

/// The content height of the fancyText object.
@property (nonatomic, assign, readonly) CGFloat contentHeight;

/** Determines whether the view frame height should match the content height.
 *
 * If set to YES, the view frame height will be set to match the content height
 * every time the updateDisplay method is called.
 *
 * If set to NO, the new width will be used to affect the line height when updateDisplay is called.
 */
@property (nonatomic, assign) BOOL matchFrameHeightToContent;

/** Determines whether the view frame width should match the content width.
 *
 * If set to YES, the view frame width will be set to match the content width (if the actual content is narrower than the assigned width)
 * every time the updateDisplay method is called.
 */
@property (nonatomic, assign) BOOL matchFrameWidthToContent;
  • Added spaces between the type and the asterisk in pointer declarations (e.g., GSFancyText *fancyText_ instead of GSFancyText* fancyText_).

  • Ensured consistent use of indentation and spacing throughout the file.

Cheers,
Michael Mendy

* Added parameter and return type documentation for initialization methods.

* Provided example usage for the `fancyTextViewWithFrame:markupText: method`.

Before:

```objc
/// The GSFancyText object for this view
@Property (nonatomic, retain) GSFancyText* fancyText;

/// The content height of the fancyText object.
@Property (nonatomic, assign, readonly) CGFloat contentHeight;

/** If matchFrameHeightToContent is set to YES, the view frame height will be set to match the content height
 * every time updateDisplay method is called.
 *
 * If it's set to NO, every time we call updateDisplay, only the new width will be used to affect the line height.
 */
@Property (nonatomic, assign) BOOL matchFrameHeightToContent;


/** If it is set to YES, the view frame width will be set to match the content width (if the actually content is narrower than assigned width)
 * every time updateDisplay method is called.
 */
@Property (nonatomic, assign) BOOL matchFrameWidthToContent;
```

After:

```objc
/// The GSFancyText object for this view.
@Property (nonatomic, retain) GSFancyText *fancyText;

/// The content height of the fancyText object.
@Property (nonatomic, assign, readonly) CGFloat contentHeight;

/** Determines whether the view frame height should match the content height.
 *
 * If set to YES, the view frame height will be set to match the content height
 * every time the updateDisplay method is called.
 *
 * If set to NO, the new width will be used to affect the line height when updateDisplay is called.
 */
@Property (nonatomic, assign) BOOL matchFrameHeightToContent;

/** Determines whether the view frame width should match the content width.
 *
 * If set to YES, the view frame width will be set to match the content width (if the actual content is narrower than the assigned width)
 * every time the updateDisplay method is called.
 */
@Property (nonatomic, assign) BOOL matchFrameWidthToContent;
```
* Added spaces between the type and the asterisk in pointer declarations (e.g., `GSFancyText *fancyText_` instead of `GSFancyText* fancyText_`).

* Ensured consistent use of indentation and spacing throughout the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant