

You also might wanna just use Whisky which does this automatically
This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!
In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.
import Foundation | |
// Export running app as .ipa, then return path to exported file. | |
// Returns String because app crashes when returning URL from async function for some reason... | |
func exportIPA() async throws -> String | |
{ | |
// Path to app bundle | |
let bundleURL = Bundle.main.bundleURL | |
// Create Payload/ directory |
Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
import UIKit | |
class ViewController: UIViewController { | |
let tableView: UITableView = { | |
let tv = UITableView(frame: .zero, style: .plain) | |
tv.register(UITableViewCell.self, forCellReuseIdentifier: "Cell") | |
return tv | |
}() |
If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).
You can do this in recent versions of Xcode by setting a configuration default.
From a terminal, just type this command and press Enter:
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
/// Log the current filename and function, with an optional extra message. Call this with no arguments to simply print the current file and function. Log messages will include an Emoji selected from a list in the function, based on the hash of the filename, to make it easier to see which file a message comes from. | |
/// - Parameter message: Optional message to include | |
/// - file: Don't use; Swift will fill in the file name | |
/// - function: Don't use, Swift will fill in the function name | |
/// - line: Don't use, Swift will fill in the line number | |
func logMilestone(_ message: String? = nil, file: String = #file, function: String = #function, line: Int = #line) -> Void { | |
#if DEBUG | |
// Feel free to change the list of Emojis, but don't make it shorter, because a longer list is better. | |
let logEmojis = ["π","π","π±","π","πΊ","π½","πΎ","π€","π","π","π","π§ ","π","π§€","πΆ","π±","π","πΉ","π¦","π»","π¨","π΅","π¦","π¦","π","π₯","π₯","βοΈ","π","π₯","π½","π","πΏ","πΉ","π","β€οΈ","π§‘","π","π","π","π","π"] | |
let logEmoji = logEmojis[abs( |
// Don't forget to prefix your category! | |
#import <UIKit/UIKit.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface UIWindow (PSPDFAdditions) | |
#if TARGET_OS_UIKITFORMAC |
/*: | |
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI | |
The only purpose of this code is to implement those wrappers myself | |
just to understand how they work internally and why they are needed, | |
β οΈ This is not supposed to be a reference implementation nor cover all | |
subtleties of the real Binding and State types. | |
The only purpose of this playground is to show how re-implementing | |
them myself has helped me understand the whole thing better |