This file contains hidden or 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
class Parent { | |
var child: Child? { | |
didSet { | |
child.callback = weak(self)?.delegateCallback | |
} | |
} | |
func delegateCallback() { | |
// ... |
This file contains hidden or 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
struct Node<T> { // error: recursive value type 'Node<T>' is not allowed | |
var child: Node? | |
var value: T | |
init(value: T, child: Node? = nil) { | |
self.value = value | |
self.child = child | |
} | |
} |
This file contains hidden or 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
protocol PubSubMessageType { | |
associatedtype Topic | |
var topic: Topic { get } | |
} | |
protocol PubSubType { | |
associatedtype Message = PubSubMessageType | |
associatedtype Topic | |
This file contains hidden or 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
// flow controll using do-catch | |
do { | |
try commentBody(¿commentRangeBeforeOffset(¿getNameOffset(dictionary))) | |
} catch let e as OptionalError { | |
} catch { | |
} | |
// folding into optional value. Currently produces double optional |
This file contains hidden or 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
target '…' do | |
end | |
post_install do |installer_or_rep| | |
installer = installer_or_rep.respond_to?(:installer) ? installer_or_rep.installer : installer_or_rep | |
installer.pods_project.build_configurations.each do |config| | |
# Only in debug | |
if config.name.include?("Debug") |
This file contains hidden or 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 Foundation | |
// Some clearly non-NSObject-based models: | |
enum Coconut: String { | |
case small, medium, large | |
} | |
struct Tomato { | |
static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1)) |
This file contains hidden or 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 UIKit | |
class ViewController: UIViewController { | |
private var a1: Int! | |
private var a2: Int! | |
private var a3: Int! | |
private var a4: Int! | |
private var a5: Int! | |
private var a6: Int! |
This file contains hidden or 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
let emojis: [String: [String]] = [ | |
// +[EMFEmojiCategory TravelAndPlacesEmoji] | |
"travel": ["🚗", "🚕", "🚙", "🚌", "🚎", "🏎", "🚓", "🚑", "🚒", "🚐", "🚚", "🚛", "🚜", "🛴", "🚲", "🛵", "🏍", "🚨", "🚔", "🚍", "🚘", "🚖", "🚡", "🚠", "🚟", "🚃", "🚋", "🚞", "🚝", "🚄", "🚅", "🚈", "🚂", "🚆", "🚇", "🚊", "🚉", "🚁", "🛩", "✈️", "🛫", "🛬", "🚀", "🛰", "💺", "🛶", "⛵️", "🛥", "🚤", "🛳", "⛴", "🚢", "⚓️", "🚧", "⛽️", "🚏", "🚦", "🚥", "🗺", "🗿", "🗽", "⛲️", "🗼", "🏰", "🏯", "🏟", "🎡", "🎢", "🎠", "⛱", "🏖", "🏝", "⛰", "🏔", "🗻", "🌋", "🏜", "🏕", "⛺️", "🛤", "🛣", "🏗", "🏭", "🏠", "🏡", "🏘", "🏚", "🏢", "🏬", "🏣", "🏤", "🏥", "🏦", "🏨", "🏪", "🏫", "🏩", "💒", "🏛", "⛪️", "🕌", "🕍", "🕋", "⛩", "🗾", "🎑", "🏞", "🌅", "🌄", "🌠", "🎇", "🎆", "🌇", "🌆", "🏙", "🌃", "🌌", "🌉", "🌁"], | |
// +[EMFEmojiCategory NatureEmoji] | |
"nature": ["🐶", "🐱", "🐭", "🐹", "🐰", "🦊", "🐻", "🐼", "🐨", "🐯", "🦁", "🐮", "🐷", "🐽", "🐸", "🐵", "🙈", "🙉", "🙊", "🐒", "🐔", "🐧", "🐦", "🐤", "🐣", "🐥", "🦆", "🦅", "🦉", "🦇", "🐺", "🐗", "🐴", "🦄", "🐝", "🐛", "🦋", "🐌", "🐚", "🐞", "🐜", "🕷", "🕸", "🐢", "🐍", "🦎", "🦂", "🦀", "🦑", "🐙", "🦐", "🐠", "🐟", "🐡", "🐬", "🦈 |
This file contains hidden or 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
{ | |
"💍":"diamond | engagement ring | diamond ring | diamond rings | diamonds | engagement rings", | |
"🆎":"blood type AB", | |
"❣":"heart", | |
"🇱🇨":"Saint Lucia | Saint Lucian flag", | |
"🇮🇪":"Ireland | Irish flag", | |
"🇨🇮":"Côte d’Ivoire | Ivory Coast | Ivorian flag", | |
"💎":"diamond | gem | gemstone | jewel | diamonds | gems | gemstones | jewels", | |
"☠️":"skull and crossbones | poison | poisonous", | |
"👩💻":"technology worker | tech worker | technologist | techie | IT worker | Apple genius | woman in technology | woman tech worker | woman technologist | woman IT worker | woman in IT | woman Apple genius", |
This file contains hidden or 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
void *handler = loadPrivate(@"ChatKit", TypePrivateFramework); | |
const Class CKGradientViewCls = NSClassFromString(@"CKGradientView"); | |
UIView *const gradientView = [(UIView *)[CKGradientViewCls alloc] initWithFrame:{0, 0, 300, 200}]; |