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
public override void ViewDidLoad() | |
{ | |
base.ViewDidLoad(); | |
// Set self as the Scene View's delegate | |
SceneView.Delegate = this; | |
// Track changes to the session | |
SceneView.Session.Delegate = new SessionDelegate(); | |
SceneView.Scene.PhysicsWorld.ContactDelegate = new PhysicsDelegate(); |
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
public override void TouchesBegan(NSSet touches, UIEvent evt) | |
{ | |
var forcePower = 10; | |
base.TouchesBegan(touches, evt); | |
var pointOfView = this.SceneView.PointOfView; | |
var transform = pointOfView.Transform; | |
var location = new SCNVector3(transform.M41, transform.M42, transform.M43); | |
var orientation = new SCNVector3(-transform.M31, -transform.M32, -transform.M33); | |
var position = location + orientation; | |
var pokeball = new SCNNode() |
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
using System; | |
using System.Globalization; | |
using Xamarin.Forms; | |
namespace RelativeTimeSample.Helpers | |
{ | |
public class RelativeDateTimeConvertor: IValueConverter | |
{ | |
const int SECOND = 1; | |
const int MINUTE = 60 * SECOND; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="RelativeTimeSample.Views.MainPage" | |
xmlns:converter="clr-namespace:RelativeTimeSample.Helpers" | |
Title="News"> | |
<ContentPage.Resources> | |
<ResourceDictionary> | |
<converter:RelativeDateTimeConvertor x:Key="RelativeDateTimeConvertor" /> | |
</ResourceDictionary> |
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
<Label HorizontalOptions="EndAndExpand" Text="{Binding Date, Converter={StaticResource RelativeDateTimeConvertor}}" FontSize="12"/> | |
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
//Llamo ese codigo para coger la imagen del picker | |
let image = imageView.image | |
if image != nil{ | |
let imageData:Data = UIImageJPEGRepresentation(image!, 1.0)! | |
let path:String = self.documentsDirectoryPath.appendingPathComponent(self.tempImageName) | |
try? UIImageJPEGRepresentation(image!, 1.0)!.write(to: URL(fileURLWithPath: path), options: [.atomic]) | |
self.imageURL = URL(fileURLWithPath: path) | |
try? imageData.write(to: self.imageURL, options: [.atomic]) | |
let File:CKAsset? = CKAsset(fileURL: URL(fileURLWithPath: path)) | |
CloudKitHelper.setMyFullName(loginTextField.text!, image: File) |
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
using System; | |
using Xamarin.Forms; | |
namespace ExtendedEditorSample.Controls | |
{ | |
public class ExtendedEditorControl : Editor | |
{ | |
public static BindableProperty PlaceholderProperty | |
= BindableProperty.Create(nameof(Placeholder), typeof(string), typeof(ExtendedEditorControl)); |
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
using System; | |
using Xamarin.Forms; | |
namespace ExtendedEditorSample.Controls | |
{ | |
public class ExtendedEditorControl : Editor | |
{ | |
public static BindableProperty PlaceholderProperty | |
= BindableProperty.Create(nameof(Placeholder), typeof(string), typeof(ExtendedEditorControl)); |
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
using System.ComponentModel; | |
using Android.Content; | |
using Android.Content.Res; | |
using Android.Graphics.Drawables; | |
using ExtendedEditorSample.Controls; | |
using ExtendedEditorSample.Droid; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer(typeof(ExtendedEditorControl), typeof(CustomEditorRenderer))] |
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
using System.ComponentModel; | |
using ExtendedEditorSample.Controls; | |
using ExtendedEditorSample.iOS; | |
using Foundation; | |
using UIKit; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer(typeof(ExtendedEditorControl), typeof(CustomEditorRenderer))] | |
namespace ExtendedEditorSample.iOS |