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 "SampleViewController.h" | |
#import "EXTableView.h" | |
#import "SampleDataService.h" | |
#import "EXPullToRefresh.h" | |
@interface SampleViewController () | |
- (void) setupView; | |
- (void) refreshData; | |
@end |
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
// *** Extensions | |
extension NSString { | |
func dictionaryFromJson() -> NSDictionary { | |
let jsonData = self.dataUsingEncoding( NSUTF8StringEncoding )! | |
return jsonData.dictionary() | |
} | |
} | |
extension String { | |
func dictionaryFromJson() -> NSDictionary { | |
let jsonData = self.dataUsingEncoding( NSUTF8StringEncoding )! |
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
// Sample usages | |
v1.constrainWidth( left: 20, right: 20 ).constrain( .height, to: 30 ) | |
v2.constrainWidth( left: 20, right: 20 ).constrain( .height, to: 30 ) | |
v3.constrain( .height, to: 100 ).constrain( .width, to: 100 ) | |
v3.constrain( .centerX, to: v2, .centerX ) | |
container.constrainVStack( 20, v1, 10, v2, 20, v3 ) | |
// | |
// UIViewConstraint | |
// Created : Mike Johnson, 2020 |
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
override func viewWillLayoutSubviews() { | |
super.viewWillLayoutSubviews() | |
// takes up entire superview | |
myscroll.pinWidth().pinHeight() | |
// take the entire superview width, and | |
// make the height a 16/9 ratio of that | |
titleImage.pinWidth().pinHeightToWidth(by: 16/9) | |
// pin to the width of the superview with 20 padding each side | |
overviewLabel.pinWidth( lpad: 20, rpad: 20 ) |
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
// | |
// UIViewController+Preview.swift | |
// Created : Mike Johnson, 2020 | |
// | |
import Foundation | |
import UIKit | |
import SwiftUI | |
// Source: https://www.swiftbysundell.com/articles/getting-the-most-out-of-xcode-previews/ |
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
// | |
// UIView+Style.swift | |
// Created / Copyright © : Mike Johnson, 2020 | |
// | |
import Foundation | |
import UIKit | |
// MARK: - App Size Values |
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
// | |
// DebugLog.swift | |
// Created / Copyright © : Mike Johnson, 2016 | |
// | |
import Foundation | |
import os | |
// MARK: - Module Struct |
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
// | |
// EXTextField | |
// Created / Copyright © : Mike Johnson, 2021 | |
// | |
import Foundation | |
import UIKit | |
// MARK: - Lifecycle |
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
// | |
// TestDetailController | |
// Created / Copyright © : Mike Johnson, 2021 | |
// | |
import Foundation | |
import UIKit | |
// MARK: - Lifecycle Methods |
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
// | |
// SettingsCell | |
// Created / Copyright © : Mike Johnson, 2021 | |
// | |
import Foundation | |
import UIKit | |
// MARK: - Lifecycle |