Skip to content

Commit

Permalink
Convert for Swift 3.1.
Browse files Browse the repository at this point in the history
Change sharedInstance by shared like native iOS SDKs with swift >= 3 and update other methods names.
VoxeetSDK bug fixes and prepare to merge with CallKit (will be implemented in the next version).
  • Loading branch information
Comanga committed Apr 7, 2017
1 parent 5b47339 commit 66d0998
Show file tree
Hide file tree
Showing 20 changed files with 241 additions and 718 deletions.
24 changes: 14 additions & 10 deletions Sample/VoxeetSDK Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

/* Begin PBXBuildFile section */
6E4856541CDA4D9B00E684E1 /* Elephant-mono.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6E4856531CDA4D9B00E684E1 /* Elephant-mono.mp3 */; };
CC0B2B021E97C8A4009BED98 /* VoxeetSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC0B2B011E97C8A4009BED98 /* VoxeetSDK.framework */; };
CC0B2B031E97C8A4009BED98 /* VoxeetSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CC0B2B011E97C8A4009BED98 /* VoxeetSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CC6777E61D7720F500FF056D /* ConferenceTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6777E51D7720F500FF056D /* ConferenceTableViewCell.swift */; };
CCB9E4371CE1F10B0076A886 /* AudioEngineDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB9E4361CE1F10B0076A886 /* AudioEngineDemo.swift */; };
CCC313881DE5F89300902CF8 /* VoxeetSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCC313871DE5F89300902CF8 /* VoxeetSDK.framework */; };
CCC313891DE5F89300902CF8 /* VoxeetSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CCC313871DE5F89300902CF8 /* VoxeetSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CCD8B66C1CD266DD00831710 /* Conference.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCD8B66B1CD266DD00831710 /* Conference.swift */; };
CCD8B66C1CD266DD00831710 /* ConferenceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCD8B66B1CD266DD00831710 /* ConferenceViewController.swift */; };
CCF12CA31CCA5EFC000D0D12 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF12CA21CCA5EFC000D0D12 /* AppDelegate.swift */; };
CCF12CA51CCA5EFC000D0D12 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF12CA41CCA5EFC000D0D12 /* ViewController.swift */; };
CCF12CA81CCA5EFC000D0D12 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CCF12CA61CCA5EFC000D0D12 /* Main.storyboard */; };
Expand Down Expand Up @@ -47,7 +47,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
CCC313891DE5F89300902CF8 /* VoxeetSDK.framework in Embed Frameworks */,
CC0B2B031E97C8A4009BED98 /* VoxeetSDK.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -56,10 +56,10 @@

/* Begin PBXFileReference section */
6E4856531CDA4D9B00E684E1 /* Elephant-mono.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Elephant-mono.mp3"; sourceTree = "<group>"; };
CC0B2B011E97C8A4009BED98 /* VoxeetSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VoxeetSDK.framework; path = ../VoxeetSDK/VoxeetSDK.framework; sourceTree = "<group>"; };
CC6777E51D7720F500FF056D /* ConferenceTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConferenceTableViewCell.swift; sourceTree = "<group>"; };
CCB9E4361CE1F10B0076A886 /* AudioEngineDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioEngineDemo.swift; sourceTree = "<group>"; };
CCC313871DE5F89300902CF8 /* VoxeetSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VoxeetSDK.framework; path = ../VoxeetSDK/VoxeetSDK.framework; sourceTree = "<group>"; };
CCD8B66B1CD266DD00831710 /* Conference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Conference.swift; sourceTree = "<group>"; };
CCD8B66B1CD266DD00831710 /* ConferenceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConferenceViewController.swift; sourceTree = "<group>"; };
CCF12C9F1CCA5EFC000D0D12 /* VoxeetSDK Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "VoxeetSDK Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
CCF12CA21CCA5EFC000D0D12 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
CCF12CA41CCA5EFC000D0D12 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand All @@ -81,7 +81,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CCC313881DE5F89300902CF8 /* VoxeetSDK.framework in Frameworks */,
CC0B2B021E97C8A4009BED98 /* VoxeetSDK.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -123,7 +123,7 @@
CCF12C961CCA5EFC000D0D12 = {
isa = PBXGroup;
children = (
CCC313871DE5F89300902CF8 /* VoxeetSDK.framework */,
CC0B2B011E97C8A4009BED98 /* VoxeetSDK.framework */,
CCF12CA11CCA5EFC000D0D12 /* VoxeetSDK Sample */,
CCF12CB91CCA5EFC000D0D12 /* VoxeetSDK SampleTests */,
CCF12CC41CCA5EFC000D0D12 /* VoxeetSDK SampleUITests */,
Expand All @@ -146,7 +146,7 @@
children = (
CCF12CA21CCA5EFC000D0D12 /* AppDelegate.swift */,
CCF12CA41CCA5EFC000D0D12 /* ViewController.swift */,
CCD8B66B1CD266DD00831710 /* Conference.swift */,
CCD8B66B1CD266DD00831710 /* ConferenceViewController.swift */,
CC6777E51D7720F500FF056D /* ConferenceTableViewCell.swift */,
CCB9E4361CE1F10B0076A886 /* AudioEngineDemo.swift */,
CCF12CA61CCA5EFC000D0D12 /* Main.storyboard */,
Expand Down Expand Up @@ -246,10 +246,14 @@
CreatedOnToolsVersion = 7.3;
DevelopmentTeam = B55NRA8BRW;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
};
com.apple.Push = {
enabled = 0;
};
};
};
CCF12CB51CCA5EFC000D0D12 = {
Expand Down Expand Up @@ -322,7 +326,7 @@
CCF12CAB1CCA5EFC000D0D12 /* VoxeetSDK_Sample.xcdatamodeld in Sources */,
CC6777E61D7720F500FF056D /* ConferenceTableViewCell.swift in Sources */,
CCF12CA31CCA5EFC000D0D12 /* AppDelegate.swift in Sources */,
CCD8B66C1CD266DD00831710 /* Conference.swift in Sources */,
CCD8B66C1CD266DD00831710 /* ConferenceViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions Sample/VoxeetSDK Sample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, VTSessionStateDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Initialization of the Voxeet SDK.
VoxeetSDK.sharedInstance.initializeSDK(consumerKey: "consumerKey", consumerSecret: "consumerSecret")
VoxeetSDK.shared.initializeSDK(consumerKey: "consumerKey", consumerSecret: "consumerSecret")

// Session delegate.
VoxeetSDK.sharedInstance.sessionStateDelegate = self
VoxeetSDK.shared.sessionStateDelegate = self

return true
}
Expand Down
27 changes: 8 additions & 19 deletions Sample/VoxeetSDK Sample/AudioEngineDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ class AudioEngineDemo: UIViewController {

override func viewDidLoad() {
// Initializes VTAudioSound.
if let path = Bundle.main.path(forResource: "Elephant-mono", ofType: "mp3") {
do {
elephantSound = try VTAudioSound(url: URL(fileURLWithPath: path))
} catch let error {
// Debug.
print("[ERROR] \(#function) - Error: \(error)")
}
do {
elephantSound = try VTAudioSound(forResource: "Elephant-mono", ofType: "mp3")
} catch let error {
// Debug.
print("[ERROR] \(#function) - Error: \(error)")
}
}

Expand All @@ -35,12 +33,12 @@ class AudioEngineDemo: UIViewController {

@IBAction func angle(_ sender: UISlider) {
// Updating sound spatialization.
elephantSound?.angle = Double(sender.value)
elephantSound?.angle = sender.value
}

@IBAction func distance(_ sender: UISlider) {
// Updating sound spatialization.
elephantSound?.distance = Double(sender.value)
elephantSound?.distance = sender.value
}

@IBAction func loop(_ sender: UISwitch) {
Expand All @@ -54,15 +52,6 @@ class AudioEngineDemo: UIViewController {
}

@IBAction func play(_ sender: AnyObject) {
// Playing sound.
do {
try elephantSound?.play() {
// Debug.
print("[DEBUG] \(#function) - The sound has finished being played.")
}
} catch let error {
// Debug.
print("[ERROR] \(#function) - Error: \(error)")
}
try? elephantSound?.play()
}
}
Loading

0 comments on commit 66d0998

Please sign in to comment.