View BodyCounter.swift
This file contains 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 SwiftUI | |
import UIKit | |
private struct BodyCounterView: UIViewRepresentable { | |
let color: UIColor | |
private let id = UUID() // Force view updates | |
func makeUIView(context: Context) -> _BodyCounterView { | |
let view = _BodyCounterView() |
View ExampleView.swift
This file contains 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
@objc protocol ExampleActions: AnyObject { | |
func pushUIKitViewController() | |
} | |
struct ExampleView: View { | |
@FirstResponder private var firstResponder | |
var body: some View { | |
Button { | |
firstResponder.sendAction(#selector(ExampleActions.pushUIKitViewController)) |
View example_block_swizzling.m
This file contains 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 UILabel (SwizzlingExamples) | |
+ (void)load | |
{ | |
SwizzleSelectorWithBlock_Begin(self, @selector(initWithFrame:)) | |
^(UILabel *self, CGRect frame) { | |
if ((self = ((id (*)(id, SEL, CGRect))_imp)(self, _cmd, frame))) { | |
// ... | |
} | |
return self; |
View gist:267d3b8b30604fac541f
This file contains 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
#!/bin/sh | |
# Repository settings | |
REPOSITORY_NAME="YourRepositoryName" | |
README_FILE_NAME="README.markdown" | |
# Update a Travis badge URL found in the README to keep it in sync with the branch name | |
# Badge example: | |
# [](https://travis-ci.org/$USER_NAME/$REPOSITORY_NAME) | |
branch_name=`git symbolic-ref --short HEAD` |
View UITextView+SDECursorVisibility.m
This file contains 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
// | |
// UITextView+SDECursorVisibility.m | |
// | |
// Created by Samuel Défago on 29.10.14. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UITextView (SDECursorVisibility) |
View uncrustify-objc.cfg
This file contains 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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.4.3 (252) | |
# | |
# Alignment | |
# --------- | |
## Alignment |