Skip to content

Instantly share code, notes, and snippets.

Avatar

Bruno Coelho 4brunu

View GitHub Profile
View Issue with open property wrappers
@propertyWrapper
open class PropertyWrapperWithOpenInit {
var _value: String
open init(wrappedValue: String) { // error: only classes and overridable class members can be declared 'open'; use 'public'
self._value = wrappedValue
}
open var wrappedValue: String {
get {
return _value
}
View openapi-kotlin-all-properties-required.yaml
swagger: '2.0'
info:
description: "description"
version: 1.0.0
title: OpenAPI
tags:
- name: person
description: persons
paths:
/person:
View openapi-kotlin-one-property-required.yaml
swagger: '2.0'
info:
description: "description"
version: 1.0.0
title: OpenAPI
tags:
- name: person
description: persons
paths:
/person:
View openapi-bug-enum.yaml
components:
schemas:
EventMotive:
additionalProperties: false
properties:
eventType:
$ref: '#/components/schemas/MotivesCategory'
id:
format: int32
type: integer
@4brunu
4brunu / check_static_library_bitcode_support.txt
Created Mar 10, 2017
Check if a static library supports bitcode
View check_static_library_bitcode_support.txt
otool -l path/to/libxpto.a | grep bitcode | wc -l
OUTPUT:
0 - No bitcode support
>1 - Bitcode support
@4brunu
4brunu / SampleViewController.swift
Created Jan 20, 2017 — forked from JaviSoto/SampleViewController.swift
Init based Storyboard View Controller Instantiation
View SampleViewController.swift
final class SampleViewController: StoryboardBackedViewController {
// Unfortunately this must be an IUO var, so that we can set the value after super.init
private var member: Foo!
// Proper dependency injection in a storyboard backed VC!
init(foo: Foo) {
super.init(storyboardIdentifier: "SampleViewControllerIdentifier")
// We have to set the members *after* calling super.init, since it changes the instance of `self`.
self.member = foo
@4brunu
4brunu / ButtonProblemSample.swift
Last active Jan 11, 2017
Button with gradient and round courners doesn't show text
View ButtonProblemSample.swift
import UIKit
extension UIButton {
func applyBackgroundGradientStyle() {
roundCorners()
applyGradient()
self.setTitleColor(UIColor.white, for: .normal)
}
@4brunu
4brunu / ProtocolExtensionsSample.swift
Last active Jan 11, 2017
Swift - Protocol extensions
View ProtocolExtensionsSample.swift
//https://speakerdeck.com/realm/natasha-murashev-practical-protocol-oriented-programming?slide=19
import UIKit
protocol Shakeable {
}
extension Shakeable where Self: UIView {
func shake() {
print("shake")
}
@4brunu
4brunu / ProtocolDefaultImplementation.swift
Last active Jan 11, 2017
Swift - protocol default implementation
View ProtocolDefaultImplementation.swift
import Foundation
protocol Shakeable {
func shake()
func yooo()
}
extension Shakeable {
func shake() {
print("Extension -> shake")
@4brunu
4brunu / README.md
Created Jun 21, 2016 — forked from lopspower/README.md
Material Animations
View README.md

Material Animations

Android Arsenal

[Android Transition Framework][transition-framework] can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.
You can’t perform that action at this time.