profile
viewpoint
Khoa onmyway133 shortcut Oslo, Norway https://onmyway133.com/ Check my apps https://onmyway133.com/apps

onmyway133/awesome-ios-animation 4519

:umbrella: A collection of iOS animation repos

onmyway133/awesome-ios-architecture 4010

:japanese_castle: Better ways to structure iOS apps

onmyway133/awesome-machine-learning 704

🎰 A curated list of machine learning resources, preferably CoreML

onmyway133/Arcane 272

:trident: CommonCrypto in Swift, and more

onmyway133/awesome-android-animation 228

:sweat_drops: A collection of Android animation repos

onmyway133/awesome-git-commands 45

🍴 Indispensable git commands for everyday use

onmyway133/awesome-conference-videos 40

🎸 Conference videos. Visit http://learntalks.com/

onmyway133/awesome-android-architecture 36

🏰 Better ways to structure Android apps

BlindAssist/blindassist-ios 31

🕶 An iOS app which will support the blind in traffic

onmyway133/Avengers 20

👾Demo how to use CoreML with IBM Watson, Azure Custom Vision, Turi Create

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha adacf4a2af357de69255a11fa24817088fffb4a8

Site updated: 2020-09-25 06:04:34

view details

push time in 2 days

issue openedonmyway133/blog

How to use Binding in function in Swift

Use wrappedValue to get the underlying value that Binding contains

extension View {
    func addOverlay(shows: Binding<Bool>) -> some View {
        HStack {
            self
            Spacer()
        }
        .overlay(
            HStack {
                Spacer()
                SmallButton(
                    imageName: "downArrow",
                    tooltip: shows.wrappedValue ? "Collapse" : "Expand",
                    action: {
                        shows.wrappedValue.toggle()
                    }
                )
                .rotationEffect(.radians(shows.wrappedValue ? .pi : 0))
            }
        )
    }
}

created time in 2 days

issue openedonmyway133/blog

How to use HSplitView to define 3 panes view in SwiftUI for macOS

Specify minWidth to ensure miminum width, and use .layoutPriority(1) for the most important pane.

import SwiftUI

struct MainView: View {
    @EnvironmentObject var store: Store

    var body: some View {
        HSplitView {
            LeftPane()
                .padding()
                .frame(minWidth: 200, maxWidth: 500)
            MiddlePane(store: store)
                .padding()
                .frame(minWidth: 500)
                .layoutPriority(1)
            RightPane()
                .padding()
                .frame(minWidth: 300)
        }
        .background(R.color.background)
    }
}

created time in 4 days

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha 823ec92cbc24ea10cac7fb82cc7f6b14b20a7193

Site updated: 2020-09-21 07:06:39

view details

push time in 6 days

issue openedonmyway133/blog

How to draw arc corner using Bezier Path

Screenshot 2020-09-15 at 14 16 01 cc

let path = UIBezierPath()
// bottom left
path.move(to: CGPoint(x: 0, y: bounds.height))
// top left corner
path.addArc(withCenter: CGPoint(x: radius, y: radius), radius: radius, startAngle: CGFloat.pi, endAngle: CGFloat.pi * 3 / 2, clockwise: true)
// top right corner
path.addArc(withCenter: CGPoint(x: bounds.width - radius, y: radius), radius: radius, startAngle: CGFloat.pi * 3 / 2, endAngle: 0, clockwise: true)
// bottom right
path.addLine(to: CGPoint(x: bounds.width, y: bounds.height))
path.close()

Read more

  • http://ronnqvi.st/thinking-like-a-bzier-path

created time in 12 days

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha 7f1d1b735bfbdd71bc9bb23b69d8988a03d65265

Site updated: 2020-09-05 08:03:34

view details

push time in 22 days

push eventonmyway133/Cheers

Khoa

commit sha 361b9820cc54413c87a4d75828b55d5421e34df6

Update README.md

view details

push time in 23 days

push eventonmyway133/IconGenerator

Khoa

