1. Auth0 and multiple environments for iOS apps

    One thing that's a little odd about Auth0 is that you need to setup an Auth0.plist file to configure the service. This becomes a problem when you want to separate development from production environments where keys are different.

    One trick to solve this requires setting up a “Run Phase …

    read more

    There are comments.

  2. Regular Expression to find a string included between two characters while EXCLUDING the delimiters

    Easy done:

    (?<=\[)(.*?)(?=\])
    

    Technically that's using lookaheads and lookbehinds. See Lookahead and Lookbehind Zero-Width Assertions. The pattern consists of:

    • is preceded by a [ that is not captured (lookbehind);
    • a non-greedy captured group. It's non-greedy to stop at the first ]; and
    • is followed by a ] that is not captured (lookahead).

    Alternatively you …

    read more

    There are comments.

  3. Invoke didSet when property’s value is set inside init context

    Property observers are only called when the property’s value is set outside of initialization context.

    defer can change situation 😊

    class Member {
        var ageMember: Int! {
            didSet {
                print("Function: \(#function)")
            }
        }
    
        init(age: Int) {
            self.ageMember = age
        }
    }
    
    class User {
        var ageUser: Int! {
            didSet {
                print("Function: \(#function)")
            }
        }
    
        init(age: Int) {
            defer {
                self.ageUser …
    read more

    There are comments.

  4. Group objects by property

    One more useful extension Gives you opportunity to group objects by property 👨‍

    extension Sequence {
        func group<GroupingType: Hashable>(by key: (Iterator.Element) -> GroupingType) -> [[Iterator.Element]] {
            var groups: [GroupingType: [Iterator.Element]] = [:]
            var groupsOrder: [GroupingType] = []
            forEach { element in
                let key = key(element)
                if case nil = groups[key]?.append(element) {
                    groups[key] = [element …
    read more

    There are comments.

  5. Flutter performance tips

    - Don’t split your widgets into methods
    - Avoid rebuilding all the widgets repetitively
    - Use const widgets where possible
    - Use `itemExtent` in ListView for long Lists
    - Avoid rebuilding unnecessary widgets inside AnimatedBuilder
    - Avoid using the Opacity particularly in an animation
    - Reuse Data Using the Singleton Design Pattern.
    

    Follow the original posts …

    read more

    There are comments.

« Page 3 / 3

Links

Social