- Introducing SwiftUI: https://developer.apple.com/tutorials/swiftui
- Develop Apps for iOS: https://developer.apple.com/tutorials/app-dev-training
- Exploring SwiftUI Sample Apps: https://developer.apple.com/tutorials/sample-apps
- Learning SwiftUI: https://developer.apple.com/tutorials/swiftui-concepts
- Mac Catalyst Essentials: https://developer.apple.com/tutorials/mac-catalyst
- Welcome to Develop in Swift Tutorials: https://developer.apple.com/tutorials/develop-in-swift/welcome-to-develop-in-swift-tutorials
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
private func measureElapsedTime(_ operation: () throws -> Void) throws -> Double { | |
let startTime = DispatchTime.now() | |
try operation() | |
let endTime = DispatchTime.now() | |
let elapsedTime = endTime.uptimeNanoseconds - startTime.uptimeNanoseconds | |
let elapsedTimeInMilliSeconds = Double(elapsedTime) / 1_000_000.0 | |
return elapsedTimeInMilliSeconds | |
} |
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
// Image count | |
var imgTotal = 0; | |
var imgLoaded = 0; | |
// Get file name from a URL | |
function getFileName(o) { | |
var pos = o.lastIndexOf("/"); | |
return o.substring(pos+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 Foundation | |
func stringColorCode(_ s: String?) -> String { | |
guard let IDString = s else { | |
return "000000" | |
} | |
let hashInt = IDString.hashValue | |
let c = hashInt & 0xFFFFFF | |
let hexString = String(format:"%06x", c) | |
return hexString.suffix(6).uppercased() |
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
// Example program | |
#include <iostream> | |
#include <string> | |
inline int random1() { | |
static int seed = 703; // seed can be picked randomly | |
return seed = int(seed*48271LL%2147483647); | |
} | |
int main() { |