Skip to content

Commit

Permalink
Remove SceneDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed Nov 20, 2024
1 parent bc98c45 commit 24dd24d
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 252 deletions.
1 change: 0 additions & 1 deletion samples/Fabulous.Avalonia.Samples.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<None Include="$(iOSPlatformFolder)Entitlements.plist" />
<None Include="$(iOSPlatformFolder)Info.plist" />
<InterfaceDefinition Include="$(iOSPlatformFolder)*.storyboard;$(iOSPlatformFolder)*.xib" />
<Compile Include="$(iOSPlatformFolder)SceneDelegate.fs" />
<Compile Include="$(iOSPlatformFolder)AppDelegate.fs" />
<PackageReference Include="Avalonia.iOS" />
</ItemGroup>
Expand Down
16 changes: 6 additions & 10 deletions samples/Gallery/Platform/iOS/AppDelegate.fs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
namespace Gallery.iOS

open Avalonia
open Avalonia.iOS
open Fabulous.Avalonia
open Foundation
open Gallery
open UIKit

[<Register(nameof AppDelegate)>]
type AppDelegate() =
inherit UIResponder()

interface IUIApplicationDelegate

[<Export("application:didFinishLaunchingWithOptions:")>]
member this.FinishedLaunching(_: UIApplication, _: NSDictionary) : bool = true

[<Export("application:configurationForConnectingSceneSession:options:")>]
member this.GetConfiguration(_: UIApplication, sceneSession: UISceneSession, _: UISceneConnectionOptions) =
UISceneConfiguration.Create("Default Configuration", sceneSession.Role)
inherit AvaloniaAppDelegate<FabApplication>()
override this.CreateAppBuilder() = MainView.create().UseiOS()

module Main =
[<EntryPoint>]
Expand Down
19 changes: 1 addition & 18 deletions samples/Gallery/Platform/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,7 @@
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>CFBundleExecutable</key>
<string></string>
<string/>
</dict>
</plist>
39 changes: 0 additions & 39 deletions samples/Gallery/Platform/iOS/SceneDelegate.fs

This file was deleted.

16 changes: 6 additions & 10 deletions samples/Playground/Platform/iOS/AppDelegate.fs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
namespace Playground.iOS

open Avalonia
open Avalonia.iOS
open Fabulous.Avalonia
open Foundation
open Playground
open UIKit

[<Register(nameof AppDelegate)>]
type AppDelegate() =
inherit UIResponder()

interface IUIApplicationDelegate

[<Export("application:didFinishLaunchingWithOptions:")>]
member this.FinishedLaunching(_: UIApplication, _: NSDictionary) : bool = true

[<Export("application:configurationForConnectingSceneSession:options:")>]
member this.GetConfiguration(_: UIApplication, sceneSession: UISceneSession, _: UISceneConnectionOptions) =
UISceneConfiguration.Create("Default Configuration", sceneSession.Role)
inherit AvaloniaAppDelegate<FabApplication>()
override this.CreateAppBuilder() = App.create().UseiOS()

module Main =
[<EntryPoint>]
Expand Down
17 changes: 0 additions & 17 deletions samples/Playground/Platform/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,5 @@
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
39 changes: 0 additions & 39 deletions samples/Playground/Platform/iOS/SceneDelegate.fs

This file was deleted.

16 changes: 6 additions & 10 deletions samples/RenderDemo.iOS/AppDelegate.fs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
namespace RenderDemo.iOS

open Avalonia
open Avalonia.iOS
open Fabulous.Avalonia
open Foundation
open RenderDemo
open UIKit

[<Register(nameof AppDelegate)>]
type AppDelegate() =
inherit UIResponder()

interface IUIApplicationDelegate

[<Export("application:didFinishLaunchingWithOptions:")>]
member this.FinishedLaunching(_: UIApplication, _: NSDictionary) : bool = true

[<Export("application:configurationForConnectingSceneSession:options:")>]
member this.GetConfiguration(_: UIApplication, sceneSession: UISceneSession, _: UISceneConnectionOptions) =
UISceneConfiguration.Create("Default Configuration", sceneSession.Role)
inherit AvaloniaAppDelegate<FabApplication>()
override this.CreateAppBuilder() = MainView.create().UseiOS()

