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
| *** Assertion failure in -[ASImageNode setFrame:], /Users/mukesh/Desktop/Mukesh_Workspace/ParentTown/ParentTown/ASDisplayNode+UIViewBridge.mm:138 | |
| 2016-05-31 20:23:30.274 ParentTown[5628:2025751] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Incorrect display node thread affinity' | |
| *** First throw call stack: | |
| ( | |
| 0 CoreFoundation 0x000000010c187d85 __exceptionPreprocess + 165 | |
| 1 libobjc.A.dylib 0x000000010bbf9deb objc_exception_throw + 48 | |
| 2 CoreFoundation 0x000000010c187bea +[NSException raise:format:arguments:] + 106 | |
| 3 Foundation 0x000000010b842d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 | |
| 4 ParentTown 0x0000000107d4ed29 -[ASDisplayNode(UIViewBridge) setFrame:] + 329 | |
| 5 ParentTown 0x0000000107f493ab _TFC10ParentTown27FeedAsyncCollectionViewCell18initFramesAllNodesfT_T_ + 185 |
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
| //Pan Gesture | |
| public enum PanDirection: Int { | |
| case up, down, left, right | |
| public var isVertical: Bool { return [.up, .down].contains(self) } | |
| public var isHorizontal: Bool { return !isVertical } | |
| } | |
| public extension UIPanGestureRecognizer { | |
| public var direction: PanDirection? { |
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
| public extension UIScrollView { | |
| var isAtTop: Bool { | |
| return contentOffset.y <= verticalOffsetForTop | |
| } | |
| var isAtBottom: Bool { | |
| return contentOffset.y >= verticalOffsetForBottom | |
| } | |
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 MMPullSwipeDismissViewController { | |
| @objc func pan(recognizer : UIPanGestureRecognizer){ | |
| //1. Monitor the translation of view | |
| let translation = recognizer.translation(in: nil) | |
| let progressX = (translation.x / 2 ) / view.bounds.width | |
| let progressY = (translation.y / 2 ) / view.bounds.height | |
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
| enum EventName { | |
| static let screenVisit = "Screen Visit" | |
| static let clickEvent = "Click Event" | |
| } | |
| enum ParameterName { | |
| static let screen = "screen_name" | |
| static let click = "click_target" | |
| } |
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
| protocol EventProtocol { | |
| var name: String { get set } | |
| var params: [String: Any] { get set } | |
| } | |
| @propertyWrapper | |
| struct Event: EventProtocol { | |
| var name: String | |
| var params: [String: Any] = [:] |
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
| // FeatureOne | |
| enum FeatureOneEvents { | |
| @Event(pageValue: "featureOne") | |
| static var screen: Event | |
| @Event(targetValue: "tappedFeatureOneButton") | |
| static var buttonClick: Event | |
| } | |
| // FeatureTwo |
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
| protocol AnalyticsEventsLoggerProtocol { | |
| func setUserProperties(user: UserProfileModel) | |
| func trackEvent(event: EventProtocol) | |
| } | |
| // Firebase | |
| class FirebaseEventLogger: AnalyticsEventsLoggerProtocol { | |
| func setUserProperties(user: UserProfileModel) { | |
| // set user properties | |
| } |
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
| @propertyWrapper | |
| struct Theme { | |
| let light: UIColor | |
| let dark: UIColor | |
| var wrappedValue: UIColor { | |
| if #available(iOS 13, *) { | |
| return UIColor { (traitCollection: UITraitCollection) -> UIColor in | |
| if traitCollection.userInterfaceStyle == .dark { | |
| return self.dark |
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 UIColor { | |
| @Theme(light: UIColor.white, | |
| dark: UIColor.safeSystemBackground) | |
| static var background: UIColor | |
| @Theme(light: UIColor(hex: "333333"), | |
| dark: UIColor.safeLabel) | |
| static var primaryText: UIColor | |
| @Theme(light: UIColor(hex: "EEEFF2"), |
OlderNewer