commit sha 910d32893d3b53b7ee5cac2c2708636e3d3b851a

Update README.md

view details

push time in 23 days

push eventonmyway133/Snowflake

Khoa

commit sha c23a247a05182608d2023ff24c41d6f0c5998a2a

Update README.md

view details

push time in 23 days

push eventonmyway133/PushNotifications

Khoa

commit sha 34660a5fa070fb3a733696ed81c73f3873043d2b

Update README.md

view details

push time in 23 days

fork onmyway133/check-it-out

A command line interface for Git Checkout. See branches available for checkout.

http://checkit.club

fork in 23 days

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha 3830c8e71516d88240c0b020b440819ff63d4f24

Site updated: 2020-09-02 22:35:47

view details

push time in 24 days

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha ea5849302b3c11bcb442bb862bd6c2773775a3fd

Site updated: 2020-09-02 22:32:24

view details

push time in 24 days

push eventonmyway133/awesome-ios-animation

Khoa

commit sha 40de7b7a6437acb2449a8bd2d08b915a70f65bea

Update view.md

view details

push time in 25 days

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha 7ec38a341642982479e4cd2f4625946acf4a7555

Site updated: 2020-08-31 21:46:10

view details

push time in a month

issue openedonmyway133/blog

How to stitch array in Swift

Supposed we want to stitch magazines array into books array. The requirement is to sort them by publishedDate, but must keep preferredOrder of books. One way to solve this is to declare an enum to hold all possible cases, and then do a sort that check every possible combination

struct Book {
    let preferredOrder: Int
    let publishedDate: Date
}

struct Magazine {
    let publishedDate: Date
}

enum StitchItem {
    case book(Book)
    case magazine(Magazine)
}

func stitch(_ books: [Book], magazines: [Magazine]) -> [StitchItem] {
    let items = books.map({ StitchItem.book($0) }) + magazines.map({ StitchItem.magazine($0) })
    return items.sorted(by: { book, magazine in
        switch (book, magazine) {
        case let (.book(b1), .book(b2)):
            return b1.preferredOrder < b2.preferredOrder
        case let (.book(book), .magazine(magazine)):
            if book.publishedDate == magazine.publishedDate {
                return true
            } else {
                return book.publishedDate < magazine.publishedDate
            }
        case let (.magazine(magazine), .book(book)):
            if book.publishedDate == magazine.publishedDate {
                return false
            } else {
                return book.publishedDate < magazine.publishedDate
            }
        case let (.magazine(m1), .magazine(m2)):
            return m1.publishedDate < m2.publishedDate
        }
    })
}

created time in a month

pull request commentonmyway133/EasyStash

Fixes #12 - Adds directoryUrl to Options

@aaronpearce Ja you're welcome. Glad you find this library useful. I will try to make new tag release soon

aaronpearce

comment created time in a month

pull request commentonmyway133/EasyStash

Fixes #12 - Adds directoryUrl to Options

@aaronpearce thanks, I guess it's good for now. I personally like enum as it looks more correct, but then it can break existing stuff.

aaronpearce

comment created time in a month

push eventonmyway133/EasyStash

Aaron Pearce

commit sha bcc1f27b78d598868766fbfcb93326ae1ab1dc74

Add directoryUrl to Options

view details

Aaron Pearce

commit sha 23a186bf67afd4e204da0e3b2843e1b736a114fc

Update Storage.swift

view details

Khoa

commit sha 37d8fae83256f042b8bdacf508df9c9251171c0f

Merge pull request #15 from aaronpearce/master Fixes #12 - Adds directoryUrl to Options

view details

push time in a month

issue closedonmyway133/EasyStash

Support directly specifying folder URL.

Thank you for your work, but it seems in your code, you just simply construct the folder URL by using the configurable FileManager.SearchPathDirectory and folder. However, it will be a lot better if you can just have an option for me to directly set a URL since FileManager API is robust and easy to use enough, and your options don't directly support situations like App Group Containers, which I believe is somewhat a must for apps with extensions.

closed time in a month

