Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes bug where certain classes may fail to generate the appropriate open tag to string with right XML-style format
- Loading branch information
1 parent
49646fe
commit 92a064a
Showing
10 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// NSMutableString+XML.swift | ||
// Pods | ||
// | ||
// Created by Vincent Neo on 6/6/19. | ||
// | ||
|
||
import Foundation | ||
|
||
/** | ||
To ensure that all appended tags are appended with the right formats. | ||
For both open and close tags. | ||
*/ | ||
extension NSMutableString { | ||
|
||
/// Appends an open tag | ||
/// | ||
/// This function will append an open tag with the right format. | ||
/// | ||
/// **Format it will append to:** | ||
/// | ||
/// "%@<%@%@>\r\n" | ||
/// //indentations <tagName attributes> \r\n | ||
func appendOpenTag(indentation: NSMutableString, tag: String, attribute: NSMutableString) { | ||
self.appendFormat("%@<%@%@>\r\n", indentation, tag, attribute) | ||
} | ||
|
||
/// Appends a close tag | ||
/// | ||
/// This function will append an close tag with the right format. | ||
/// Not currently used, but included, for ease of use when needed. | ||
/// | ||
/// **Format it will append to:** | ||
/// | ||
/// "%@</%@>\r\n" | ||
/// //indentations </tagName> \r\n | ||
func appendCloseTag(indentation: NSMutableString, tag: String) { | ||
self.appendFormat("%@</%@>\r\n", indentation, tag) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.