Skip to content

Commit

Permalink
Merge pull request #74 from attentive-mobile/rsmith/support-swift
Browse files Browse the repository at this point in the history
Rsmith/support swift
  • Loading branch information
rsmith-attentive authored Feb 21, 2024
2 parents c0da38f + fa56e43 commit cd9444f
Show file tree
Hide file tree
Showing 21 changed files with 261 additions and 180 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -606,7 +606,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -667,7 +667,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SP5WN9647Z;
FRAMEWORK_SEARCH_PATHS = "";
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

163 changes: 59 additions & 104 deletions ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "588EB71B2995BC3A00C0163A"
BuildableName = "ExampleSwift - SPM.app"
BlueprintName = "ExampleSwift - SPM"
ReferencedContainer = "container:ExampleSwift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 3 additions & 1 deletion ExampleSwift/ExampleSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
//

import Foundation
import UIKit
import ATTNSDKFramework

@main
class AppDelegate : UIResponder, UIApplicationDelegate {

var window: UIWindow?
public var attentiveSdk : ATTNSDK?
public var attentiveSdk : ATTNSDK?;

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

Expand Down
2 changes: 2 additions & 0 deletions ExampleSwift/ExampleSwift/ProductViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import Foundation
import os
import UIKit
import ATTNSDKFramework

class ProductViewController : UIViewController {
@IBOutlet var addToCartBtn : UIButton?
Expand Down
4 changes: 3 additions & 1 deletion ExampleSwift/ExampleSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import Foundation
import os
import UIKit
import ATTNSDKFramework

class ViewController : UIViewController {
@IBOutlet var creativeBtn : UIButton?
Expand All @@ -15,7 +17,7 @@ class ViewController : UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .systemGray3
self.view.backgroundColor = .white
}

@IBAction func creativeBtnPressed(sender: Any) {
Expand Down
23 changes: 0 additions & 23 deletions ExampleSwift/ExampleSwift/attentive-ios-sdk-bridging-header.h

This file was deleted.

This file was deleted.

16 changes: 16 additions & 0 deletions ExampleSwift/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "ATTNSDKFramework",
"repositoryURL": "https://github.com/attentive-mobile/attentive-ios-sdk",
"state": {
"branch": "rsmith/support-swift",
"revision": "0bf29e1001e180c0b84fe8e2bd350de7232a8346",
"version": null
}
}
]
},
"version": 1
}
25 changes: 25 additions & 0 deletions ExampleSwift/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "ExampleSwift",
platforms: [
.iOS(.v12)
],
products: [
.library(
name: "ExampleSwift",
targets: ["ExampleSwift"]),
],
dependencies: [
.package(url: "https://github.com/attentive-mobile/attentive-ios-sdk", .branch("rsmith/support-swift"))
],
targets: [
.target(
name: "ExampleSwift",
dependencies: [
.product(name: "ATTNSDKFramework", package: "attentive-ios-sdk")],
path: "ExampleSwift" // Ensure this path exists and is correct
),
]
)
10 changes: 0 additions & 10 deletions ExampleSwift/Podfile

This file was deleted.

16 changes: 0 additions & 16 deletions ExampleSwift/Podfile.lock

This file was deleted.

19 changes: 19 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ATTNSDKFramework",
platforms: [.iOS(.v12)],
products: [
.library(name: "ATTNSDKFramework", targets: ["ATTNSDKFramework"])

],
targets: [
.target(
name: "ATTNSDKFramework",
path: "Sources/"
)
]
)
1 change: 1 addition & 0 deletions Sources/ATTNSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

#import <WebKit/WebKit.h>
#import <UIKit/UIKit.h>
#import "ATTNAPI.h"
#import "ATTNSDK.h"
#import "ATTNUserIdentity.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Internal/ATTNInfoEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ATTNInfoEvent_h
#define ATTNInfoEvent_h

#import "ATTNEvent.h"
#import "../ATTNEvent.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
18 changes: 18 additions & 0 deletions Sources/include/ATTNSDKFramework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import <Foundation/Foundation.h>

FOUNDATION_EXPORT double ATTNSDKFrameworkVersionNumber;

FOUNDATION_EXPORT const unsigned char ATTNSDKFrameworkVersionString[];

#import <../ATTNSDK.h>
#import <../ATTNUserIdentity.h>
#import <../ATTNEventTracker.h>
#import <../ATTNItem.h>
#import <../ATTNPrice.h>
#import <../ATTNEvent.h>
#import <../ATTNPurchaseEvent.h>
#import <../ATTNProductViewEvent.h>
#import <../ATTNAddToCartEvent.h>
#import <../ATTNOrder.h>
#import <../ATTNCart.h>
#import <../ATTNCustomEvent.h>
9 changes: 6 additions & 3 deletions attentive-ios-sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_TESTABILITY = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -587,6 +587,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -631,6 +632,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -641,6 +643,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -675,7 +678,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.attentive.attentive-ios-sdk-local";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = auto;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
Expand Down Expand Up @@ -713,7 +716,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.attentive.attentive-ios-sdk-local";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = auto;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
Expand Down
3 changes: 0 additions & 3 deletions attentive-ios-sdk.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cd9444f

Please sign in to comment.