laosb

PR merged onmyway133/EasyStash

Fixes #12 - Adds directoryUrl to Options

This fixes issue #12 by adding a directoryUrl variable to Options.

An alternative could be create an enum that could container the searchPathDirectory or a directory url instead.

+12 -6

2 comments

2 changed files

aaronpearce

pr closed time in a month

pull request commentonmyway133/EasyStash

Fixes #13 - Adds directoryUrl to Options

@aaronpearce Hi, thanks for the PR. I guess the OP of issue #13 means he wants to get the file url based on the key. This PR I think provides the opportunity to provide one's own directory url instead of relying on search path.

aaronpearce

comment created time in a month

issue commentonmyway133/EasyStash

Public method to get fileUrl

@kchlebus Hi, I think it would be simple to just make that method public if what's you're interested in is the fileUrl. Would you mind making a PR for that?

kchlebus

comment created time in a month

push eventonmyway133/Cheers

Khoa

commit sha 8eebcb02b77c58d963b78f075f054bf6736f22e3

Update README.md

view details

push time in a month

push eventonmyway133/Reindeers

Frédéric Maquin

commit sha c704cb1c8bc4558305d191c085f7cad045b2821b

Migrate project to Swift 5

view details

Frédéric Maquin

commit sha 617c38dd8b69eb607c51277b4af67aa6456aebeb

Fix deprecation warning triggered by withUnsafeBytes

view details

Khoa

commit sha 23f1f82da200ea97e6b8aefcb207064c7068bd48

Merge pull request #3 from ephread/master Migrate to Swift 5 / Xcode 11

view details

push time in a month

PR merged onmyway133/Reindeers

Migrate to Swift 5 / Xcode 11

This PR fixes all issues reported by Xcode 11.6.

Due to the deprecation of…

func withUnsafeBytes<ResultType, ContentType>(_ body: (UnsafePointer<ContentType>) throws -> ResultType) rethrows -> ResultType

… I used Michael Tsai's approach to bind the memory from UnsafeRawBufferPointer to a UnsafePointer<ContentType> reference.

I wonder if I should handle the case on an empty Data (count == 0) instance in toPointer() though. 🤔

I hope the PR is small enough, let me know what you think!

+70 -51

1 comment

8 changed files

ephread

pr closed time in a month

pull request commentonmyway133/Reindeers

Migrate to Swift 5 / Xcode 11

@ephread Thanks for the PR, I like it. Working with pointer in Swift is not fun 😄 I think for empty data we end up creating no xml children, so I guess that is fine for now

ephread

comment created time in a month

issue openedonmyway133/blog

How to make dynamic font size for UIButton

Use adjustsFontForContentSizeCategory

A Boolean that indicates whether the object automatically updates its font when the device's content size category changes.

If you set this property to YES, the element adjusts for a new content size category on a UIContentSizeCategoryDidChangeNotification.

button.titleLabel?.adjustsFontForContentSizeCategory = true
button.backgroundColor = UIColor.green
button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .title1)

label.adjustsFontForContentSizeCategory = true
label.backgroundColor = UIColor.yellow
label.font = UIFont.preferredFont(forTextStyle: .title1)

However it seems view (UIButton or UILabel) size is the same, just the inner text increases in size. A workaround is to put view inside UIStackView so UIButton or UILabel can automatically changes size.

created time in a month

issue commentonmyway133/blog

How to change background color in List in SwiftUI for macOS

@skt216 You use a Group

onmyway133

comment created time in a month

issue openedonmyway133/blog

How to test for view disappear in navigation controller

To test for viewWillDisappear during UINavigationController popViewController in unit test, we need to simulate UIWindow so view appearance works.

