Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
extension UIAlertController { | |
/// Creates a view controller for notifying the user that a conversion is occurring. Accepts a block that is executed upon conversion completion. | |
static func createConvertingAlertController(onConversionCompletion: @escaping () -> Void) -> UIAlertController { | |
// The title font corresponds to Dynamic Type style "Headline" | |
let titleFont = UIFont.preferredFont(forTextStyle: .headline) | |
let calculatorImageView = UIImageView(image: UIImage(named: "calculator.fill", in: nil, with: UIImage.SymbolConfiguration(font: UIFont.systemFont(ofSize: titleFont.pointSize * 2.0, weight: .semibold)))) | |
let measuringAttributedStringHeight = NSAttributedString(string: "Penguin", attributes: [.font: titleFont]).boundingRect(with: .zero, options: [.usesFontLeading, .usesLineFragmentOrigin], context: nil).height | |
let desiredOffset = 15.0 + calculatorImageView.bounds.height | |
let totalNewlinePrefixes = Int((desiredOffset / measuringAttributedStringHeight). |
import SwiftUI | |
import PlaygroundSupport | |
struct iPod: View { | |
var body: some View { | |
VStack(spacing: 40) { | |
Screen() | |
ClickWheel() | |
Spacer() | |
} |
// A fun little game written in SwiftUI | |
// Copyright (c) John Sundell 2020, MIT license. | |
// This is a hacky implementation written just for fun. | |
// It's only verified to work on iPhones in portrait mode. | |
import SwiftUI | |
final class GameController: ObservableObject { | |
@Published var plane = GameObject.plane() | |
@Published private(set) var clouds = [GameObject]() |
What are the consequences for a person driving a motor vehicle under the influence of drugs (e.g. hashish, heroin, cocaine)?
[x] Confiscation of driving licence or driving ban
[x] Compulsory medical/psychological examination
[x] Fine and/or imprisonment
In which instances do you have to approach a pedestrian crossing with particular care?
/** | |
* MacEditorTextView | |
* Copyright (c) Thiago Holanda 2020-2021 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import Combine | |
import SwiftUI |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<style> | |
@font-face { | |
font-family: 'Uni Neue'; | |
src: local('Uni Neue'), url('UniNeueRegular.otf') format('opentype'); |
When adding a third framework to yours you may face the following error if you try to run tests: | |
The bundle “[framework-name]Tests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. | |
(dlopen_preflight([framework-path]): Library not loaded: @rpath/[third-framework-name].framework/[third-framework-name] | |
Referenced from: [derived-data-framework-path] | |
Reason: image not found) | |
Program ended with exit code: 82 | |
This problem can be solved by adding "$(PROJECT_DIR)" to the "Runpath Search Paths" on the framework's Build Settings. |
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
if [ "true" == ${ALREADYINVOKED:-false} ] | |
then | |
echo "RECURSION: Detected, stopping" | |
else | |
export ALREADYINVOKED="true" |
// go on you labels pages | |
// eg https://github.com/cssnext/cssnext/labels | |
// paste this script in your console | |
// copy the output and now you can import it using https://github.com/popomore/github-labels ! | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), |