Xamarin.iOS sample apps
Перейти к файлу
Martin Løbger 7c2a7738e0
Fix crash in Chat sample and make it work correctly (#365)
* Fix crash in Chat sample and make it work correctly

* Update Chat/Chat/ChatViewController.cs

---------

Co-authored-by: Martin Loebger <extmloebger@gnresound.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-12-22 16:40:11 +01:00
.vscode Create settings.json 2019-07-19 19:12:39 -07:00
AQTapDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AUSoundTriggeredPlayingSoundMemoryBased Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AVCompositionDebugVieweriOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AVCustomEdit Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AVTouchSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AdaptiveElements Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AirLocate Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AppPrefs Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Appearance Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ApplicationFundamentals Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AsyncDownloadImage Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AudioConverterFileConverter Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AudioGenerator Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AudioQueueOfflineRenderDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
AudioTapProcessor Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
BackgroundExecution Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
BindingSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
BouncingGameCompleteiOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
BouncingGameEmptyiOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ButtonEventDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ButtonTapper3000 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Calendars Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Chat Fix crash in Chat sample and make it work correctly (#365) 2023-12-22 16:40:11 +01:00
CircleLayout Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CollectionViewTransition Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Contacts Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Controls Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CoreAnimation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CoreImage Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CoreLocation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CoreMidiSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CoreTelephonyDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CreatingTabbedApplications Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CustomCollectionViewLayoutAttributes Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CustomInputStream Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CustomPropertyAnimation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
CustomTransitions Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Data Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
DesignerWalkthrough Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
DispatchSourceExamples Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Drawing Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
DynamicsCatalog Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
FileSystemSampleCode Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
FontList Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
FrogScroller Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GLCameraRipple Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GLPaint-GameView Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GameCenterSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GoogleAdMobAds/binding Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GraphicsAndAnimation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
GrowRowTable Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
HelloWorld_iPhone Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Hello_ComplexUniversal Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Hello_MultiScreen_iPhone Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Hello_Universal Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Hello_iOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Hello_iPad Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
HomeKit/HomeKitIntro Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
HttpClient Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ImageProtocol Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
InfColorPicker Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
IntroToiOS7 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
IntroductionToiCloud Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
KeyValueObserving Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Keychain Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LazyTableImages Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LazyTableImagesAsync Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LifecycleDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LineLayout Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LocalNotifications Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Location Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
LowLevelGLPaint Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MTDJsonDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MTDReflectionWalkthrough Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MTDWalkthrough Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MTGKTapper Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ManualCameraControls Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ManualStoryboard Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MapCallouts Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MapDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MapKitSearch Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MapsWalkthrough Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MediaNotes Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MidiTest Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MonoCatalog-MonoDevelop Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MonoDevelopTouchCells Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MotionGraphs Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MoviePlayback Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
MultichannelMixer Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
NSZombieApocalypse Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
NavigationBar Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Newsstand Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Notifications Fix the code to demonstrate how to serialize the device token to send it to backend server. (#401) 2023-02-24 15:59:52 +01:00
OpenGL Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
OpenGLESSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
OpenGLESSample_GameView Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
OpenGLScroller Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PaintCode Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PassKit Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PeekPopNavigation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PickerControl Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PinchIt Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PokerNightVoting Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Popovers Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PrintBanner Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PrintSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
PrivacyPrompts Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Profiling/MemoryDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Protocols_Delegates_Events Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
QRchestra Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
QuartzSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Quotes Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Reachability Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
RecipesAndPrinting Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
RegionDefiner Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
RosyWriter Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Rotation Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ScratchTicket Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SearchDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SharedResources Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleBackgroundFetch Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleBackgroundTransfer Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleCollectionView Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleDrillDown Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleLogin Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SimpleTextInput Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SoZoomy Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SocialFrameworkDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Sound Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SplitView Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SpriteKit Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SpriteKitPhysicsCollisions Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SpriteTour Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Stars Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StateRestoration Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StoreKit Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StoryboardIntro Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StoryboardTable Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StoryboardTable_LocalAuthentication Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
StreamingAudio Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
SystemSound Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TabbedImages Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TableEditing Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TableParts Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TableSwipeActions Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TextKitDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ThreadedCoreData Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TicTacToe Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Touch Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TouchesClassic Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Touches_GestureRecognizers Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
TransitionsDemo Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
UICatalog Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
UIImageEffects Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ViewTransitions Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WalkingGameCompleteiOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WalkingGameEmptyiOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WatchKit Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WayUpSample Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WeatherMap Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WebView Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WorkingWithImages Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WorkingWithTables Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Working_with_images Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
WorldCities Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ZoomingPdfViewer Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
iOS7-ui-updates Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
intro-to-extensions Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios7fonts Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios8 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios9 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios10 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios11 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios12 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
ios13 Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
nnyeah-samples Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
tvos Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
watchOS Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
.editorconfig Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
.gitattributes Add sln file (and make sure it stays as CRLF because VS needs it) for CoreTelephonyDemo. 2011-09-09 19:45:29 +02:00
.gitignore ignore vscode settings 2019-07-22 10:41:25 -07:00
LICENSE clarify license for #184 2017-09-28 10:41:57 -07:00
Makefile Add a convenient Makefile to build the samples 2016-01-15 22:53:14 -05:00
README.md [yaml] update repo readme for new code browser (#378) 2019-08-12 13:52:18 -07:00
Xamarin.Edu.SampleGallery.Core.dll Update sample validator. 2012-07-05 19:30:05 +02:00
install-hook.sh Set executable bit on install-hook.sh and pre-commit.posix. 2011-09-27 19:14:23 +02:00
mdtool-build Fix mdtool build invocation. 2011-10-04 11:53:52 +02:00
pre-commit.posix Fix pre-commit script's use of ==. 2012-02-20 18:45:41 +01:00
validate.posix Fix usage of `find` in some scripts. 2012-02-17 21:39:36 +01:00
xcsv.exe Update sample validator. 2012-07-05 19:30:05 +02:00

README.md

iOS/tvOS/watchOS Samples

The samples in this directory use the Xamarin.iOS toolchain and Xamarin project files to illustrate the basics of how to work with iOS and the SDK. Visit the iOS Sample Gallery to download individual samples.

License

See the repo's license file and any additional license information attached to each sample.

Samples Layout

Version Specific Samples

Starting with iOS 8, we started adding samples that showcase specific features introduced in a release into a directory for the release. So all the new iOS 8 feature samples live in the ios8 directory, the iOS 9 features live in the ios9 directory and the iOS 10 feature lives in the ios10 directory, and so on for ios11, ios12, ios13...

watchOS

watchOS samples are in the watchOS directory, including:

NOTE: The WatchKit samples are deprecated, please refer to these samples in the watchOS directory.

tvOS

tvOS samples are in the tvos directory, including the tvOS UI Catalog.

Contributing

Before adding a sample to the repository, please run either install-hook.bat or install-hook.sh depending on whether you're on Windows or a Posix system. This will install a Git hook that runs the Xamarin code sample validator before a commit, to ensure that all samples are good to go.

Samples Submission Guidelines

Galleries

We love samples! Application samples show off our platform and provide a great way for people to learn our stuff. And we even promote them as a first-class feature of the docs site. You can find the sample galleries here:

Sample GitHub Repositories

These sample galleries are populated by samples in these GitHub repos:

The mobile-samples repository is for samples that are cross-platform. The mac-ios-samples repository is for samples that are Mac/iOS only.

Sample Requirements

We welcome sample submissions, please start by creating an issue with your proposal.

Because the sample galleries are powered by the github sample repos, each sample needs to have the following things:

  • Screenshots - a folder called Screenshots that has at least one screen shot of the sample on each platform (preferably a screen shot for every page or every major piece of functionality). For an example of this, see ios11/MapKitSample.

  • Readme - a README.md file that explains the sample, and contains metadata to help customers find it. For an example of this, see ios11/MapKitSample. The README file should begin with a YAML header (delimited by ---) with the following keys/values:

    • name - must begin with Xamarin.iOS -

      • description - brief description of the sample (< 150 chars) that appears in the sample code browser search

      • page_type - must be the string sample.

      • languages - coding language/s used in the sample, such as: csharp, fsharp, vb, objc

      • products: should be xamarin for every sample in this repo

      • urlFragment: although this can be auto-generated, please supply an all-lowercase value that represents the sample's path in this repo, except directory separators are replaced with dashes (-) and no other punctuation.

      Here is a working example from ios11/MapKitSample README raw view.

      ---
      name: Xamarin.iOS - MapKit Sample
      description: "Demo of new iOS 11 features in MapKit, grouping and splitting markers based on zoom-level. Tandm is a fictional bike sharing... (iOS11)"
      page_type: sample
      languages:
      - csharp
      products:
      - xamarin
      urlFragment: ios11-mapkitsample
      ---
      # Heading 1
      
      rest of README goes here, including screenshot images and requirements/instructions to get it running
      

      NOTE: This must be valid YAML, so some characters in the name or description will require the entire string to be surrounded by " or ' quotes.

  • Buildable solution and .csproj file - the project must build and have the appropriate project scaffolding (solution + .csproj files).

This approach ensures that all samples integrate with the Microsoft sample code browser.

A good example of this stuff is here in the iOS 11 maps sample: https://github.com/xamarin/ios-samples/tree/master/ios11/MapKitSample

For a cross-platform sample, please see: https://github.com/xamarin/mobile-samples/tree/master/Tasky

GitHub Integration

We integrate tightly with Git to make sure we always provide working samples to our customers. This is achieved through a pre-commit hook that runs before your commit goes through, as well as a post-receive hook on GitHub's end that notifies our samples gallery server when changes go through.

To you, as a sample committer, this means that before you push to the repos, you should run the "install-hook.bat" or "install-hook.sh" (depending on whether you're on Windows or macOS/Linux, respectively). These will install the Git pre-commit hook. Now, whenever you try to make a Git commit, all samples in the repo will be validated. If any sample fails to validate, the commit is aborted; otherwise, your commit goes through and you can go ahead and push.

This strict approach is put in place to ensure that the samples we present to our customers are always in a good state, and to ensure that all samples integrate correctly with the sample gallery (README.md, Metadata.xml, etc). Note that the master branch of each sample repo is what we present to our customers for our stable releases, so they must always Just Work.

Should you wish to invoke validation of samples manually, simply run "validate.windows" or "validate.posix" (again, Windows vs macOS/Linux, respectively). These must be run from a Bash shell (i.e. a terminal on macOS/Linux or the Git Bash terminal on Windows).

If you have any questions, don't hesitate to ask on Xamarin Forums!