Use _NS_4445425547
or NS🐞
for enables debuggging panel. When enabled it, a ladybug 🐞 menu appears in the app menu bar.
“4445425547” means DEBUG in Unicode table.
0x44=D
0x45=E
0x42=B
0x55=U
0x47=G
extension View { | |
/// Adds a double click handler this view (macOS only) | |
/// | |
/// Example | |
/// ``` | |
/// Text("Hello") | |
/// .onDoubleClick { print("Double click detected") } | |
/// ``` | |
/// - Parameters: | |
/// - handler: Block invoked when a double click is detected |
func className(target: AnyObject) -> String { | |
let nameSpaceClassName = NSStringFromClass(type(of: target)) | |
if let className = nameSpaceClassName.components(separatedBy: ".").last { | |
return className | |
} | |
return "" | |
} |
Author: https://www.cyanhall.com/
Core Animation's original name is Layer Kit
Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree
. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.
In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer
. The only major feature of UIView that isn’t handled by CALayer is user interaction.
There are four hierarchies, each performing a different role:
import Moya | |
import SwiftyJSON | |
enum FileWebService { | |
case download(url: String, fileName: String?) | |
var localLocation: URL { | |
switch self { | |
case .download(let url, let fileName): | |
let fileKey: String = url.MD5 // use url's md5 as local file name |
// | |
// AsynchronousBlockOperation.swift | |
// | |
// Created by Jose Canepa on 12/13/17. | |
// Copyright © 2017 Jose Canepa. All rights reserved. | |
// | |
import Foundation | |
/// Block based version of the AsynchronousOperation |
To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.
Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
// | |
// main.swift | |
// mutablecomposition | |
// | |
// Created by Kevin Meaney on 24/08/2015. | |
// Copyright (c) 2015 Kevin Meaney. All rights reserved. | |
// | |
import Foundation |