diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/Contents.json b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..63acba97d --- /dev/null +++ b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,62 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon_20pt@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon_20pt@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon_29pt@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon_29pt@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon_40pt@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon_40pt@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon_60pt@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon_60pt@3x.png", + "scale" : "3x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "icon_83.5@2x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@2x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@2x.png new file mode 100644 index 000000000..aa46fa5e1 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@2x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@3x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@3x.png new file mode 100644 index 000000000..66792a48b Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_20pt@3x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@2x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@2x.png new file mode 100644 index 000000000..e1d4098ef Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@2x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@3x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@3x.png new file mode 100644 index 000000000..d84536f44 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_29pt@3x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@2x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@2x.png new file mode 100644 index 000000000..063ff984a Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@2x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@3x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@3x.png new file mode 100644 index 000000000..3c26d5db6 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_40pt@3x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@2x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@2x.png new file mode 100644 index 000000000..3c26d5db6 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@2x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@3x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@3x.png new file mode 100644 index 000000000..e4c7ae242 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_60pt@3x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_83.5@2x.png b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_83.5@2x.png new file mode 100644 index 000000000..c96d51700 Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/AppIcon.appiconset/icon_83.5@2x.png differ diff --git a/iOS/SampleSwift/Icons.xcassets/Contents.json b/iOS/SampleSwift/Icons.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/iOS/SampleSwift/Icons.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/Contents.json b/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/Contents.json new file mode 100644 index 000000000..d313dccc5 --- /dev/null +++ b/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "sonarpattern.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/sonarpattern.png b/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/sonarpattern.png new file mode 100644 index 000000000..12283761d Binary files /dev/null and b/iOS/SampleSwift/Icons.xcassets/sonarpattern.imageset/sonarpattern.png differ diff --git a/iOS/SampleSwift/Podfile b/iOS/SampleSwift/Podfile new file mode 100644 index 000000000..0207d0bcc --- /dev/null +++ b/iOS/SampleSwift/Podfile @@ -0,0 +1,22 @@ +project 'SampleSwift.xcodeproj' +source 'https://github.com/facebook/Sonar.git' +source 'https://github.com/CocoaPods/Specs' +swift_version = "4.1" + +target 'SampleSwift' do + pod 'SonarKit', '~> 0.6' + # Layout and network plugins are not yet supported for swift projects + # pod 'SonarKit/SonarKitLayoutComponentKitSupport', '~> 0.0.2' + # pod 'SonarKit/SKIOSNetworkPlugin', '~> 0.0.2' + + post_install do |installer| + installer.pods_project.targets.each do |target| + if ['YogaKit'].include? target.name + target.build_configurations.each do |config| + config.build_settings['SWIFT_VERSION'] = swift_version + end + end + end + end + +end diff --git a/iOS/SampleSwift/README.md b/iOS/SampleSwift/README.md new file mode 100644 index 000000000..d7d4d4278 --- /dev/null +++ b/iOS/SampleSwift/README.md @@ -0,0 +1,11 @@ +# SampleSwift +SampleSwift is a sample iOS app project demonstrating the use of Sonar in a Swift app. + +## Building +Make sure to install pods: + +``` +pod install +``` + +Then, `open SampleSwift.xcworkspace` and run the project. diff --git a/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj b/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj new file mode 100644 index 000000000..82cc83eb3 --- /dev/null +++ b/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj @@ -0,0 +1,409 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 076C8BE348B2F2F251103C6F /* libPods-SampleSwift.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 116D6234DE1F7298C4C2836E /* libPods-SampleSwift.a */; }; + A19C402720E20023004BF1F7 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A19C402620E20023004BF1F7 /* Icons.xcassets */; }; + A1EC522D20DED61B007C6977 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1EC522C20DED61B007C6977 /* AppDelegate.swift */; }; + A1EC522F20DED61B007C6977 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1EC522E20DED61B007C6977 /* ViewController.swift */; }; + A1EC523720DED61C007C6977 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1EC523520DED61C007C6977 /* LaunchScreen.storyboard */; }; + A1EC523F20DEDC00007C6977 /* MainStoryBoard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1EC523E20DEDC00007C6977 /* MainStoryBoard.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 116D6234DE1F7298C4C2836E /* libPods-SampleSwift.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SampleSwift.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 37AC1E08B3D4DC8183172E21 /* Pods-SampleSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleSwift/Pods-SampleSwift.debug.xcconfig"; sourceTree = ""; }; + A19C402620E20023004BF1F7 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = SOURCE_ROOT; }; + A1EC522920DED61B007C6977 /* SampleSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A1EC522C20DED61B007C6977 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A1EC522E20DED61B007C6977 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A1EC523620DED61C007C6977 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A1EC523820DED61C007C6977 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A1EC523E20DEDC00007C6977 /* MainStoryBoard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryBoard.storyboard; sourceTree = ""; }; + B4D379232B75ED516DAC4010 /* Pods-SampleSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleSwift/Pods-SampleSwift.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A1EC522620DED61B007C6977 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 076C8BE348B2F2F251103C6F /* libPods-SampleSwift.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3AAFD4FB7381DCF64BCC28F8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 116D6234DE1F7298C4C2836E /* libPods-SampleSwift.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 86D600B594F09E018D741296 /* Pods */ = { + isa = PBXGroup; + children = ( + 37AC1E08B3D4DC8183172E21 /* Pods-SampleSwift.debug.xcconfig */, + B4D379232B75ED516DAC4010 /* Pods-SampleSwift.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + A1EC522020DED61B007C6977 = { + isa = PBXGroup; + children = ( + A1EC522B20DED61B007C6977 /* SampleSwift */, + A1EC522A20DED61B007C6977 /* Products */, + 86D600B594F09E018D741296 /* Pods */, + 3AAFD4FB7381DCF64BCC28F8 /* Frameworks */, + ); + sourceTree = ""; + }; + A1EC522A20DED61B007C6977 /* Products */ = { + isa = PBXGroup; + children = ( + A1EC522920DED61B007C6977 /* SampleSwift.app */, + ); + name = Products; + sourceTree = ""; + }; + A1EC522B20DED61B007C6977 /* SampleSwift */ = { + isa = PBXGroup; + children = ( + A19C402620E20023004BF1F7 /* Icons.xcassets */, + A1EC523E20DEDC00007C6977 /* MainStoryBoard.storyboard */, + A1EC522C20DED61B007C6977 /* AppDelegate.swift */, + A1EC522E20DED61B007C6977 /* ViewController.swift */, + A1EC523520DED61C007C6977 /* LaunchScreen.storyboard */, + A1EC523820DED61C007C6977 /* Info.plist */, + ); + path = SampleSwift; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A1EC522820DED61B007C6977 /* SampleSwift */ = { + isa = PBXNativeTarget; + buildConfigurationList = A1EC523B20DED61C007C6977 /* Build configuration list for PBXNativeTarget "SampleSwift" */; + buildPhases = ( + EC305E9596C92E7DA323DDC1 /* [CP] Check Pods Manifest.lock */, + A1EC522520DED61B007C6977 /* Sources */, + A1EC522620DED61B007C6977 /* Frameworks */, + A1EC522720DED61B007C6977 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SampleSwift; + productName = SampleSwift; + productReference = A1EC522920DED61B007C6977 /* SampleSwift.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A1EC522120DED61B007C6977 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Noah Gilmore"; + TargetAttributes = { + A1EC522820DED61B007C6977 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = A1EC522420DED61B007C6977 /* Build configuration list for PBXProject "SampleSwift" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A1EC522020DED61B007C6977; + productRefGroup = A1EC522A20DED61B007C6977 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A1EC522820DED61B007C6977 /* SampleSwift */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A1EC522720DED61B007C6977 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A1EC523720DED61C007C6977 /* LaunchScreen.storyboard in Resources */, + A1EC523F20DEDC00007C6977 /* MainStoryBoard.storyboard in Resources */, + A19C402720E20023004BF1F7 /* Icons.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + EC305E9596C92E7DA323DDC1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SampleSwift-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A1EC522520DED61B007C6977 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A1EC522F20DED61B007C6977 /* ViewController.swift in Sources */, + A1EC522D20DED61B007C6977 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A1EC523520DED61C007C6977 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A1EC523620DED61C007C6977 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A1EC523920DED61C007C6977 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A1EC523A20DED61C007C6977 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A1EC523C20DED61C007C6977 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37AC1E08B3D4DC8183172E21 /* Pods-SampleSwift.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"", + "\"${PODS_ROOT}/Headers/Public/CocoaLibEvent\"", + "\"${PODS_ROOT}/Headers/Public/ComponentKit\"", + "\"${PODS_ROOT}/Headers/Public/DoubleConversion\"", + "\"${PODS_ROOT}/Headers/Public/Folly\"", + "\"${PODS_ROOT}/Headers/Public/OpenSSL-Static\"", + "\"${PODS_ROOT}/Headers/Public/PeerTalk\"", + "\"${PODS_ROOT}/Headers/Public/RSocket\"", + "\"${PODS_ROOT}/Headers/Public/Sonar\"", + "\"${PODS_ROOT}/Headers/Public/SonarKit\"/**", + "\"${PODS_ROOT}/Headers/Public/Yoga\"", + "\"${PODS_ROOT}/Headers/Public/glog\"", + ); + INFOPLIST_FILE = SampleSwift/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sonar.SampleSwift; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A1EC523D20DED61C007C6977 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4D379232B75ED516DAC4010 /* Pods-SampleSwift.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"", + "\"${PODS_ROOT}/Headers/Public/CocoaLibEvent\"", + "\"${PODS_ROOT}/Headers/Public/ComponentKit\"", + "\"${PODS_ROOT}/Headers/Public/DoubleConversion\"", + "\"${PODS_ROOT}/Headers/Public/Folly\"", + "\"${PODS_ROOT}/Headers/Public/OpenSSL-Static\"", + "\"${PODS_ROOT}/Headers/Public/PeerTalk\"", + "\"${PODS_ROOT}/Headers/Public/RSocket\"", + "\"${PODS_ROOT}/Headers/Public/Sonar\"", + "\"${PODS_ROOT}/Headers/Public/SonarKit\"/**", + "\"${PODS_ROOT}/Headers/Public/Yoga\"", + "\"${PODS_ROOT}/Headers/Public/glog\"", + ); + INFOPLIST_FILE = SampleSwift/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sonar.SampleSwift; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A1EC522420DED61B007C6977 /* Build configuration list for PBXProject "SampleSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A1EC523920DED61C007C6977 /* Debug */, + A1EC523A20DED61C007C6977 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A1EC523B20DED61C007C6977 /* Build configuration list for PBXNativeTarget "SampleSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A1EC523C20DED61C007C6977 /* Debug */, + A1EC523D20DED61C007C6977 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A1EC522120DED61B007C6977 /* Project object */; +} diff --git a/iOS/SampleSwift/SampleSwift/AppDelegate.swift b/iOS/SampleSwift/SampleSwift/AppDelegate.swift new file mode 100644 index 000000000..0d3395a5f --- /dev/null +++ b/iOS/SampleSwift/SampleSwift/AppDelegate.swift @@ -0,0 +1,62 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +import UIKit +import SonarKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + window = UIWindow() + + let client = SonarClient.shared() + // Layout and network plugins are currently not supported for Swift apps. +// let layoutDescriptorMapper = SKDescriptorMapper(defaults: ()) +// SonarKitLayoutComponentKitSupport.setUp(descriptorMapper: layoutDescriptorMapper) +// client.addPlugin(SonarKitLayoutPlugin(rootNode: application, descriptorMapper: layoutDescriptorMapper)) +// client.addPlugin(SonarKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter())) + client?.start() + + let storyboard = UIStoryboard(name: "MainStoryBoard", bundle: nil) + let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController") + let navigationController = UINavigationController(rootViewController: mainViewController) + + navigationController.navigationBar.topItem?.title = "SampleSwift"; + navigationController.navigationBar.isTranslucent = false; + + window?.rootViewController = navigationController + window?.makeKeyAndVisible() + + // Use NSLog since Sonar doesn't capture print() by default + NSLog("Hello from Sonar in a Swift app!") + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // 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. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} diff --git a/iOS/SampleSwift/SampleSwift/Base.lproj/LaunchScreen.storyboard b/iOS/SampleSwift/SampleSwift/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f83f6fd58 --- /dev/null +++ b/iOS/SampleSwift/SampleSwift/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/SampleSwift/SampleSwift/Info.plist b/iOS/SampleSwift/SampleSwift/Info.plist new file mode 100644 index 000000000..4222ac2dd --- /dev/null +++ b/iOS/SampleSwift/SampleSwift/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iOS/SampleSwift/SampleSwift/MainStoryBoard.storyboard b/iOS/SampleSwift/SampleSwift/MainStoryBoard.storyboard new file mode 100644 index 000000000..352bad524 --- /dev/null +++ b/iOS/SampleSwift/SampleSwift/MainStoryBoard.storyboard @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/SampleSwift/SampleSwift/ViewController.swift b/iOS/SampleSwift/SampleSwift/ViewController.swift new file mode 100644 index 000000000..1d829edac --- /dev/null +++ b/iOS/SampleSwift/SampleSwift/ViewController.swift @@ -0,0 +1,18 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +}