Skip to content

Instantly share code, notes, and snippets.

@ngeri
ngeri / ViewController.swift
Created August 30, 2021 17:36
Unexpected default kerning when using attributedText of UITextField
import UIKit
final class ViewController: UIViewController {
private lazy var textField: UITextField = {
let view = UITextField()
view.translatesAutoresizingMaskIntoConstraints = false
view.delegate = self
view.borderStyle = .roundedRect
view.keyboardType = .numberPad
@rdv0011
rdv0011 / swift-combine-multiple-publishers.md
Last active May 6, 2021 02:54
Swift Combine. Transform publisher output values and combine publishers together.

Quite often we encounter a problem of downloading files by links from the backend when writing apps. Let's take a look at how it might be achieved with Combine. The code below contains a dummy asymchronous task and transforms publisher's output values from a series of links to and an actual data items(images). A returned publisher might be used in a view model as a provider for UIImageView's for example.

import UIKit
import Combine
import WebKit
import PlaygroundSupport

enum CustomNetworkingError: Error {
    case invalidServerResponse
@hanazuki
hanazuki / adblock.txt
Last active September 25, 2023 14:50
blocklists
[Adblock Plus 2.0]
! Title: PersonalList
@@||*.fastly-analytics.com
@@||js.rtoaster.jp/Rtoaster.js
||j.wovn.io
||d.shutto-translation.com
@mpppk
mpppk / clean_architecture.md
Last active July 22, 2024 06:48
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@ytyubox
ytyubox / README.md
Last active December 21, 2021 08:31
UIControlSubscription.swift
@candostdagdeviren
candostdagdeviren / .swiftlint.yml
Last active July 6, 2024 12:11
Sample SwiftLint file to apply best practices
disabled_rules: # rule identifiers to exclude from running
- variable_name
- nesting
- function_parameter_count
opt_in_rules: # some rules are only opt-in
- control_statement
- empty_count
- trailing_newline
- colon
- comma
@sauvikatinnofied
sauvikatinnofied / UIColorExtension.swift
Last active July 3, 2020 14:03
MediumBlog Color Constant
extension UIColor {
/**
Creates an UIColor from HEX String in "#363636" format
- parameter hexString: HEX String in "#363636" format
- returns: UIColor from HexString
*/
convenience init(hexString: String) {
@lukaspili
lukaspili / ScrollableViewController.swift
Last active March 17, 2023 12:35
Scroll view snap kit
import UIKit
import SnapKit
class ScrollableViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.whiteColor()
let scrollView = UIScrollView()
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active June 1, 2024 17:33
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

@githubutilities
githubutilities / Apple-real-device-debugging.md
Last active November 18, 2023 12:41
install ipa using command line

Apple Real Devices Debugging

What you need

  • certificate--which tells your devices that Apple trust you
  • a app id
  • a test device
  • a provisioning profile