├── ClassWrittenInSwift ├── Assets.xcassets │ ├── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ClassWrittenInSwift-Bridging-Header.h ├── ViewController.swift ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard └── AppDelegate.swift ├── ClassWrittenInSwift.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ ├── ClassWrittenInSwiftKit.xcscheme │ │ └── ClassWrittenInSwift.xcscheme └── project.pbxproj ├── ClassWrittenInSwiftKit ├── Source │ ├── ClassWrittenInSwift.h │ └── ClassWrittenInSwift.mm ├── ClassWrittenInSwiftKit.h └── Info.plist ├── ClassWrittenInSwift.podspec ├── LICENSE ├── README.md ├── .travis.yml └── .gitignore /ClassWrittenInSwift/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ClassWrittenInSwift/ClassWrittenInSwift-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ClassWrittenInSwiftKit/Source/ClassWrittenInSwift.h: -------------------------------------------------------------------------------- 1 | // 2 | // ClassWrittenInSwift.h 3 | // ClassWrittenInSwift 4 | // 5 | // Created by 杨萧玉 on 2018/10/21. 6 | // Copyright © 2018 杨萧玉. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ClassWrittenInSwift : NSObject 14 | 15 | + (BOOL)isSwiftClass:(Class)cls; 16 | + (nullable NSArray *)lazyPropertyNamesOfSwiftClass:(Class)cls; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /ClassWrittenInSwiftKit/ClassWrittenInSwiftKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // ClassWrittenInSwiftKit.h 3 | // ClassWrittenInSwiftKit 4 | // 5 | // Created by 杨萧玉 on 2018/10/21. 6 | // Copyright © 2018 杨萧玉. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ClassWrittenInSwiftKit. 12 | FOUNDATION_EXPORT double ClassWrittenInSwiftKitVersionNumber; 13 | 14 | //! Project version string for ClassWrittenInSwiftKit. 15 | FOUNDATION_EXPORT const unsigned char ClassWrittenInSwiftKitVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | #import 19 | 20 | -------------------------------------------------------------------------------- /ClassWrittenInSwift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ClassWrittenInSwift 4 | // 5 | // Created by 杨萧玉 on 2018/10/21. 6 | // Copyright © 2018 杨萧玉. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ClassWrittenInSwiftKit 11 | 12 | class ViewController: UIViewController { 13 | lazy var iamLazy = "LazyBoy" 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | // Do any additional setup after loading the view, typically from a nib. 17 | let isSwift = ClassWrittenInSwift.isSwiftClass(type(of: self)) 18 | print("\(type(of: self)) isSwift: \(isSwift)") 19 | let name = ClassWrittenInSwift.lazyPropertyNames(ofSwiftClass: type(of: self)) 20 | print("lazyPropertyNames: \(String(describing: name))") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ClassWrittenInSwiftKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ClassWrittenInSwift" 3 | s.version = "0.0.6" 4 | s.summary = "Something for Class written in Swift." 5 | s.description = <<-DESC 6 | Check If a Class is written in Swift. 7 | Just one line code. 8 | DESC 9 | s.homepage = "https://github.com/yulingtianxia/ClassWrittenInSwift" 10 | 11 | s.license = { :type => 'MIT', :file => 'LICENSE' } 12 | s.author = { "YangXiaoyu" => "yulingtianxia@gmail.com" } 13 | s.social_media_url = 'https://twitter.com/yulingtianxia' 14 | s.source = { :git => "https://github.com/yulingtianxia/ClassWrittenInSwift.git", :tag => s.version.to_s } 15 | 16 | s.ios.deployment_target = '9.0' 17 | s.osx.deployment_target = '10.11' 18 | s.requires_arc = true 19 | 20 | s.source_files = "ClassWrittenInSwiftKit/Source/*.{h,m,mm}" 21 | s.public_header_files = "ClassWrittenInSwiftKit/Source/ClassWrittenInSwift.h" 22 | s.frameworks = 'Foundation' 23 | 24 | end 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 杨萧玉 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CI Status](http://img.shields.io/travis/yulingtianxia/ClassWrittenInSwift.svg?style=flat)](https://travis-ci.org/yulingtianxia/ClassWrittenInSwift) 2 | [![Version](https://img.shields.io/cocoapods/v/ClassWrittenInSwift.svg?style=flat)](http://cocoapods.org/pods/ClassWrittenInSwift) 3 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 4 | [![License](https://img.shields.io/cocoapods/l/ClassWrittenInSwift.svg?style=flat)](http://cocoapods.org/pods/ClassWrittenInSwift) 5 | [![Platform](https://img.shields.io/cocoapods/p/ClassWrittenInSwift.svg?style=flat)](http://cocoapods.org/pods/ClassWrittenInSwift) 6 | [![CocoaPods](https://img.shields.io/cocoapods/dt/ClassWrittenInSwift.svg)](http://cocoapods.org/pods/ClassWrittenInSwift) 7 | [![CocoaPods](https://img.shields.io/cocoapods/at/ClassWrittenInSwift.svg)](http://cocoapods.org/pods/ClassWrittenInSwift) 8 | [![Twitter Follow](https://img.shields.io/twitter/follow/yulingtianxia.svg?style=social&label=Follow)](https://twitter.com/yulingtianxia) 9 | 10 | # ClassWrittenInSwift 11 | Something for Class written in Swift. 12 | 13 | - [x] Check if Class is written in Swift 14 | - [x] Swift Class lazy property name. 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode10 2 | language: objective-c 3 | xcode_project: ClassWrittenInSwift 4 | xcode_scheme: ClassWrittenInSwiftKit 5 | xcode_sdk: iphoneos12.0 6 | env: 7 | global: 8 | - FRAMEWORK_NAME=ClassWrittenInSwiftKit 9 | before_install: 10 | - brew update 11 | - brew outdated carthage || brew upgrade carthage 12 | before_script: 13 | before_deploy: 14 | - carthage build --no-skip-current 15 | - carthage archive $FRAMEWORK_NAME 16 | script: xcodebuild -project ClassWrittenInSwift.xcodeproj -scheme 17 | ClassWrittenInSwift -configuration Release -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO 18 | deploy: 19 | provider: releases 20 | api_key: 21 | secure: SWnABObD3w9rL2wobaER6mpiyyP+IYc77aN+vPG48jbyH0mhhGTlGRgY6q/9i3Ui0panrq2WVmrOn08nePi4V9eTVYANdS67FWU2P01XHWq2l1/wV0yiAxvXsZggyV6S4ChgPi+2yJGeFvvX1XS9jyI1V5KZCrJCwbyVx1W0VkKu8dJSaXqHcx7StOrFsQDe/wDJwa+XKLoRRtumovKG9ptPjuAEI2sm0rqAU4wso5gRDkfRFh79iRcNvw6tcSJ0fS+YFkZ99cFNGvuKTuwydg1Tu2l+NJsuy77eohQWMyyuJul3XO3hPAPgve20rNRa/RS6LUoM8jJjI1zx5fZ6TtiKS4FRVKbDUh9Yj/PMr/FB+Jh1MYsBuH+Wing8DLHxDZxI7fjqbHIFJ2aTZ+jL3RLXB3/UsHNQ/M8i0SSNKe2rOhugpNp5ZjSYrH8aeDwYMv8y94oZp0hAObYFDx2tkf5KCFkuf7xhT2QFKp+Oo2Q71xjZWYr+zutqLgQdXi59ntvca+S38svArC/zYve17d71xPcBXJ2eDJTf8BV+8/cZKGdkq7U5o4xxrk89nseUlMegWV2iucb6jQ3bgWzHOBc3K8l/FlCYe1I/7nlKw6goOsNxF6Fu2dwbzkPp5hK4UlK3KrYX5+zuKcCUwUE7X36UArT5VEo7DBg3DdrFh3k= 22 | file: ClassWrittenInSwiftKit.framework.zip 23 | skip_cleanup: true 24 | on: 25 | repo: yulingtianxia/ClassWrittenInSwift 26 | tags: true 27 | -------------------------------------------------------------------------------- /ClassWrittenInSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /ClassWrittenInSwift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ClassWrittenInSwift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ClassWrittenInSwift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ClassWrittenInSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ClassWrittenInSwift 4 | // 5 | // Created by 杨萧玉 on 2018/10/21. 6 | // Copyright © 2018 杨萧玉. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.xcodeproj/xcshareddata/xcschemes/ClassWrittenInSwiftKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.xcodeproj/xcshareddata/xcschemes/ClassWrittenInSwift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ClassWrittenInSwiftKit/Source/ClassWrittenInSwift.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ClassWrittenInSwift.m 3 | // ClassWrittenInSwift 4 | // 5 | // Created by 杨萧玉 on 2018/10/21. 6 | // Copyright © 2018 杨萧玉. All rights reserved. 7 | // 8 | 9 | #import "ClassWrittenInSwift.h" 10 | #include 11 | #include 12 | #include 13 | 14 | #if __LP64__ 15 | typedef uint32_t mask_t; // x86_64 & arm64 asm are less efficient with 16-bits 16 | #else 17 | typedef uint16_t mask_t; 18 | #endif 19 | 20 | /* dyld_shared_cache_builder and obj-C agree on these definitions */ 21 | struct preopt_cache_entry_t { 22 | uint32_t sel_offs; 23 | uint32_t imp_offs; 24 | }; 25 | 26 | /* dyld_shared_cache_builder and obj-C agree on these definitions */ 27 | struct preopt_cache_t { 28 | int32_t fallback_class_offset; 29 | union { 30 | struct { 31 | uint16_t shift : 5; 32 | uint16_t mask : 11; 33 | }; 34 | uint16_t hash_params; 35 | }; 36 | uint16_t occupied : 14; 37 | uint16_t has_inlines : 1; 38 | uint16_t bit_one : 1; 39 | preopt_cache_entry_t entries[]; 40 | 41 | inline int capacity() const { 42 | return mask + 1; 43 | } 44 | }; 45 | 46 | // Version of std::atomic that does not allow implicit conversions 47 | // to/from the wrapped type, and requires an explicit memory order 48 | // be passed to load() and store(). 49 | template 50 | struct explicit_atomic : public std::atomic { 51 | explicit explicit_atomic(T initial) noexcept : std::atomic(std::move(initial)) {} 52 | operator T() const = delete; 53 | 54 | T load(std::memory_order order) const noexcept { 55 | return std::atomic::load(order); 56 | } 57 | void store(T desired, std::memory_order order) noexcept { 58 | std::atomic::store(desired, order); 59 | } 60 | 61 | // Convert a normal pointer to an atomic pointer. This is a 62 | // somewhat dodgy thing to do, but if the atomic type is lock 63 | // free and the same size as the non-atomic type, we know the 64 | // representations are the same, and the compiler generates good 65 | // code. 66 | static explicit_atomic *from_pointer(T *ptr) { 67 | static_assert(sizeof(explicit_atomic *) == sizeof(T *), 68 | "Size of atomic must match size of original"); 69 | explicit_atomic *atomic = (explicit_atomic *)ptr; 70 | ASSERT(atomic->is_lock_free()); 71 | return atomic; 72 | } 73 | }; 74 | 75 | struct cache_t { 76 | private: 77 | explicit_atomic _bucketsAndMaybeMask; 78 | union { 79 | struct { 80 | explicit_atomic _maybeMask; 81 | #if __LP64__ 82 | uint16_t _flags; 83 | #endif 84 | uint16_t _occupied; 85 | }; 86 | explicit_atomic _originalPreoptCache; 87 | }; 88 | 89 | #if CACHE_MASK_STORAGE == CACHE_MASK_STORAGE_OUTLINED 90 | // _bucketsAndMaybeMask is a buckets_t pointer 91 | // _maybeMask is the buckets mask 92 | 93 | static constexpr uintptr_t bucketsMask = ~0ul; 94 | #elif CACHE_MASK_STORAGE == CACHE_MASK_STORAGE_HIGH_16_BIG_ADDRS 95 | static constexpr uintptr_t maskShift = 48; 96 | static constexpr uintptr_t maxMask = ((uintptr_t)1 << (64 - maskShift)) - 1; 97 | static constexpr uintptr_t bucketsMask = ((uintptr_t)1 << maskShift) - 1; 98 | 99 | static_assert(bucketsMask >= MACH_VM_MAX_ADDRESS, "Bucket field doesn't have enough bits for arbitrary pointers."); 100 | #if CONFIG_USE_PREOPT_CACHES 101 | static constexpr uintptr_t preoptBucketsMarker = 1ul; 102 | static constexpr uintptr_t preoptBucketsMask = bucketsMask & ~preoptBucketsMarker; 103 | #endif 104 | #elif CACHE_MASK_STORAGE == CACHE_MASK_STORAGE_HIGH_16 105 | // _bucketsAndMaybeMask is a buckets_t pointer in the low 48 bits 106 | // _maybeMask is unused, the mask is stored in the top 16 bits. 107 | 108 | // How much the mask is shifted by. 109 | static constexpr uintptr_t maskShift = 48; 110 | 111 | // Additional bits after the mask which must be zero. msgSend 112 | // takes advantage of these additional bits to construct the value 113 | // `mask << 4` from `_maskAndBuckets` in a single instruction. 114 | static constexpr uintptr_t maskZeroBits = 4; 115 | 116 | // The largest mask value we can store. 117 | static constexpr uintptr_t maxMask = ((uintptr_t)1 << (64 - maskShift)) - 1; 118 | 119 | // The mask applied to `_maskAndBuckets` to retrieve the buckets pointer. 120 | static constexpr uintptr_t bucketsMask = ((uintptr_t)1 << (maskShift - maskZeroBits)) - 1; 121 | 122 | // Ensure we have enough bits for the buckets pointer. 123 | static_assert(bucketsMask >= MACH_VM_MAX_ADDRESS, 124 | "Bucket field doesn't have enough bits for arbitrary pointers."); 125 | 126 | #if CONFIG_USE_PREOPT_CACHES 127 | static constexpr uintptr_t preoptBucketsMarker = 1ul; 128 | #if __has_feature(ptrauth_calls) 129 | // 63..60: hash_mask_shift 130 | // 59..55: hash_shift 131 | // 54.. 1: buckets ptr + auth 132 | // 0: always 1 133 | static constexpr uintptr_t preoptBucketsMask = 0x007ffffffffffffe; 134 | static inline uintptr_t preoptBucketsHashParams(const preopt_cache_t *cache) { 135 | uintptr_t value = (uintptr_t)cache->shift << 55; 136 | // masks have 11 bits but can be 0, so we compute 137 | // the right shift for 0x7fff rather than 0xffff 138 | return value | ((objc::mask16ShiftBits(cache->mask) - 1) << 60); 139 | } 140 | #else 141 | // 63..53: hash_mask 142 | // 52..48: hash_shift 143 | // 47.. 1: buckets ptr 144 | // 0: always 1 145 | static constexpr uintptr_t preoptBucketsMask = 0x0000fffffffffffe; 146 | static inline uintptr_t preoptBucketsHashParams(const preopt_cache_t *cache) { 147 | return (uintptr_t)cache->hash_params << 48; 148 | } 149 | #endif 150 | #endif // CONFIG_USE_PREOPT_CACHES 151 | #elif CACHE_MASK_STORAGE == CACHE_MASK_STORAGE_LOW_4 152 | // _bucketsAndMaybeMask is a buckets_t pointer in the top 28 bits 153 | // _maybeMask is unused, the mask length is stored in the low 4 bits 154 | 155 | static constexpr uintptr_t maskBits = 4; 156 | static constexpr uintptr_t maskMask = (1 << maskBits) - 1; 157 | static constexpr uintptr_t bucketsMask = ~maskMask; 158 | static_assert(!CONFIG_USE_PREOPT_CACHES, "preoptimized caches not supported"); 159 | #else 160 | #error Unknown cache mask storage type. 161 | #endif 162 | }; 163 | 164 | // class is a Swift class from the pre-stable Swift ABI 165 | #define FAST_IS_SWIFT_LEGACY (1UL<<0) 166 | // class is a Swift class from the stable Swift ABI 167 | #define FAST_IS_SWIFT_STABLE (1UL<<1) 168 | 169 | struct class_data_bits_t { 170 | // Values are the FAST_ flags above. 171 | uintptr_t bits; 172 | bool getBit(uintptr_t bit) { 173 | return bits & bit; 174 | } 175 | 176 | bool isAnySwift() { 177 | return isSwiftStable() || isSwiftLegacy(); 178 | } 179 | 180 | bool isSwiftStable() { 181 | return getBit(FAST_IS_SWIFT_STABLE); 182 | } 183 | 184 | bool isSwiftLegacy() { 185 | return getBit(FAST_IS_SWIFT_LEGACY); 186 | } 187 | }; 188 | 189 | struct yxy_objc_class : objc_object { 190 | // Class ISA; 191 | Class superclass; 192 | cache_t cache; // formerly cache pointer and vtable 193 | class_data_bits_t bits; // class_rw_t * plus custom rr/alloc flags 194 | }; 195 | 196 | BOOL isWrittenInSwift(Class cls) { 197 | if (!cls || !object_isClass(cls)) { 198 | return NO; 199 | } 200 | struct yxy_objc_class *objc_cls = (__bridge struct yxy_objc_class *)cls; 201 | bool isSwift = objc_cls->bits.isAnySwift(); 202 | return isSwift; 203 | } 204 | 205 | @implementation ClassWrittenInSwift 206 | 207 | + (BOOL)isSwiftClass:(Class)cls { 208 | return isWrittenInSwift(cls); 209 | } 210 | 211 | + (NSArray *)lazyPropertyNamesOfSwiftClass:(Class)cls { 212 | if (!cls || !object_isClass(cls)) { 213 | return nil; 214 | } 215 | unsigned int numIvars = 0; 216 | NSString *key=nil; 217 | Ivar *ivars = class_copyIvarList(cls, &numIvars); 218 | NSMutableArray *result = [NSMutableArray array]; 219 | for(int i = 0; i < numIvars; i ++) { 220 | Ivar thisIvar = ivars[i]; 221 | key = [NSString stringWithUTF8String:ivar_getName(thisIvar)]; 222 | if ([key hasSuffix:@".storage"]) { 223 | [result addObject:[key componentsSeparatedByString:@"."].firstObject]; 224 | } 225 | if ([key hasPrefix:@"$__lazy_storage_$_"]) { 226 | [result addObject:[key substringFromIndex:18]]; 227 | } 228 | } 229 | free(ivars); 230 | return [result copy]; 231 | } 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /ClassWrittenInSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A4CFC355217C88DD00CF8863 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4CFC354217C88DD00CF8863 /* AppDelegate.swift */; }; 11 | A4CFC357217C88DD00CF8863 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4CFC356217C88DD00CF8863 /* ViewController.swift */; }; 12 | A4CFC35A217C88DD00CF8863 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A4CFC358217C88DD00CF8863 /* Main.storyboard */; }; 13 | A4CFC35C217C88E000CF8863 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A4CFC35B217C88E000CF8863 /* Assets.xcassets */; }; 14 | A4CFC35F217C88E000CF8863 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A4CFC35D217C88E000CF8863 /* LaunchScreen.storyboard */; }; 15 | A4CFC37B217CA58200CF8863 /* ClassWrittenInSwiftKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A4CFC379217CA58200CF8863 /* ClassWrittenInSwiftKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | A4CFC37E217CA58200CF8863 /* ClassWrittenInSwiftKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4CFC377217CA58200CF8863 /* ClassWrittenInSwiftKit.framework */; }; 17 | A4CFC37F217CA58200CF8863 /* ClassWrittenInSwiftKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A4CFC377217CA58200CF8863 /* ClassWrittenInSwiftKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | A4CFC384217CA5A700CF8863 /* ClassWrittenInSwift.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4CFC36C217C99BC00CF8863 /* ClassWrittenInSwift.mm */; }; 19 | A4CFC385217CAE1700CF8863 /* ClassWrittenInSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = A4CFC36B217C99BC00CF8863 /* ClassWrittenInSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | A4CFC37C217CA58200CF8863 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = A4CFC349217C88DD00CF8863 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = A4CFC376217CA58200CF8863; 28 | remoteInfo = ClassWrittenInSwiftKit; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXCopyFilesBuildPhase section */ 33 | A4CFC383217CA58200CF8863 /* Embed Frameworks */ = { 34 | isa = PBXCopyFilesBuildPhase; 35 | buildActionMask = 2147483647; 36 | dstPath = ""; 37 | dstSubfolderSpec = 10; 38 | files = ( 39 | A4CFC37F217CA58200CF8863 /* ClassWrittenInSwiftKit.framework in Embed Frameworks */, 40 | ); 41 | name = "Embed Frameworks"; 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXCopyFilesBuildPhase section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | A4CFC351217C88DD00CF8863 /* ClassWrittenInSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClassWrittenInSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | A4CFC354217C88DD00CF8863 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 49 | A4CFC356217C88DD00CF8863 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 50 | A4CFC359217C88DD00CF8863 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | A4CFC35B217C88E000CF8863 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | A4CFC35E217C88E000CF8863 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | A4CFC360217C88E000CF8863 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | A4CFC36B217C99BC00CF8863 /* ClassWrittenInSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClassWrittenInSwift.h; sourceTree = ""; }; 55 | A4CFC36C217C99BC00CF8863 /* ClassWrittenInSwift.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ClassWrittenInSwift.mm; sourceTree = ""; }; 56 | A4CFC36E217C9B5D00CF8863 /* ClassWrittenInSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ClassWrittenInSwift-Bridging-Header.h"; sourceTree = ""; }; 57 | A4CFC377217CA58200CF8863 /* ClassWrittenInSwiftKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ClassWrittenInSwiftKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | A4CFC379217CA58200CF8863 /* ClassWrittenInSwiftKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClassWrittenInSwiftKit.h; sourceTree = ""; }; 59 | A4CFC37A217CA58200CF8863 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | A4CFC34E217C88DD00CF8863 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | A4CFC37E217CA58200CF8863 /* ClassWrittenInSwiftKit.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | A4CFC374217CA58200CF8863 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | A4CFC348217C88DD00CF8863 = { 82 | isa = PBXGroup; 83 | children = ( 84 | A4CFC353217C88DD00CF8863 /* ClassWrittenInSwift */, 85 | A4CFC378217CA58200CF8863 /* ClassWrittenInSwiftKit */, 86 | A4CFC352217C88DD00CF8863 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | A4CFC352217C88DD00CF8863 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | A4CFC351217C88DD00CF8863 /* ClassWrittenInSwift.app */, 94 | A4CFC377217CA58200CF8863 /* ClassWrittenInSwiftKit.framework */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | A4CFC353217C88DD00CF8863 /* ClassWrittenInSwift */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | A4CFC354217C88DD00CF8863 /* AppDelegate.swift */, 103 | A4CFC356217C88DD00CF8863 /* ViewController.swift */, 104 | A4CFC358217C88DD00CF8863 /* Main.storyboard */, 105 | A4CFC35B217C88E000CF8863 /* Assets.xcassets */, 106 | A4CFC36E217C9B5D00CF8863 /* ClassWrittenInSwift-Bridging-Header.h */, 107 | A4CFC35D217C88E000CF8863 /* LaunchScreen.storyboard */, 108 | A4CFC360217C88E000CF8863 /* Info.plist */, 109 | ); 110 | path = ClassWrittenInSwift; 111 | sourceTree = ""; 112 | }; 113 | A4CFC366217C95A000CF8863 /* Source */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | A4CFC36B217C99BC00CF8863 /* ClassWrittenInSwift.h */, 117 | A4CFC36C217C99BC00CF8863 /* ClassWrittenInSwift.mm */, 118 | ); 119 | path = Source; 120 | sourceTree = ""; 121 | }; 122 | A4CFC378217CA58200CF8863 /* ClassWrittenInSwiftKit */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | A4CFC366217C95A000CF8863 /* Source */, 126 | A4CFC379217CA58200CF8863 /* ClassWrittenInSwiftKit.h */, 127 | A4CFC37A217CA58200CF8863 /* Info.plist */, 128 | ); 129 | path = ClassWrittenInSwiftKit; 130 | sourceTree = ""; 131 | }; 132 | /* End PBXGroup section */ 133 | 134 | /* Begin PBXHeadersBuildPhase section */ 135 | A4CFC372217CA58200CF8863 /* Headers */ = { 136 | isa = PBXHeadersBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | A4CFC385217CAE1700CF8863 /* ClassWrittenInSwift.h in Headers */, 140 | A4CFC37B217CA58200CF8863 /* ClassWrittenInSwiftKit.h in Headers */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXHeadersBuildPhase section */ 145 | 146 | /* Begin PBXNativeTarget section */ 147 | A4CFC350217C88DD00CF8863 /* ClassWrittenInSwift */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = A4CFC363217C88E000CF8863 /* Build configuration list for PBXNativeTarget "ClassWrittenInSwift" */; 150 | buildPhases = ( 151 | A4CFC34D217C88DD00CF8863 /* Sources */, 152 | A4CFC34E217C88DD00CF8863 /* Frameworks */, 153 | A4CFC34F217C88DD00CF8863 /* Resources */, 154 | A4CFC383217CA58200CF8863 /* Embed Frameworks */, 155 | ); 156 | buildRules = ( 157 | ); 158 | dependencies = ( 159 | A4CFC37D217CA58200CF8863 /* PBXTargetDependency */, 160 | ); 161 | name = ClassWrittenInSwift; 162 | productName = ClassWrittenInSwift; 163 | productReference = A4CFC351217C88DD00CF8863 /* ClassWrittenInSwift.app */; 164 | productType = "com.apple.product-type.application"; 165 | }; 166 | A4CFC376217CA58200CF8863 /* ClassWrittenInSwiftKit */ = { 167 | isa = PBXNativeTarget; 168 | buildConfigurationList = A4CFC380217CA58200CF8863 /* Build configuration list for PBXNativeTarget "ClassWrittenInSwiftKit" */; 169 | buildPhases = ( 170 | A4CFC372217CA58200CF8863 /* Headers */, 171 | A4CFC373217CA58200CF8863 /* Sources */, 172 | A4CFC374217CA58200CF8863 /* Frameworks */, 173 | A4CFC375217CA58200CF8863 /* Resources */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = ClassWrittenInSwiftKit; 180 | productName = ClassWrittenInSwiftKit; 181 | productReference = A4CFC377217CA58200CF8863 /* ClassWrittenInSwiftKit.framework */; 182 | productType = "com.apple.product-type.framework"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | A4CFC349217C88DD00CF8863 /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastSwiftUpdateCheck = 1010; 191 | LastUpgradeCheck = 1320; 192 | ORGANIZATIONNAME = "杨萧玉"; 193 | TargetAttributes = { 194 | A4CFC350217C88DD00CF8863 = { 195 | CreatedOnToolsVersion = 10.1; 196 | LastSwiftMigration = 1320; 197 | }; 198 | A4CFC376217CA58200CF8863 = { 199 | CreatedOnToolsVersion = 10.1; 200 | }; 201 | }; 202 | }; 203 | buildConfigurationList = A4CFC34C217C88DD00CF8863 /* Build configuration list for PBXProject "ClassWrittenInSwift" */; 204 | compatibilityVersion = "Xcode 9.3"; 205 | developmentRegion = en; 206 | hasScannedForEncodings = 0; 207 | knownRegions = ( 208 | en, 209 | Base, 210 | ); 211 | mainGroup = A4CFC348217C88DD00CF8863; 212 | productRefGroup = A4CFC352217C88DD00CF8863 /* Products */; 213 | projectDirPath = ""; 214 | projectRoot = ""; 215 | targets = ( 216 | A4CFC350217C88DD00CF8863 /* ClassWrittenInSwift */, 217 | A4CFC376217CA58200CF8863 /* ClassWrittenInSwiftKit */, 218 | ); 219 | }; 220 | /* End PBXProject section */ 221 | 222 | /* Begin PBXResourcesBuildPhase section */ 223 | A4CFC34F217C88DD00CF8863 /* Resources */ = { 224 | isa = PBXResourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | A4CFC35F217C88E000CF8863 /* LaunchScreen.storyboard in Resources */, 228 | A4CFC35C217C88E000CF8863 /* Assets.xcassets in Resources */, 229 | A4CFC35A217C88DD00CF8863 /* Main.storyboard in Resources */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | A4CFC375217CA58200CF8863 /* Resources */ = { 234 | isa = PBXResourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | /* End PBXResourcesBuildPhase section */ 241 | 242 | /* Begin PBXSourcesBuildPhase section */ 243 | A4CFC34D217C88DD00CF8863 /* Sources */ = { 244 | isa = PBXSourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | A4CFC357217C88DD00CF8863 /* ViewController.swift in Sources */, 248 | A4CFC355217C88DD00CF8863 /* AppDelegate.swift in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | A4CFC373217CA58200CF8863 /* Sources */ = { 253 | isa = PBXSourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | A4CFC384217CA5A700CF8863 /* ClassWrittenInSwift.mm in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXSourcesBuildPhase section */ 261 | 262 | /* Begin PBXTargetDependency section */ 263 | A4CFC37D217CA58200CF8863 /* PBXTargetDependency */ = { 264 | isa = PBXTargetDependency; 265 | target = A4CFC376217CA58200CF8863 /* ClassWrittenInSwiftKit */; 266 | targetProxy = A4CFC37C217CA58200CF8863 /* PBXContainerItemProxy */; 267 | }; 268 | /* End PBXTargetDependency section */ 269 | 270 | /* Begin PBXVariantGroup section */ 271 | A4CFC358217C88DD00CF8863 /* Main.storyboard */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | A4CFC359217C88DD00CF8863 /* Base */, 275 | ); 276 | name = Main.storyboard; 277 | sourceTree = ""; 278 | }; 279 | A4CFC35D217C88E000CF8863 /* LaunchScreen.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | A4CFC35E217C88E000CF8863 /* Base */, 283 | ); 284 | name = LaunchScreen.storyboard; 285 | sourceTree = ""; 286 | }; 287 | /* End PBXVariantGroup section */ 288 | 289 | /* Begin XCBuildConfiguration section */ 290 | A4CFC361217C88E000CF8863 /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_ANALYZER_NONNULL = YES; 295 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 296 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 297 | CLANG_CXX_LIBRARY = "libc++"; 298 | CLANG_ENABLE_MODULES = YES; 299 | CLANG_ENABLE_OBJC_ARC = YES; 300 | CLANG_ENABLE_OBJC_WEAK = YES; 301 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 302 | CLANG_WARN_BOOL_CONVERSION = YES; 303 | CLANG_WARN_COMMA = YES; 304 | CLANG_WARN_CONSTANT_CONVERSION = YES; 305 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 308 | CLANG_WARN_EMPTY_BODY = YES; 309 | CLANG_WARN_ENUM_CONVERSION = YES; 310 | CLANG_WARN_INFINITE_RECURSION = YES; 311 | CLANG_WARN_INT_CONVERSION = YES; 312 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 313 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 314 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 315 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 316 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 317 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 318 | CLANG_WARN_STRICT_PROTOTYPES = YES; 319 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 320 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 321 | CLANG_WARN_UNREACHABLE_CODE = YES; 322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 323 | CODE_SIGN_IDENTITY = "iPhone Developer"; 324 | COPY_PHASE_STRIP = NO; 325 | DEBUG_INFORMATION_FORMAT = dwarf; 326 | ENABLE_STRICT_OBJC_MSGSEND = YES; 327 | ENABLE_TESTABILITY = YES; 328 | GCC_C_LANGUAGE_STANDARD = gnu11; 329 | GCC_DYNAMIC_NO_PIC = NO; 330 | GCC_NO_COMMON_BLOCKS = YES; 331 | GCC_OPTIMIZATION_LEVEL = 0; 332 | GCC_PREPROCESSOR_DEFINITIONS = ( 333 | "DEBUG=1", 334 | "$(inherited)", 335 | ); 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 343 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 344 | MTL_FAST_MATH = YES; 345 | ONLY_ACTIVE_ARCH = YES; 346 | SDKROOT = iphoneos; 347 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 348 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 349 | }; 350 | name = Debug; 351 | }; 352 | A4CFC362217C88E000CF8863 /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_ANALYZER_NONNULL = YES; 357 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 358 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 359 | CLANG_CXX_LIBRARY = "libc++"; 360 | CLANG_ENABLE_MODULES = YES; 361 | CLANG_ENABLE_OBJC_ARC = YES; 362 | CLANG_ENABLE_OBJC_WEAK = YES; 363 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_COMMA = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 368 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 369 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 370 | CLANG_WARN_EMPTY_BODY = YES; 371 | CLANG_WARN_ENUM_CONVERSION = YES; 372 | CLANG_WARN_INFINITE_RECURSION = YES; 373 | CLANG_WARN_INT_CONVERSION = YES; 374 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 375 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 376 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 378 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 379 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 380 | CLANG_WARN_STRICT_PROTOTYPES = YES; 381 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 382 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | CODE_SIGN_IDENTITY = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu11; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | MTL_FAST_MATH = YES; 401 | SDKROOT = iphoneos; 402 | SWIFT_COMPILATION_MODE = wholemodule; 403 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | A4CFC364217C88E000CF8863 /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 412 | CLANG_ENABLE_MODULES = YES; 413 | CODE_SIGN_STYLE = Automatic; 414 | DEVELOPMENT_TEAM = D3RCVUP6VH; 415 | INFOPLIST_FILE = ClassWrittenInSwift/Info.plist; 416 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 417 | LD_RUNPATH_SEARCH_PATHS = ( 418 | "$(inherited)", 419 | "@executable_path/Frameworks", 420 | ); 421 | PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.ClassWrittenInSwift; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_OBJC_BRIDGING_HEADER = "ClassWrittenInSwift/ClassWrittenInSwift-Bridging-Header.h"; 424 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 425 | SWIFT_VERSION = 5.0; 426 | TARGETED_DEVICE_FAMILY = "1,2"; 427 | }; 428 | name = Debug; 429 | }; 430 | A4CFC365217C88E000CF8863 /* Release */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | CLANG_ENABLE_MODULES = YES; 435 | CODE_SIGN_STYLE = Automatic; 436 | DEVELOPMENT_TEAM = D3RCVUP6VH; 437 | INFOPLIST_FILE = ClassWrittenInSwift/Info.plist; 438 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 439 | LD_RUNPATH_SEARCH_PATHS = ( 440 | "$(inherited)", 441 | "@executable_path/Frameworks", 442 | ); 443 | PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.ClassWrittenInSwift; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | SWIFT_OBJC_BRIDGING_HEADER = "ClassWrittenInSwift/ClassWrittenInSwift-Bridging-Header.h"; 446 | SWIFT_VERSION = 5.0; 447 | TARGETED_DEVICE_FAMILY = "1,2"; 448 | }; 449 | name = Release; 450 | }; 451 | A4CFC381217CA58200CF8863 /* Debug */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | CODE_SIGN_IDENTITY = ""; 455 | CODE_SIGN_STYLE = Automatic; 456 | CURRENT_PROJECT_VERSION = 1; 457 | DEFINES_MODULE = YES; 458 | DEVELOPMENT_TEAM = D3RCVUP6VH; 459 | DYLIB_COMPATIBILITY_VERSION = 1; 460 | DYLIB_CURRENT_VERSION = 1; 461 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 462 | INFOPLIST_FILE = ClassWrittenInSwiftKit/Info.plist; 463 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 464 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 465 | LD_RUNPATH_SEARCH_PATHS = ( 466 | "$(inherited)", 467 | "@executable_path/Frameworks", 468 | "@loader_path/Frameworks", 469 | ); 470 | PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.ClassWrittenInSwiftKit; 471 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 472 | SKIP_INSTALL = YES; 473 | TARGETED_DEVICE_FAMILY = "1,2"; 474 | VERSIONING_SYSTEM = "apple-generic"; 475 | VERSION_INFO_PREFIX = ""; 476 | }; 477 | name = Debug; 478 | }; 479 | A4CFC382217CA58200CF8863 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | CODE_SIGN_IDENTITY = ""; 483 | CODE_SIGN_STYLE = Automatic; 484 | CURRENT_PROJECT_VERSION = 1; 485 | DEFINES_MODULE = YES; 486 | DEVELOPMENT_TEAM = D3RCVUP6VH; 487 | DYLIB_COMPATIBILITY_VERSION = 1; 488 | DYLIB_CURRENT_VERSION = 1; 489 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 490 | INFOPLIST_FILE = ClassWrittenInSwiftKit/Info.plist; 491 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 492 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 493 | LD_RUNPATH_SEARCH_PATHS = ( 494 | "$(inherited)", 495 | "@executable_path/Frameworks", 496 | "@loader_path/Frameworks", 497 | ); 498 | PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.ClassWrittenInSwiftKit; 499 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 500 | SKIP_INSTALL = YES; 501 | TARGETED_DEVICE_FAMILY = "1,2"; 502 | VERSIONING_SYSTEM = "apple-generic"; 503 | VERSION_INFO_PREFIX = ""; 504 | }; 505 | name = Release; 506 | }; 507 | /* End XCBuildConfiguration section */ 508 | 509 | /* Begin XCConfigurationList section */ 510 | A4CFC34C217C88DD00CF8863 /* Build configuration list for PBXProject "ClassWrittenInSwift" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | A4CFC361217C88E000CF8863 /* Debug */, 514 | A4CFC362217C88E000CF8863 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | A4CFC363217C88E000CF8863 /* Build configuration list for PBXNativeTarget "ClassWrittenInSwift" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | A4CFC364217C88E000CF8863 /* Debug */, 523 | A4CFC365217C88E000CF8863 /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | A4CFC380217CA58200CF8863 /* Build configuration list for PBXNativeTarget "ClassWrittenInSwiftKit" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | A4CFC381217CA58200CF8863 /* Debug */, 532 | A4CFC382217CA58200CF8863 /* Release */, 533 | ); 534 | defaultConfigurationIsVisible = 0; 535 | defaultConfigurationName = Release; 536 | }; 537 | /* End XCConfigurationList section */ 538 | }; 539 | rootObject = A4CFC349217C88DD00CF8863 /* Project object */; 540 | } 541 | --------------------------------------------------------------------------------