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
# Xcode | |
## Build generated | |
build/ | |
DerivedData/ | |
## Various settings | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 |
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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key><true/> | |
</dict> |
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
disabled_rules: # rule identifiers to exclude from running | |
- colon | |
- comma | |
- control_statement | |
opt_in_rules: # some rules are only opt-in | |
- empty_count | |
# Find all the available rules by running: | |
# swiftlint rules | |
included: # paths to include during linting. `--path` is ignored if present. | |
excluded: # paths to ignore during linting. Takes precedence over `included`. |
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
extension UIScrollView { | |
func scrollToTop(animated: Bool) { | |
let topOffset = CGPoint(x: 0, y: -contentInset.top) | |
setContentOffset(topOffset, animated: animated) | |
} | |
} |
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
extension UIScrollView { | |
func scrollToView(view:UIView, animated: Bool) { | |
if let origin = view.superview { | |
let childStartPoint = origin.convert(view.frame.origin, to: self) | |
self.scrollRectToVisible(CGRect(x: 0.0, | |
y: childStartPoint.y, | |
width: 1.0, | |
height: self.frame.height), | |
animated: animated) |
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
extension UIScrollView { | |
func scrollToBottom() { | |
let bottomOffset = CGPoint(x: 0, | |
y: contentSize.height - bounds.size.height + contentInset.bottom) | |
if(bottomOffset.y > 0) { | |
setContentOffset(bottomOffset, animated: true) | |
} | |
} |
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
// | |
// ViewController.swift | |
// MasjidLink | |
// | |
// Created by Sebastian Vidrea on 08/04/2019. | |
// Copyright © 2019 Sebastian Vidrea. All rights reserved. | |
// | |
import UIKit |
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
// | |
// UITextField.swift | |
// MasjidLink | |
// | |
// Created by Sebastian Vidrea on 07/06/2019. | |
// Copyright © 2019 Sebastian Vidrea. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
extension UIFont { | |
@available(iOS 11.0, *) | |
static func preferredFont(for style: TextStyle, weight: Weight) -> UIFont { | |
let metrics = UIFontMetrics(forTextStyle: style) | |
let desc = UIFontDescriptor.preferredFontDescriptor(withTextStyle: style) | |
let font = UIFont.systemFont(ofSize: desc.pointSize, weight: weight) | |
return metrics.scaledFont(for: font) | |
} |
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
/* | |
* In order to diagnose Rx and see the number of resources your project uses there are a couple | |
* of steps you need to take | |
* | |
* 1) | |
* Add this line of code somewhere in your project, for example in AppDelegate | |
* | |
*/ | |
_ = Observable<Int>.interval(.seconds(1), scheduler: MainScheduler.instance) | |
.subscribe(onNext: { _ in |
OlderNewer