final class PopTests: XCTestCase {
    func testPop() {
        let window = UIWindow(frame: UIScreen.main.bounds)
        let navigationController = UINavigationController()
        window.rootViewController = navigationController
        let viewController = DetailViewController()

        navigationController.viewControllers = [
            UIViewController(),
            viewController
        ]

        window.makeKeyAndVisible()
        let expectation = XCTestExpectation()
        navigationController.popViewController(animated: false)
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
            XCTAssertTrue(viewController.wasDismissed)
            expectation.fulfill()
        }
        wait(for: [expectation], timeout: 1)
    }
}
class DetailViewController: UIViewController {
        override func viewWillDisappear(_ animated: Bool) {
            super.viewWillDisappear(animated)
            if isMovingFromParent {
                wasDismissed = true
            }
        }
}

created time in 2 months

startedBinaryBirds/feather

started time in 2 months

push eventonmyway133/onmyway133

Khoa

commit sha 0eb29b39272401438ec1f50c494f1c94f3281fed

Update README.md

view details

push time in 2 months

push eventonmyway133/awesome-machine-learning

Khoa

commit sha d728d73c97d0f657a9ce90ca1c20a992048d88f4

Update README.md

view details

push time in 2 months

push eventonmyway133/onmyway133.github.io

Khoa Pham

commit sha fc52e2eb04a845c2a0496560638a2d7cfbceb5ce

Site updated: 2020-07-14 23:31:32

view details

push time in 2 months

startedkhuong291/Flutter-Movie

started time in 3 months

startedkhuong291/Flutter-Ecommerce

started time in 3 months

push eventonmyway133/awesome-git-commands

Khoa

commit sha 05ec9f3c29844d467a8b60d4a5baf76a0a082c3c

Update README.md

view details

push time in 3 months

pull request commentonmyway133/awesome-ios-animation

Added carousel and pager animation libraries.

Hi @amit2908 thanks for taking the time to write the PR, can you put them into https://github.com/onmyway133/awesome-ios-animation/blob/master/Animation/tabbar.md ?

amit2908

comment created time in 3 months

create barnchonmyway133/onmyway133

branch : master

created branch time in 3 months

created repositoryonmyway133/onmyway133

What you don't know is what you haven't learned

created time in 3 months

push eventonmyway133/awesome-online-earning

Khoa

commit sha 37bbc67b5bcd27bff244e1fe491ff2538631056e

Update README.md

view details

push time in 3 months

push eventonmyway133/awesome-machine-learning

Khoa

commit sha dc9a0a9a6a1f0d48bac66a792fc9c6d96912333d

Update README.md

view details

push time in 3 months

push eventonmyway133/awesome-machine-learning

Khoa

commit sha de7b0920275540721ae7aee62eb387bbcd9f0414

Update README.md

view details

push time in 3 months

push eventonmyway133/awesome-machine-learning

Khoa

commit sha 0f206623164c8c511eafbfaf93f5c4e9da90d682

Update README.md

view details

push time in 3 months

push eventonmyway133/awesome-machine-learning

Khoa

commit sha 59da0e115b5f77f86cb519d27077c9f43dac6395

Update README.md

view details

push time in 3 months

pull request commentonmyway133/Smile

Fix matching strings with colon

@dstranz Nice catch, thanks for the PR, Dominique 👍

dstranz

comment created time in 3 months

push eventonmyway133/Smile

Dominique Stranz

commit sha dfde8e84c4bad0f7b7421e6f6533a43d93df16ca

Fix matching string with colon

view details

Khoa

commit sha 8634e5b2c5885f19c4b315cecee31cf9c7854fe3

Merge pull request #21 from dstranz/master Fix matching strings with colon

view details

push time in 3 months

PR merged onmyway133/Smile

Fix matching strings with colon

This PR will fix matching emojis inside strings with colon, like: "Let's sing together: In the :circus_tent:, there are :dog:, :cat: and :super_unicorn:"

Before: "Let's sing together: In the :circus_tent:, there are 🐶, 🐱 and :super_unicorn:"

After: "Let's sing together: In the 🎪, there are 🐶, 🐱 and :super_unicorn:"

I've also fixed some other tests.

+8 -8

0 comment

2 changed files

dstranz

pr closed time in 3 months

startedJohnEstropia/CoreStore

started time in 3 months

more