Skip to content

Instantly share code, notes, and snippets.

@julianschiavo
Last active March 14, 2019 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julianschiavo/d1929786d58fcb27baa3e1574ba491c0 to your computer and use it in GitHub Desktop.
Save julianschiavo/d1929786d58fcb27baa3e1574ba491c0 to your computer and use it in GitHub Desktop.
Marzipan Cheatsheet and Workarounds

Marzipan Cheatsheet

Want to avoid going through manually and finding every single missing framework, method, or issue? Use this quick cheatsheet to check your code for any issues before building on Marzipan.

Unavailable Frameworks

Apple

  • AppKit (possible via lldb but not recommended)
  • AddressBook/Contacts/ContactsUI
  • CoreTelephony (CTTelephonyNetworkInfo)
  • CloudKit (couldn't get it working)
  • GameplayKit
  • IntentsUI (Intents seems to work)
  • LocalAuthentication
  • MessageUI (MFMailComposeViewController)
  • Photos (causes AppKit to load)
  • SafariServices (SFSafariViewController)
  • Social (SLComposeViewController)

Third Party

  • Firebase by Google
  • Realm (immediate crash)
  • SwiftEntryKit
  • WeScan

Unavailable Methods/Properties

UIKit

  • accessibilityIgnoresInvertColors (Invert Colors)
  • UIDocumentBrowser
  • UINotificationFeedbackGenerator (Haptic Feedback)
  • UIPrintInfo (Printing)
  • UIWebView

Other

  • -[NSFont isSystemFont] (Used in Dynamic Text) [Import file below to fix]

import UIKit
// Fix missing selectors on NSFont
extension NSObject {
@objc func isSystemFont() -> Bool {
return false
}
@objc func _fontAdjustedForContentSizeCategoryCompatible(withTraitCollection arg1: Any?) -> Any? {
return self
}
}
// Fix center text alignment
enum NSTextAlignment: Int {
case left = 0 // Visually left aligned
#if TARGET_OS_IPHONE
case center = 1 // Visually centered
case right = 2 // Visually right aligned
#else
case right = 1 // Visually right aligned
case center = 2 // Visually centered
#endif
case justified = 3 // Fully-justified. The last line in a paragraph is natural-aligned
case natural = 4 // Indicates the default alignment for script
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment