This file contains hidden or 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
extension String { | |
func pyramid() -> String { | |
var result = "" | |
for index in 1..<characters.count { | |
result.append(contentsOf: self.characters.prefix(index)) | |
result.append("\n") | |
} | |
for index in stride(from: characters.count, to: 0, by: -1) { | |
result.append(contentsOf: self.characters.prefix(index)) | |
result.append("\n") |
This file contains hidden or 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
import UIKit | |
extension UIView { | |
func printViewHeirarchy(_ indentation: Int = 0) { | |
for _ in 0..<indentation { print(" ", terminator: "") } | |
print(String(describing: self)) | |
subviews.forEach { view in view.printViewHeirarchy(indentation + 1) } | |
} | |
} |
This file contains hidden or 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
//Class declaration | |
@interface ClassName () <NSURLSessionDelegate> // Implement Delegate | |
This file contains hidden or 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
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
/** | |
* kevinstewart at 15-05-26. | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
// Define data sets |