Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit 5d27f45

Browse files
Israel Sotoconceptdev
authored andcommitted
Added some iOS 13 samples (#386)
* [iOS13] Ported AddingTheSignInWithAppleFlowToYourApp sample * [iOS13] Ported AdoptingIOSDarkMode sample * [iOS13] Ported DisablingPullingDownASheet sample * [iOS13] Ported RefreshingAndMaintainingYourAppUsingBackgroundTasks sample * [iOS13] Ported SupportingMultipleWindowsOniPad sample * [iOS13] Ported UsingCollectionViewCompositionalLayoutsAndDiffableDataSources sample * minor markdown fix (prefer # headings)
1 parent d89645c commit 5d27f45

File tree

327 files changed

+12928
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+12928
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddingTheSignInWithAppleFlowToYourApp", "AddingTheSignInWithAppleFlowToYourApp\AddingTheSignInWithAppleFlowToYourApp.csproj", "{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|iPhoneSimulator = Debug|iPhoneSimulator
9+
Release|iPhoneSimulator = Release|iPhoneSimulator
10+
Debug|iPhone = Debug|iPhone
11+
Release|iPhone = Release|iPhone
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
15+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
16+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
17+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
18+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Debug|iPhone.ActiveCfg = Debug|iPhone
19+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Debug|iPhone.Build.0 = Debug|iPhone
20+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Release|iPhone.ActiveCfg = Release|iPhone
21+
{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}.Release|iPhone.Build.0 = Release|iPhone
22+
EndGlobalSection
23+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
6+
<ProjectGuid>{C16B8570-4E7B-4E5A-8D37-51DA6FF1BC1D}</ProjectGuid>
7+
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<TemplateGuid>{edc1b0fa-90cd-4038-8fad-98fe74adb368}</TemplateGuid>
9+
<OutputType>Exe</OutputType>
10+
<RootNamespace>AddingTheSignInWithAppleFlowToYourApp</RootNamespace>
11+
<AssemblyName>AddingTheSignInWithAppleFlowToYourApp</AssemblyName>
12+
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
13+
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
14+
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
15+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
22+
<DefineConstants>DEBUG</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<MtouchArch>x86_64</MtouchArch>
26+
<MtouchLink>None</MtouchLink>
27+
<MtouchDebug>true</MtouchDebug>
28+
<CodesignKey>iPhone Developer</CodesignKey>
29+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
32+
<DebugType>none</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<MtouchLink>None</MtouchLink>
38+
<MtouchArch>x86_64</MtouchArch>
39+
<CodesignKey>iPhone Developer</CodesignKey>
40+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
41+
</PropertyGroup>
42+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
43+
<DebugSymbols>true</DebugSymbols>
44+
<DebugType>full</DebugType>
45+
<Optimize>false</Optimize>
46+
<OutputPath>bin\iPhone\Debug</OutputPath>
47+
<DefineConstants>DEBUG</DefineConstants>
48+
<ErrorReport>prompt</ErrorReport>
49+
<WarningLevel>4</WarningLevel>
50+
<MtouchArch>ARM64</MtouchArch>
51+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
52+
<CodesignKey>iPhone Developer</CodesignKey>
53+
<MtouchDebug>true</MtouchDebug>
54+
<CodesignResourceRules></CodesignResourceRules>
55+
</PropertyGroup>
56+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
57+
<DebugType>none</DebugType>
58+
<Optimize>true</Optimize>
59+
<OutputPath>bin\iPhone\Release</OutputPath>
60+
<ErrorReport>prompt</ErrorReport>
61+
<WarningLevel>4</WarningLevel>
62+
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
63+
<MtouchArch>ARM64</MtouchArch>
64+
<CodesignKey>iPhone Developer</CodesignKey>
65+
</PropertyGroup>
66+
<ItemGroup>
67+
<Reference Include="System" />
68+
<Reference Include="System.Xml" />
69+
<Reference Include="System.Core" />
70+
<Reference Include="Xamarin.iOS" />
71+
<Reference Include="System.Numerics" />
72+
<Reference Include="System.Numerics.Vectors" />
73+
</ItemGroup>
74+
<ItemGroup>
75+
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
76+
</ItemGroup>
77+
<ItemGroup>
78+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
79+
<Visible>false</Visible>
80+
</ImageAsset>
81+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
82+
<Visible>false</Visible>
83+
</ImageAsset>
84+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
85+
<Visible>false</Visible>
86+
</ImageAsset>
87+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
88+
<Visible>false</Visible>
89+
</ImageAsset>
90+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
91+
<Visible>false</Visible>
92+
</ImageAsset>
93+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
94+
<Visible>false</Visible>
95+
</ImageAsset>
96+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
97+
<Visible>false</Visible>
98+
</ImageAsset>
99+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
100+
<Visible>false</Visible>
101+
</ImageAsset>
102+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
103+
<Visible>false</Visible>
104+
</ImageAsset>
105+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
106+
<Visible>false</Visible>
107+
</ImageAsset>
108+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
109+
<Visible>false</Visible>
110+
</ImageAsset>
111+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
112+
<Visible>false</Visible>
113+
</ImageAsset>
114+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
115+
<Visible>false</Visible>
116+
</ImageAsset>
117+
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
118+
<Visible>false</Visible>
119+
</ImageAsset>
120+
</ItemGroup>
121+
<ItemGroup>
122+
<Folder Include="Resources\" />
123+
</ItemGroup>
124+
<ItemGroup>
125+
<InterfaceDefinition Include="LaunchScreen.storyboard" />
126+
<InterfaceDefinition Include="Main.storyboard" />
127+
</ItemGroup>
128+
<ItemGroup>
129+
<None Include="Info.plist" />
130+
<None Include="Entitlements.plist" />
131+
</ItemGroup>
132+
<ItemGroup>
133+
<Compile Include="Main.cs" />
134+
<Compile Include="AppDelegate.cs" />
135+
<Compile Include="LoginViewController.cs" />
136+
<Compile Include="LoginViewController.designer.cs">
137+
<DependentUpon>LoginViewController.cs</DependentUpon>
138+
</Compile>
139+
<Compile Include="ResultViewController.cs" />
140+
<Compile Include="ResultViewController.designer.cs">
141+
<DependentUpon>ResultViewController.cs</DependentUpon>
142+
</Compile>
143+
<Compile Include="KeychainItem.cs" />
144+
<Compile Include="KeychainException.cs" />
145+
</ItemGroup>
146+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
147+
</Project>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using AuthenticationServices;
2+
using CoreFoundation;
3+
using Foundation;
4+
using UIKit;
5+
6+
namespace AddingTheSignInWithAppleFlowToYourApp {
7+
// The UIApplicationDelegate for the application. This class is responsible for launching the
8+
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
9+
[Register ("AppDelegate")]
10+
public class AppDelegate : UIApplicationDelegate {
11+
// class-level declarations
12+
13+
public override UIWindow Window {
14+
get;
15+
set;
16+
}
17+
18+
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
19+
{
20+
// Override point for customization after application launch.
21+
// If not required for your application you can safely delete this method
22+
23+
var appleIdProvider = new ASAuthorizationAppleIdProvider ();
24+
appleIdProvider.GetCredentialState (KeychainItem.CurrentUserIdentifier, (credentialState, error) => {
25+
switch (credentialState) {
26+
case ASAuthorizationAppleIdProviderCredentialState.Authorized:
27+
// The Apple ID credential is valid.
28+
break;
29+
case ASAuthorizationAppleIdProviderCredentialState.Revoked:
30+
// The Apple ID credential is revoked.
31+
break;
32+
case ASAuthorizationAppleIdProviderCredentialState.NotFound:
33+
// No credential was found, so show the sign-in UI.
34+
InvokeOnMainThread (() => {
35+
var storyboard = UIStoryboard.FromName ("Main", null);
36+
37+
if (!(storyboard.InstantiateViewController (nameof (LoginViewController)) is LoginViewController viewController))
38+
return;
39+
40+
viewController.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
41+
viewController.ModalInPresentation = true;
42+
Window?.RootViewController?.PresentViewController (viewController, true, null);
43+
});
44+
break;
45+
}
46+
});
47+
48+
return true;
49+
}
50+
51+
public override void OnResignActivation (UIApplication application)
52+
{
53+
// Invoked when the application is about to move from active to inactive state.
54+
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
55+
// or when the user quits the application and it begins the transition to the background state.
56+
// Games should use this method to pause the game.
57+
}
58+
59+
public override void DidEnterBackground (UIApplication application)
60+
{
61+
// Use this method to release shared resources, save user data, invalidate timers and store the application state.
62+
// If your application supports background execution this method is called instead of WillTerminate when the user quits.
63+
}
64+
65+
public override void WillEnterForeground (UIApplication application)
66+
{
67+
// Called as part of the transition from background to active state.
68+
// Here you can undo many of the changes made on entering the background.
69+
}
70+
71+
public override void OnActivated (UIApplication application)
72+
{
73+
// Restart any tasks that were paused (or not yet started) while the application was inactive.
74+
// If the application was previously in the background, optionally refresh the user interface.
75+
}
76+
77+
public override void WillTerminate (UIApplication application)
78+
{
79+
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
80+
}
81+
}
82+
}
83+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"images": [
3+
{
4+
"scale": "2x",
5+
"size": "20x20",
6+
"idiom": "iphone",
7+
"filename": "Icon40.png"
8+
},
9+
{
10+
"scale": "3x",
11+
"size": "20x20",
12+
"idiom": "iphone",
13+
"filename": "Icon60.png"
14+
},
15+
{
16+
"scale": "2x",
17+
"size": "29x29",
18+
"idiom": "iphone",
19+
"filename": "Icon58.png"
20+
},
21+
{
22+
"scale": "3x",
23+
"size": "29x29",
24+
"idiom": "iphone",
25+
"filename": "Icon87.png"
26+
},
27+
{
28+
"scale": "2x",
29+
"size": "40x40",
30+
"idiom": "iphone",
31+
"filename": "Icon80.png"
32+
},
33+
{
34+
"scale": "3x",
35+
"size": "40x40",
36+
"idiom": "iphone",
37+
"filename": "Icon120.png"
38+
},
39+
{
40+
"scale": "2x",
41+
"size": "60x60",
42+
"idiom": "iphone",
43+
"filename": "Icon120.png"
44+
},
45+
{
46+
"scale": "3x",
47+
"size": "60x60",
48+
"idiom": "iphone",
49+
"filename": "Icon180.png"
50+
},
51+
{
52+
"scale": "1x",
53+
"size": "20x20",
54+
"idiom": "ipad",
55+
"filename": "Icon20.png"
56+
},
57+
{
58+
"scale": "2x",
59+
"size": "20x20",
60+
"idiom": "ipad",
61+
"filename": "Icon40.png"
62+
},
63+
{
64+
"scale": "1x",
65+
"size": "29x29",
66+
"idiom": "ipad",
67+
"filename": "Icon29.png"
68+
},
69+
{
70+
"scale": "2x",
71+
"size": "29x29",
72+
"idiom": "ipad",
73+
"filename": "Icon58.png"
74+
},
75+
{
76+
"scale": "1x",
77+
"size": "40x40",
78+
"idiom": "ipad",
79+
"filename": "Icon40.png"
80+
},
81+
{
82+
"scale": "2x",
83+
"size": "40x40",
84+
"idiom": "ipad",
85+
"filename": "Icon80.png"
86+
},
87+
{
88+
"scale": "1x",
89+
"size": "76x76",
90+
"idiom": "ipad",
91+
"filename": "Icon76.png"
92+
},
93+
{
94+
"scale": "2x",
95+
"size": "76x76",
96+
"idiom": "ipad",
97+
"filename": "Icon152.png"
98+
},
99+
{
100+
"scale": "2x",
101+
"size": "83.5x83.5",
102+
"idiom": "ipad",
103+
"filename": "Icon167.png"
104+
},
105+
{
106+
"scale": "1x",
107+
"size": "1024x1024",
108+
"idiom": "ios-marketing",
109+
"filename": "Icon1024.png"
110+
}
111+
],
112+
"properties": {},
113+
"info": {
114+
"version": 1,
115+
"author": "xcode"
116+
}
117+
}
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)