#Hello Edgerunners, welcome to the Night-City.

Welcome!

Swift: Codable not decoding properties with subclasses

In this code, the groceries properties is not deserialised from JSON. The name property is, but not the groceries one. import Foundation let json = """ { "name": "wow", "groceries": [ { "name": "Banana", "poin...

Remove all macOS generated invisible files

Remove all macOS generated invisible files in current folder: both .DS_Store and ._XXXX files. find . -type f -name ".DS_Store" -print -exec rm -f {} \; find . -type f -name "._*" -print -exec rm -f {} \; ...

RSYNC Cheatsheet

Commands Description rsync /path/to/file.ext /path/to/dest 简单的复制文件 file.ext 到 /path/to/dest 目录中 rsync -n /path/to/file.ext /path/to/dest 演习模式:简单的复制文件 file.ext 到 /path/to/dest 目录中 -n: 演习、排练,并不会进行真实的操作 rsync --size-only /path/to/file.ext /path/to/dest 简单的复制文件 fi...

Tkinter Cheatsheet

Hello World We always need to follow two steps no matter how big the application is, there is always two steps. initialize the widget and shove it on the screen that it. from tkinter import Tk,\ Label #initializing tkinter application root = Tk() # Creating label widget myLabel = Label(root, tex...

CSS Selectors Cheatsheet

Selector Example Example description .class .intro Selects all elements with class="intro" .class1.class2 .name1.name2 Selects all elements with both name1 and name2 set within its class attribute .class1 .class2 .name1 .name2 Selects all elements with name2 that is a de...

Swift: Return instancetype

To return instancetype in Swift, you can define a generic helper method which infers the type of self from the calling context: public extension UIViewController { // Call this public class func instance(storyboard sbname: String, bundle: Bundle? = nil, identifier: String?) -> Self { ...

CocoaPods: Encountered an unknown error (Pod::DSLError) during validation

在发布到 CocoaPods 是如果遇到下面的问题: Validating podspec -> UIMessageBar (1.0.0) - ERROR | [iOS] unknown: Encountered an unknown error (Pod::DSLError) during validation. [!] The spec did not pass validation, due to 1 error. 可以尝试修改 .podspec 文件中类似这样的配置: spec.source_files = 'UIMessageBar/**/*&#...

Swift: Codable With Custom Dates

How do you decode a JSON feed that has several custom date formats? If you are lucky using a dateDecodingStrategy might be enough. Unfortunately it has limited support for the .iso8601 format and you can only set one strategy at a time so it does not help when you have two or more different date for...

Swift: Access Levels

You may not have noticed but there was a small but important change to the private access level in Swift 4. After a quick recap of the five levels I cover what has changed in Swift 4, what do you need to know when migrating from Swift 3 and what is the point of fileprivate now? The Five Access Level...

LAContext.biometryType returns LABiometryType.none in iOS 11

I'm trying to support FaceID in my application. Running LAContect().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) returns true, so I expect that the device has biometrics enabled (which it has, it is an iPhone X with iOS 11.2.1 with FaceID enrolled and working for un...

你应当有控制力,不是控制欲。

What is TIC Read Status?

Apple staff gave the following answer: TIC expands to "TCP I/O connection", which is a subsystem within CFNetwork that runs a TCP connection. For example: TIC Read Status [11:0x0]: 1:57. 1 and 57 are the CFStreamError domain and code, respectively; a domain of 1 is kCFStreamErrorDomainPOSIX and, wi...

What's this?

The Night-City version of Hotodogo inspired by Cyberpunk 2077. Not finished yet.

Pinned Message

The Founder and CEO of Infeca Technology.

Developer, Designer, Blogger.

Big fan of Apple, Love of colour.

Feel free to contact me.

反曲点科技创始人和首席执行官。

开发、设计与写作皆为所长。

热爱苹果、钟情色彩。

随时恭候 垂询

Outer Square Inner Square