This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform:ios, '8.0' | |
use_frameworks! | |
source 'https://github.com/CocoaPods/Specs.git' | |
link_with 'AppName', 'AppName WatchKit Extension' | |
def shared_pods | |
pod 'Parse', '~> 1.7.2' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void performFFT(float* data, UInt32 numberOfFrames, SoundBufferPtr soundBuffer, UInt32 inBusNumber) { | |
int bufferLog2 = round(log2(numberOfFrames)); | |
float fftNormFactor = 1.0/( 2 * numberOfFrames); | |
FFTSetup fftSetup = vDSP_create_fftsetup(bufferLog2, kFFTRadix2); | |
int numberOfFramesOver2 = numberOfFrames / 2; | |
float outReal[numberOfFramesOver2]; | |
float outImaginary[numberOfFramesOver2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func timerTick(sender:NSTimer?) { | |
if audioManager.isPlaying() { | |
//Get the frequency data from the audio manager and show on horizontal bar graph | |
var size:UInt32 = 0 | |
let frequencyData = audioManager.guitarFrequencyDataOfLength(&size) | |
let frequencyValuesArray = Array<Float32>(UnsafeBufferPointer(start: UnsafePointer(frequencyData), count: Int(size))) | |
//Sanity check for expected 256 length | |
if frequencyValuesArray.count == 256 { | |
frequencyView.frequncyValues = frequencyValuesArray |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UITableView data source delegate methods | |
// These are the methods that UITableView calls on the controller to | |
// setup the table view with the number of items and a reusable cell | |
override func numberOfSectionsInTableView(tableView: UITableView) -> Int { | |
// return the number of sections | |
return 1 | |
} | |
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A simple view holder to be used for a list of items. To | |
* keep things simple, just one TextView will be used. | |
*/ | |
public class ItemHolder extends RecyclerView.ViewHolder { | |
public TextView mTextView; | |
public ItemHolder(View itemView) { | |
super(itemView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A simple RecyclerView.Adapter class that manages items. | |
*/ | |
public class ItemAdapter extends RecyclerView.Adapter<ItemHolder> { | |
private List<String> mItems; | |
public ItemAdapter(List<String> items) { | |
mItems = items; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A simple {@link Fragment} subclass. | |
* Use the {@link RecyclerFragment#newInstance} factory method to | |
* create an instance of this fragment. | |
*/ | |
public class RecyclerFragment extends Fragment { | |
private RecyclerView mRecyclerView; | |
private List<String> items = new ArrayList<String>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/recycler_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:scrollbars="vertical" | |
tools:context="layout.RecyclerFragment"> | |
</android.support.v7.widget.RecyclerView> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define the source locations. The Salesforce SDK is not a published cocoapod | |
source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' # needs to be first | |
source 'https://github.com/CocoaPods/Specs.git' | |
use_frameworks! | |
target 'ContactsForce' do | |
pod 'SalesforceSDKCore' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SalesforceSDKCore | |
import SalesforceRestAPI | |
public class SalesforceManager : NSObject { | |
//Define a shared instance for singleton | |
static let sharedInstance = SalesforceManager() | |
let errorDomain = "com.centare.contactforce.salesforcemanager" | |
OlderNewer