module Main =
[<EntryPoint>]
Expand Down
17 changes: 0 additions & 17 deletions samples/RenderDemo.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,5 @@
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
1 change: 0 additions & 1 deletion samples/RenderDemo.iOS/RenderDemo.iOS.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
<Compile Include="SceneDelegate.fs" />
<Compile Include="AppDelegate.fs" />
</ItemGroup>
<PropertyGroup Condition=" '$(AvaloniaPlatform)|$(Configuration)' == 'iOS|Debug' ">
Expand Down
38 changes: 0 additions & 38 deletions samples/RenderDemo.iOS/SceneDelegate.fs

This file was deleted.

38 changes: 0 additions & 38 deletions src/Fabulous.Avalonia/AppBuilderExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,41 +90,3 @@ type FabulousAppBuilder private () =

static member Configure(themeFn: unit -> #IStyle, program: Program<unit, 'model, 'msg, Memo.Memoized<#IFabApplication>>) =
FabulousAppBuilder.Configure(themeFn, program, ())

// #if IOS
// open UIKit
// open Avalonia.iOS
//
// type SingleViewLifetime() =
// member val View: AvaloniaView = null with get, set
//
// interface Avalonia.Controls.ApplicationLifetimes.ISingleViewApplicationLifetime with
// member this.MainView
// with get () = this.View.Content
// and set value =
// if not(isNull this.View) then
// this.View.Content <- value
//
// [<AutoOpen>]
// module FabulousiOSAppBuilderExtensions =
// type AppBuilder with
//
// member this.UseiOS(sceneDelegate: UIWindowSceneDelegate, scene: UIWindowScene) =
// let lifetime = SingleViewLifetime()
//
// this
// .UseiOS()
// .AfterSetup(fun _ ->
// let view = new AvaloniaView()
// lifetime.View <- view
//
// let win = new UIWindow(WindowScene = scene)
//
// let controller = new DefaultAvaloniaViewController(View = view)
// win.RootViewController <- controller
// view.InitWithController(controller)
//
// sceneDelegate.Window <- win
// win.MakeKeyAndVisible())
// .SetupWithLifetime(lifetime)
// #endif
4 changes: 2 additions & 2 deletions src/Fabulous.Avalonia/Attributes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ module Attributes =
|> AttributeDefinitionStore.registerScalar

{ Key = key; Name = name }


let defineRoutedEventNoArg name (property: RoutedEvent) : SimpleScalarAttributeDefinition<MsgValue> =
let key =
Expand Down Expand Up @@ -492,7 +492,7 @@ module Attributes =
|> AttributeDefinitionStore.registerScalar

{ Key = key; Name = name }

let defineRoutedEventNoArg name (property: RoutedEvent) : SimpleScalarAttributeDefinition<unit -> unit> =
let key =
SimpleScalarAttributeDefinition.CreateAttributeData(
Expand Down
14 changes: 8 additions & 6 deletions src/Fabulous.Avalonia/Views/Controls/Tooltip.Components.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ open Fabulous

module ComponentToolTip =

let Opening = Attributes.Component.defineRoutedEvent "ToolTip_TipWidget" ToolTip.ToolTipOpeningEvent

let Closing = Attributes.Component.defineRoutedEventNoArg "ToolTip_TipWidget" ToolTip.ToolTipClosingEvent
let Opening =
Attributes.Component.defineRoutedEvent "ToolTip_TipWidget" ToolTip.ToolTipOpeningEvent

let Closing =
Attributes.Component.defineRoutedEventNoArg "ToolTip_TipWidget" ToolTip.ToolTipClosingEvent

type ComponentToolTipModifiers =
/// <summary>Listens to the Opening event.</summary>
/// <param name="this">Current widget.</param>
/// <param name="fn">The TooltipOpening event handler.</param>
[<Extension>]
static member inline tooltipOpening(this: WidgetBuilder<'msg, #IFabToolTip>, fn : CancelRoutedEventArgs -> unit) =
static member inline tooltipOpening(this: WidgetBuilder<'msg, #IFabToolTip>, fn: CancelRoutedEventArgs -> unit) =
this.AddScalar(ComponentToolTip.Opening.WithValue(fn))

/// <summary>Listens to the Closing event.</summary>
/// <param name="this">Current widget.</param>
/// <param name="fn">The TooltipClosing event handler.</param>
[<Extension>]
static member inline tooltipClosing(this: WidgetBuilder<'msg, #IFabToolTip>, fn : unit -> unit) =
this.AddScalar(ComponentToolTip.Closing.WithValue(fn))
static member inline tooltipClosing(this: WidgetBuilder<'msg, #IFabToolTip>, fn: unit -> unit) =
this.AddScalar(ComponentToolTip.Closing.WithValue(fn))
Loading

0 comments on commit 24dd24d

Please sign in to comment.