Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 1 addition & 106 deletions docs/api/UIKit/UICollectionView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,109 +310,4 @@ public class SimpleCollectionViewController : UICollectionViewController
<related type="article" href="https://docs.xamarin.com/ios/Guides/User_Interface/Introduction_to_Collection_Views">Introduction to Collection Views</related>
<related type="externalDocumentation" href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/index.html">Apple documentation for <c>UICollectionView</c></related>
</Docs>
<Docs DocId="M:UIKit.UICollectionView.RegisterClassForCell(System.Type,System.String)">
<param name="cellType">To be added.</param>
<param name="reuseIdentifier">A non-empty string to be associated with the <paramref name="cellType" />.</param>
<summary>Specifies the type to be used to populate cells.</summary>
<remarks>
<para>The <see cref="UIKit.UICollectionView" /> maintains a highly-efficient reuse queue for offscreen components. This requires that the <see cref="UIKit.UICollectionView" /> be responsible for the lifecycle management of its component views. This method (and related methods such as <see cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(System.Type,UIKit.UICollectionElementKindSection,System.String)" />) provide the <see cref="UIKit.UICollectionView" /> the knowledge of which types it needs to instantiate.</para>
<para>The application developer may pass <see langword="null" /> as the <paramref name="reuseIdentifier" />, in which case the <paramref name="cellType" /> will be "un-registered" and no longer instantiated. The application developer may pass in a <paramref name="reuseIdentifier" /> previously associated with another type, in which case the old type will be "de-registered" and the new <paramref name="cellType" /> will be used.</para>
<para>It is very important that the type that you specify implements a public constructor that takes a <see cref="CoreGraphics.CGRect" /> parameter, this is used to initialize the class from an object allocated by Objective-C. The following example shows the constructor in use:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
public class AnimalCell : UICollectionViewCell
{
[Export ("initWithFrame:")]
  public AnimalCell (CGRect frame) : base (frame) {}
}
]]></code>
</example>
<para>Developers should not call this method if they have prototyped their <see cref="UIKit.UICollectionViewCell" /> type using a Storyboard. If they do so, they will overwrite the Storyboard-defined definition instantiation of the <see cref="UIKit.UICollectionViewCell" /> object's children.</para>
</remarks>
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, NSString, string)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, NSString, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, string)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib?, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, NSString, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterClassForDecorationView(Type, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterNibForDecorationView" />
</Docs>
<Docs DocId="M:UIKit.UICollectionView.RegisterClassForCell(System.Type,Foundation.NSString)">
<param name="cellType">A subtype of <see cref="UIKit.UICollectionViewCell" />.</param>
<param name="reuseIdentifier">A non-empty string to be associated with the <paramref name="cellType" />.</param>
<summary>Specifies the type to be used to populate cells.</summary>
<remarks>
<para>The <see cref="UIKit.UICollectionView" /> maintains a highly-efficient reuse queue for offscreen components. This requires that the <see cref="UIKit.UICollectionView" /> be responsible for the lifecycle management of its component views. This method (and related methods such as <see cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(System.Type,UIKit.UICollectionElementKindSection,System.String)" />) provide the <see cref="UIKit.UICollectionView" /> the knowledge of which types it needs to instantiate.</para>
<para>The application developer may pass <see langword="null" /> as the <paramref name="reuseIdentifier" />, in which case the <paramref name="cellType" /> will be "un-registered" and no longer instantiated. The application developer may pass in a <paramref name="reuseIdentifier" /> previously associated with another type, in which case the old type will be "de-registered" and the new <paramref name="cellType" /> will be used.</para>
<para>It is very important that the type that you specify implements a public constructor that takes a <see cref="CoreGraphics.CGRect" /> parameter, this is used to initialize the class from an object allocated by Objective-C. The following example shows the constructor in use:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
public class AnimalCell : UICollectionViewCell
{
[Export ("initWithFrame:")]
  public AnimalCell (CGRect frame) : base (frame) {}
}
]]></code>
</example>
<para>Developers should not call this method if they have prototyped their <see cref="UIKit.UICollectionViewCell" /> type using a Storyboard. If they do so, they will overwrite the Storyboard-defined definition instantiation of the <see cref="UIKit.UICollectionViewCell" /> object's children.</para>
</remarks>
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, NSString, string)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, NSString, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, string)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(Type, UICollectionElementKindSection, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib?, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, NSString, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterClassForDecorationView(Type, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterNibForDecorationView" />
</Docs>
<Docs DocId="M:UIKit.UICollectionView.RegisterClassForSupplementaryView(System.Type,UIKit.UICollectionElementKindSection,Foundation.NSString)">
<param name="cellType">A subtype of <see cref="UIKit.UICollectionReusableView" /> to be used for supplementary views</param>
<param name="section">The type of supplementary view being registered.</param>
<param name="reuseIdentifier">A non-empty string to be associated with the <paramref name="cellType" />.</param>
<summary>Specifies the type to be used to populate supplementary views.</summary>
<remarks>
<para>The <see cref="UIKit.UICollectionView" /> maintains a highly-efficient reuse queue for offscreen components. This requires that the <see cref="UIKit.UICollectionView" /> be responsible for the lifecycle management of its component views. This method (and related methods such as <see cref="UIKit.UICollectionView.RegisterClassForCell(System.Type,System.String)" />) provide the <see cref="UIKit.UICollectionView" /> the knowledge of which types it needs to instantiate.</para>
<para>The application developer may pass <see langword="null" /> as the <paramref name="reuseIdentifier" />, in which case the <paramref name="cellType" /> will be "un-registered" and no longer instantiated. The application developer may pass in a <paramref name="reuseIdentifier" /> previously associated with another type, in which case the old type will be "de-registered" and the new <paramref name="cellType" /> will be used.</para>
<para>
It is very important that you provide constructor that takes an IntPtr argument in any subclasses that you register. This is required because the classes are actually allocated by the Objective-C runtime, and you must initialize them.
</para>
</remarks>
<altmember cref="UIKit.UICollectionView.RegisterClassForCell(Type, string)" />
<altmember cref="UIKit.UICollectionView.RegisterClassForCell(Type, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForCell(UINib?, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, string)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, UICollectionElementKindSection, NSString)" />
<altmember cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UINib, NSString, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterClassForDecorationView(Type, NSString)" />
<altmember cref="UIKit.UICollectionViewLayout.RegisterNibForDecorationView" />
</Docs>
<Docs DocId="M:UIKit.UICollectionView.RegisterNibForSupplementaryView(UIKit.UINib,UIKit.UICollectionElementKindSection,Foundation.NSString)">
<param name="nib">The <see cref="UIKit.UINib" /> to be used to populate the supplementary view.</param>
<param name="section">The kind of supplementary view being registered.</param>
<param name="reuseIdentifier">A non-empty string to be associated with the <paramref name="nib" />.</param>
<summary>Specifies the nib to be used for populating the supplementary view.</summary>
<remarks>
<para>The <see cref="UIKit.UICollectionView" /> maintains a highly-efficient reuse queue for offscreen components. This requires that the <see cref="UIKit.UICollectionView" /> be responsible for the lifecycle management of its component views. This method (and related methods such as <see cref="UIKit.UICollectionView.RegisterNibForCell(UIKit.UINib,System.String)" />) provide the <see cref="UIKit.UICollectionView" /> the knowledge of which types it needs to instantiate.</para>
<para>The application developer may pass <see langword="null" /> as the <paramref name="reuseIdentifier" />, in which case the <paramref name="nib" /> will be "un-registered" and no longer instantiated. The application developer may pass in a <paramref name="reuseIdentifier" /> previously associated with another nib, in which case the old nib will be "de-registered" and the new <paramref name="nib" /> will be used.</para>
</remarks>
</Docs>
<Docs DocId="M:UIKit.UICollectionView.DequeueReusableSupplementaryView(UIKit.UICollectionElementKindSection,Foundation.NSString,Foundation.NSIndexPath)">
<param name="section">A <see cref="UIKit.UICollectionElementKindSection" /> specifying what kind of supplementary view is desired.</param>
<param name="reuseIdentifier">To be added.</param>
<param name="indexPath">The <see cref="Foundation.NSIndexPath" /> specifying the location of the supplementary view.</param>
<summary>Returns a newly-allocated or reused supplementary <see cref="UIKit.UICollectionReusableView" />.</summary>
<returns>A supplementary <see cref="UIKit.UICollectionReusableView" /> that is either newly allocated or recycled from the reuse queue..</returns>
<remarks>
<para>The application developer must have registered a class or nib file using either <see cref="UIKit.UICollectionView.RegisterClassForSupplementaryView(System.Type,UIKit.UICollectionElementKindSection,System.String)" /> or <see cref="UIKit.UICollectionView.RegisterNibForSupplementaryView(UIKit.UINib,UIKit.UICollectionElementKindSection,System.String)" /> prior to calling this method.</para>
<para>If the <see cref="UIKit.UICollectionReusableView" /> is not newly allocated but is being recycled, this method will call that cell's <see cref="UIKit.UICollectionReusableView.PrepareForReuse" /> method.</para>
</remarks>
</Docs>
</Documentation>
</Documentation>
28 changes: 15 additions & 13 deletions src/ObjCRuntime/Class.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,22 @@ public static NativeHandle GetHandleIntrinsic (string name)
return objc_getClass (name);
}

/// <summary>Gets the Objective-C handle of the given type.</summary>
/// <param name="type">Type for an NSObject-derived class</param>
/// <summary>Gets the Objective-C handle of the given type.</summary>
/// <returns>The Objective-C handle to the object.</returns>
/// <remarks>
/// <para>
/// This method looks up the Objective-C handle for the specified type, or registers the specified type with the Objective-C runtime if it was not previously registered.
/// </para>
/// <para>
/// The class must be derived from NSObject. If the class is flagged with the [Register] attribute, the name specified in this Register attribute is the name that will be used for looking up or register the class.
///
/// </para>
/// </remarks>
public static NativeHandle GetHandle (Type type)
{
/// <returns>The Objective-C handle to the object.</returns>
/// <remarks>
/// <para>
/// This method looks up the Objective-C handle for the specified type, or registers the specified type with the Objective-C runtime if it was not previously registered.
/// </para>
/// <para>
/// The class must be derived from <see cref="NSObject" />. If the class is flagged with the <see cref="RegisterAttribute" /> attribute, the name specified in this Register attribute is the name that will be used for looking up or register the class.
/// </para>
/// </remarks>
public static NativeHandle GetHandle (Type? type)
{
if (type is null)
return NativeHandle.Zero;

Comment thread
rolfbjarne marked this conversation as resolved.
return GetClassHandle (type, true, out _);
}

Expand Down
Loading
Loading