This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.
Let's go ahead and create a folder containing all our sources:
mkdir swift-rs && cd $_
#!/usr/bin/swift sh | |
import Foundation | |
import PromiseKit // @mxcl ~> 6.5 | |
import Swifter // @mattdonnelly == b27a89 | |
let swifter = Swifter( | |
consumerKey: "FILL", | |
consumerSecret: "ME", | |
oauthToken: "IN", | |
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
#!/bin/bash | |
echo "Removing unavailable simulators..." | |
xcrun simctl delete unavailable | |
echo "Brew cleanup..." | |
brew cleanup | |
echo "Removing Xcode Caches..." | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode |
#USAGE: sh clean_unused_images.sh | |
project_path='/Users/../../Projects/iOS/APP_IOS/' # Change to your project's path | |
assets_path=$project_path"Assets.xcassets" # asset's path | |
assets_name="${assets_path/$project_path/$(echo '')}" | |
printf "\e[92mGetting first images:\e[0m\n" | |
images="" | |
# Get Images from assets root directory |
// | |
// AppDelegate.swift | |
// Dock Shooter | |
// | |
// Created by Shihab Mehboob on 01/11/2021. | |
// | |
import Cocoa | |
@main |
import SwiftUI | |
#if !os(watchOS) | |
#if canImport(UIKit) | |
public typealias PlatformViewRepresentableType = UIViewRepresentable | |
#else | |
public typealias PlatformViewRepresentableType = NSViewRepresentable | |
#endif // canImport(UIKit) |