Author: Chris Lattner
class MulticastDelegate <T> { | |
private let delegates: NSHashTable<AnyObject> = NSHashTable.weakObjects() | |
func add(delegate: T) { | |
delegates.add(delegate as AnyObject) | |
} | |
func remove(delegate: T) { | |
for oneDelegate in delegates.allObjects.reversed() { | |
if oneDelegate === delegate as AnyObject { |
fastlane_version "2.50.1" | |
default_platform :ios | |
platform :ios do | |
before_all do | |
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." | |
# cocoapods | |
end |
App Store Review Guidelines | |
Introduction | |
Apps are changing the world, enriching people’s lives, and enabling developers like you to innovate like never before. As a result, the App Store has grown into an exciting and vibrant ecosystem for millions of developers and more than a billion users. Whether you are a first time developer or a large team of experienced programmers, we are excited that you are creating apps for the App Store and want to help you understand our guidelines so you can be confident your app will get through the review process quickly. | |
The guiding principle of the App Store is simple - we want to provide a safe experience for users to get apps and a great opportunity for all developers to be successful. We do this by offering a highly curated App Store where every app is reviewed by experts and an editorial team helps users discover new apps every day. For everything else there is always the open Internet. If the App Store model and guidelines are not best for your app or business idea th |
post_install do |installer| | |
print "Setting the default SWIFT_VERSION to 4.0\n" | |
installer.pods_project.build_configurations.each do |config| | |
config.build_settings['SWIFT_VERSION'] = '4.0' | |
end | |
installer.pods_project.targets.each do |target| | |
if ['SomeTarget-iOS', 'SomeTarget-watchOS'].include? "#{target}" | |
print "Setting #{target}'s SWIFT_VERSION to 3.0\n" | |
target.build_configurations.each do |config| |
javascript:document.getElementsByTagName('video')%5B0%5D.webkitEnterFullscreen() |
(check out What's New in Swift at 11:40, slide 42)
When you look up how to compile swift faster for debug builds, people very earnestly give advice that seems contradictory: you should "try using the whole module optimization flag," and also "never use whole module optimization for debugging". [^1]
This is confusing because some of us are using these two general words:
compilation: "turning text into an executable program"
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
#!/usr/bin/env bash | |
# If run without a name, open any current repo | |
if [ -z "$1" ]; then | |
URL=$(git remote get-url origin) | |
URL=${URL/"git@github.com:"/"https://github.com/"} | |
URL=${URL/".git"/""} | |
open $URL | |
else | |
open "https://github.com/$1" |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
let window = UIWindow(frame: UIScreen.main.bounds) |