This file contains 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
#!/bin/bash | |
set -e | |
git diff --diff-filter=d --staged --name-only | grep -e '\(.*\).swift$' | while read line; do | |
swiftformat "${line}"; | |
git add "$line"; | |
done | |
swiftlint --quiet --strict |
This file contains 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
#if os(OSX) | |
// compiles for OS X | |
#elseif os(iOS) | |
// compiles for iOS | |
#elseif os(tvOS) | |
// compiles for TV OS | |
#elseif os(watchOS) | |
// compiles for Apple watch | |
#endif |
This file contains 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
var url = "" | |
#if DEBUG | |
// use localhost while under debug mode | |
url = "https://localhost" | |
#else | |
// use production url while under release | |
url = "production url" | |
#endif | |
// You can negate the flag |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FBSManager : MonoBehaviour | |
{ | |
public int rangeInt; | |
public float updateInterval = 0.5F; | |
private float accum = 0; | |
private int frames = 0; |
This file contains 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
struct NoteModel: Codable{ | |
let userName: String | |
let latitude: Double | |
let longitude: Double | |
let text: String | |
let createDateTime: String | |
// mapping the keys from data | |
enum CodingKeys: String, CodingKey { | |
case userName = "username" |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Advertisements; | |
public class InterstitialAdManager : MonoBehaviour { | |
#if UNITY_IOS | |
private string gameId = "3685328"; | |
#elif UNITY_ANDROID |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Advertisements; | |
using UnityEngine.UI; | |
public class RewardedVideoButton : MonoBehaviour, IUnityAdsListener { | |
#if UNITY_IOS | |
private string gameId = "3685328"; |
This file contains 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
let note1 = NoteModel(userName: "testing user 2", latitude: 0.0, longitude: 0.0, text: "testing notes", createDateTime: "04/12/2020 18:12:03") | |
let note2 = NoteModel(userName: "testing user 2", latitude: 0.0, longitude: 0.0, text: "testing notes", createDateTime: "04/12/2020 18:12:03") | |
let array = [note1] | |
XCTAssertEqual(array.contains(note2), true) // true |
This file contains 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
class NoteModel: NSObject { | |
let userName: String | |
let latitude: Double | |
let longitude: Double | |
let text: String | |
let createDateTime: String | |
init(userName: String, latitude: Double, longitude: Double, text: String, createDateTime: String) { | |
self.userName = userName |