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 { forEachObjIndexed } from "ramda"; | |
| import * as React from "react"; | |
| import { | |
| Animated, | |
| ScrollView, | |
| View, | |
| ViewStyle, | |
| LayoutChangeEvent, | |
| NativeScrollEvent, | |
| } from "react-native"; |
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
| // babel.config.js | |
| module.exports = { | |
| "presets": [ | |
| "module:metro-react-native-babel-preset", | |
| ], | |
| "plugins": [ | |
| ["module-resolver", { | |
| "root": ["./src"], | |
| "extensions": [".js", ".ts", ".tsx", ".ios.js", ".android.js"] | |
| }], |
A number of fonts are available by default based on the platform (e.g., Roboto on Android, Helvetica on iOS). See the full list here.
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
| /** | |
| * Perform a throwing expression, and throw a custom error in case the expression threw | |
| * | |
| * - parameter expression: The expression to execute | |
| * - parameter error: The custom error to throw instead of the expression's error | |
| * - throws: The given error | |
| * - returns: The return value of the given expression | |
| */ | |
| func perform<T>(_ expression: @autoclosure () throws -> T, orThrow errorExpression: @autoclosure () -> Error) throws -> T { | |
| do { |
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
| private var AssociatedKey: UInt = 0 | |
| private final class AssociatedObjectBox<T> { | |
| let value: T | |
| init(_ x: T) { | |
| value = x | |
| } | |
| } |
In this tutorial we are going to show how easy it is to build a notification feed using GetStream.io. First of all, let's quickly introduce you to our fictional example app. It's called bug-your-friends.com and allows you interact with your friends, ping them, follow them or poke them. Here's a quick list of example interactions:
- poke another user (eg. Thierry pokes Alessandra)
- follow a user (eg. Tommaso follows Iris)
- ping a user (eg. Josie pings Carolina)
Whenever a user is part of one of these interactions, we want to update his notification feed, update the number of unseen and unread
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
| @implementation UIImage (scale) | |
| /** | |
| * Scales an image to fit within a bounds with a size governed by | |
| * the passed size. Also keeps the aspect ratio. | |
| * | |
| * Switch MIN to MAX for aspect fill instead of fit. | |
| * | |
| * @param newSize the size of the bounds the image must fit within. | |
| * @return a new scaled image. |
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
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |