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
// | |
// LKDebitCard.m | |
// DebitCard | |
// | |
// Created by LK on 21/12/17. | |
// Copyright © 2017 LK. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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 CustomStringConvertible { | |
var description: String { | |
var description: String = "\(type(of: self))(" | |
let selfMirror = Mirror(reflecting: self) | |
if let superclassMirror = selfMirror.superclassMirror { | |
for child in superclassMirror.children { | |
if let propertyName = child.label { | |
description += "Super.\(propertyName): \(child.value), " |
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
- (void)shake { | |
[self _shake:10 direction:1 currentTimes:0 withDelta:5 speed:0.03 shakeDirection:ShakeDirectionHorizontal completion:nil]; | |
} | |
- (void)_shake:(int)times direction:(int)direction currentTimes:(int)current withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(ShakeDirection)shakeDirection completion:(void (^)(void))completionHandler { | |
__weak UIView *weakSelf = self; | |
[UIView animateWithDuration:interval animations:^{ | |
weakSelf.layer.affineTransform = (shakeDirection == ShakeDirectionHorizontal) ? CGAffineTransformMakeTranslation(delta * direction, 0) : CGAffineTransformMakeTranslation(0, delta * direction); | |
} completion:^(BOOL finished) { | |
if(current >= times) { |
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 the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
# | |
# For a list of all available actions, check out | |
# | |
# https://docs.fastlane.tools/actions | |
# | |
# For a list of all available plugins, check out | |
# | |
# https://docs.fastlane.tools/plugins/available-plugins |
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
https://medium.com/swift2go/mastering-generics-with-protocols-the-specification-pattern-5e2e303af4ca | |
https://www.hackingwithswift.com/read/30/4/fixing-the-bugs-slow-shadows | |
https://www.raywenderlich.com/261-how-to-make-a-uiviewcontroller-transition-animation-like-in-the-ping-app#toc-anchor-007 | |
https://medium.com/@phanquanghoang/using-gitlab-ci-cd-fastlane-for-ios-project-part-1-5e7db82a3566 | |
https://developer.apple.com/documentation/metrickit/improving_your_app_s_performance/ |
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 UIApplication { | |
var topViewController: UIViewController? { | |
if #available(iOS 13.0, *) { | |
if UIApplication.shared.supportsMultipleScenes, let keyWindow = UIApplication.shared.windows.first(where: { $0.isKeyWindow }) { | |
return keyWindow.visibleViewController | |
} else { | |
return UIApplication.shared.keyWindow?.visibleViewController | |
} | |
} else { | |
return UIApplication.shared.keyWindow?.visibleViewController |
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
class UseItHere { | |
func readFile() { | |
let fileReader = StreamingFileReader(path: logFile) | |
while let line = fileReader.readLine() { | |
// Do something with the line | |
} | |
} | |
} | |
class StreamingFileReader { |
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
struct UpdateManager { | |
let updateURL = "https://api.github.com/repos/{user_name}/{repo_title}/releases/latest" | |
static let shared = UpdateManager() | |
private init() { } | |
func checkForUpdates(updateAvailable: @escaping (String?) -> Void) { | |
let session = URLSession(configuration: .default) | |
let updateTask = session.dataTask(with: URL(string: updateURL)!) { (data, response, error) in | |
DispatchQueue.main.async { | |
guard let data = data else { |
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
enum Storyboard: String { | |
case main = "Main", | |
onboarding = "Onboarding" | |
} | |
protocol Instantiatable { | |
static var storyboard: Storyboard { get } | |
static func instantiate() -> Self | |
} |
OlderNewer