Skip to content

Instantly share code, notes, and snippets.

View viettrungphan's full-sized avatar

Phan Viết Trung viettrungphan

  • Dwarves Foundation
  • VietNam
View GitHub Profile
@viettrungphan
viettrungphan / ocmock-cheatsheet.m
Created May 11, 2023 14:07 — forked from oks/ocmock-cheatsheet.m
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@viettrungphan
viettrungphan / sample.swift
Created February 9, 2020 08:21 — forked from chriseidhof/sample.swift
View Inspection
import SwiftUI
struct SizeKey: PreferenceKey {
static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) {
value = value ?? nextValue()
}
}
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {

Keybase proof

I hereby claim:

  • I am viettrungphan on github.
  • I am phanviettrung (https://keybase.io/phanviettrung) on keybase.
  • I have a public key ASAZpBX097onYRMZ5vwNuv8mszDgkS3lqTlm4x3xG0-zqwo

To claim this, I am signing this object: