This file contains 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 SwiftUI | |
struct ContentView: View { | |
@State private var showSheetView = false | |
var body: some View { | |
VStack(spacing: 0) { | |
topBar | |
Color.blue | |
} |
This file contains 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 | |
extension String { | |
var letters: [String] { | |
map { "\($0)" } | |
} | |
} | |
func topLetterFrequencies(letters: [String], top n: Int = 10) -> [(key: String, value: Int)] { | |
var letterFrequencies = [String: Int]() |
This file contains 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 | |
extension Measurement where UnitType: Dimension { | |
func approximatelyConverted(to otherUnit: UnitType) -> Measurement<UnitType> { | |
switch (unit, otherUnit) { | |
case (UnitLength.meters, UnitLength.feet): | |
return Measurement(value: value * 3, unit: otherUnit) | |
case (UnitLength.feet, UnitLength.meters): | |
return Measurement(value: value * 3 / 10, unit: otherUnit) | |
case (UnitSpeed.knots, UnitSpeed.metersPerSecond): |
This file contains 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
private func configureMicrophone() -> Bool { | |
session.beginConfiguration() | |
defer { | |
session.commitConfiguration() | |
} | |
session.usesApplicationAudioSession = true | |
session.automaticallyConfiguresApplicationAudioSession = false | |
do { |
This file contains 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
// | |
// FlippedTableView.swift | |
// translate | |
// | |
// Created by Engin Kurutepe on 26.12.18. | |
// Copyright © 2018 Fifteen Jugglers Software UG. All rights reserved. | |
// | |
import UIKit |
This file contains 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
// NSScanner+Swift.swift | |
// A set of Swift-idiomatic methods for NSScanner | |
// | |
// (c) 2015 Nate Cook, licensed under the MIT license | |
import Foundation | |
extension Scanner { | |
// MARK: Strings |
This file contains 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
var unmanagedEmails = ABRecordCopyValue(person, property); | |
let emails: ABMultiValueRef = | |
Unmanaged.fromOpaque(unmanagedEmails.toOpaque()).takeUnretainedValue() as NSObject as ABMultiValueRef | |
let index = ABMultiValueGetIndexForIdentifier(emails, identifier) | |
var unmanagedEmail = ABMultiValueCopyValueAtIndex(emails, index); | |
let email: String = Unmanaged.fromOpaque(unmanagedEmail.toOpaque()).takeUnretainedValue() as NSObject as String |
This file contains 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
2014-07-24 14:05:07.735 test[18888:60b] viewDidLoad window: (null) | |
2014-07-24 14:05:07.736 test[18888:60b] viewWillAppear: window: (null) | |
2014-07-24 14:05:08.245 test[18888:60b] viewDidAppear: window: <UIWindow: 0x8f40320; frame = (0 0; 320 480); autoresize = W+H; gestureRecognizers = <NSArray: 0x8f34860>; layer = <UIWindowLayer: 0x8f34780>> | |
2014-07-24 14:05:09.894 test[18888:60b] viewWillDisappear: window: <UIWindow: 0x8f40320; frame = (0 0; 320 480); autoresize = W+H; gestureRecognizers = <NSArray: 0x8f34860>; layer = <UIWindowLayer: 0x8f34780>> | |
2014-07-24 14:05:10.399 test[18888:60b] viewDidDisappear: window: (null) |
This file contains 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
Process: Ingredients [8187] | |
Path: /Applications/Ingredients.app/Contents/MacOS/Ingredients | |
Identifier: net.fileability.ingredients | |
Version: 1.1b1 (1.0) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [207] | |
Date/Time: 2011-07-31 00:44:54.349 +0200 | |
OS Version: Mac OS X 10.7 (11A511) | |
Report Version: 9 |