Skip to content

Commit f8f5607

Browse files
committed
#128 fixed usage of deprecated api
1 parent c26d960 commit f8f5607

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

permissions/src/iosMain/kotlin/dev/icerock/moko/permissions/ios/PermissionsController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PermissionsController : PermissionsControllerProtocol {
3232

3333
override fun openAppSettings() {
3434
val settingsUrl: NSURL = NSURL.URLWithString(UIApplicationOpenSettingsURLString)!!
35-
UIApplication.sharedApplication.openURL(settingsUrl)
35+
UIApplication.sharedApplication.openURL(settingsUrl, mapOf<Any?, Any>(), null)
3636
}
3737

3838
private fun getDelegate(permission: Permission): PermissionDelegate {

sample/ios-app/src/Resources/Base.lproj/Main.storyboard

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="zIh-nI-gcX">
3-
<device id="retina4_0" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="zIh-nI-gcX">
3+
<device id="retina4_0" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<scenes>
@@ -37,7 +35,7 @@
3735
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
3836
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
3937
<subviews>
40-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wrA-Wa-jvv">
38+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wrA-Wa-jvv">
4139
<rect key="frame" x="128" y="269" width="64" height="30"/>
4240
<state key="normal" title="Press me"/>
4341
<connections>
@@ -50,12 +48,24 @@
5048
<nil key="textColor"/>
5149
<nil key="highlightedColor"/>
5250
</label>
51+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jlX-n2-E1L">
52+
<rect key="frame" x="102" y="222" width="116.5" height="31"/>
53+
<state key="normal" title="Button"/>
54+
<buttonConfiguration key="configuration" style="plain" title="Open Settings">
55+
<fontDescription key="titleFontDescription" type="system" pointSize="14"/>
56+
</buttonConfiguration>
57+
<connections>
58+
<action selector="onOpenSettingsPressed" destination="TTy-86-aNs" eventType="touchUpInside" id="8gX-ul-uJn"/>
59+
</connections>
60+
</button>
5361
</subviews>
5462
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
5563
<constraints>
5664
<constraint firstItem="wrA-Wa-jvv" firstAttribute="centerY" secondItem="KxK-oh-5KO" secondAttribute="centerY" id="0g2-Uu-Q0F"/>
5765
<constraint firstItem="wrA-Wa-jvv" firstAttribute="centerX" secondItem="KxK-oh-5KO" secondAttribute="centerX" id="FGq-2f-QAF"/>
66+
<constraint firstItem="wrA-Wa-jvv" firstAttribute="top" secondItem="jlX-n2-E1L" secondAttribute="bottom" constant="16" id="Qps-Mk-tYJ"/>
5867
<constraint firstItem="SC7-EO-Tfy" firstAttribute="centerX" secondItem="KxK-oh-5KO" secondAttribute="centerX" id="Qw1-Gl-wBe"/>
68+
<constraint firstItem="jlX-n2-E1L" firstAttribute="centerX" secondItem="KxK-oh-5KO" secondAttribute="centerX" id="WvE-2P-C0q"/>
5969
<constraint firstItem="SC7-EO-Tfy" firstAttribute="top" secondItem="wrA-Wa-jvv" secondAttribute="bottom" constant="8" id="hoL-Vh-IjN"/>
6070
</constraints>
6171
</view>

sample/ios-app/src/TestViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ class TestViewController: UIViewController {
2525
@IBAction func onPermissionPressed() {
2626
viewModel.onRequestPermissionButtonPressed()
2727
}
28+
29+
@IBAction func onOpenSettingsPressed() {
30+
PermissionsController().openAppSettings()
31+
}
2832
}
2933

3034
extension TestViewController: SampleViewModelEventListener {

0 commit comments

Comments
 (0)