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
#import <Foundation/Foundation.h> | |
@interface NSString (CJK) | |
/** | |
Detect if the string contains Chinese, Japanese or Korean characters | |
@return YES if the string contains CJK characters, NO otherwise | |
*/ |
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
// | |
// UILabel+Stylesheet.h | |
// Stylesheet | |
// | |
// Created by Cyril Chandelier on 21/10/15. | |
// Copyright © 2015 CyrilChandelier. All rights reserved. | |
// | |
#import <UIKit/UIKit.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
// | |
// BaseAppDelegate.swift | |
// | |
// Created by Cyril Chandelier on 21/04/2018. | |
// Copyright © 2018 Cyril Chandelier. All rights reserved. | |
// | |
import UIKit | |
class BaseAppDelegate: UIResponder, UIApplicationDelegate { |
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
func applicationDidBecomeActive(_ application: UIApplication) { | |
let notificationController = NotificationController.shared | |
// Track app launch if the notificationController didn't already do it | |
if !notificationController.handledLaunchAnalytics { | |
Analytics.trackAppLaunched(source: .Organic) | |
} | |
} |
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 { | |
var isBouncing: Bool { | |
return isBouncingTop || isBouncingBottom | |
} | |
var isBouncingTop: Bool { | |
return contentOffset.y < topInsetForBouncing - contentInset.top | |
} | |
var isBouncingBottom: Bool { |
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
import UIKit | |
protocol UICollectionViewRegisterable { | |
static var cellIdentifier: String { get } | |
static var cellNib: UINib { get } | |
} | |
extension UICollectionView { | |
func register(type: UICollectionViewRegisterable.Type) { | |
register(type.cellNib, forCellWithReuseIdentifier: type.cellIdentifier) |
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
import Foundation | |
precedencegroup OptionalAssignment { | |
associativity: right | |
} | |
infix operator ?=: OptionalAssignment | |
public func ?= <T>(variable: inout T, value: T?) { | |
if let unwrapped = unwrap(any: value) ?? nil { |
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
import UIKit | |
@IBDesignable final class MediaProgressBar: UIControl { | |
// MARK: - Configuration | |
@IBInspectable var isThumbVisible: Bool = true { | |
didSet { | |
thumbView.alpha = isThumbVisible ? 1.0 : 0.0 | |
} | |
} |