Skip to content

Commit

Permalink
Merge pull request #21 from sieren/update-ios-12
Browse files Browse the repository at this point in the history
Update ios 12
  • Loading branch information
sieren authored Oct 29, 2023
2 parents 0ce962e + bee73fe commit 7f9e45b
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 55 deletions.
15 changes: 7 additions & 8 deletions midimittr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -281,7 +281,7 @@
TargetAttributes = {
694947DB19DD7A4E00A6E65C = {
CreatedOnToolsVersion = 6.0.1;
LastSwiftMigration = 0920;
LastSwiftMigration = 1500;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
Expand All @@ -292,10 +292,9 @@
};
buildConfigurationList = 694947D719DD7A4E00A6E65C /* Build configuration list for PBXProject "midimittr" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -513,7 +512,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
INFOPLIST_FILE = "$(SRCROOT)/midimittr/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -525,7 +524,7 @@
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "midimittr/midimittr-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -552,7 +551,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
INFOPLIST_FILE = "$(SRCROOT)/midimittr/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -563,7 +562,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "midimittr/midimittr-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"object": {
"pins": [
{
"package": "MarqueeLabel",
"repositoryURL": "https://github.com/cbpowell/MarqueeLabel",
"state": {
"branch": null,
"revision": "d92fe1583dbf43fa3b70229a49fa7da6b36750d4",
"version": "4.0.5"
}
},
{
"package": "NotificationBannerSwift",
"repositoryURL": "https://github.com/Daltron/NotificationBanner",
"state": {
"branch": null,
"revision": "2ce5c49d8ee4865f01a3ce3bbe078664c78c7a3c",
"version": "3.0.6"
}
},
{
"package": "SnapKit",
"repositoryURL": "https://github.com/SnapKit/SnapKit",
"state": {
"branch": null,
"revision": "d458564516e5676af9c70b4f4b2a9178294f1bc6",
"version": "5.0.1"
}
"pins" : [
{
"identity" : "marqueelabel",
"kind" : "remoteSourceControl",
"location" : "https://github.com/cbpowell/MarqueeLabel",
"state" : {
"revision" : "ae3cf7c647dd7f67f1946658285f5f0ce2476caf",
"version" : "4.4.0"
}
]
},
"version": 1
},
{
"identity" : "notificationbanner",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Daltron/NotificationBanner",
"state" : {
"revision" : "1406ac60bcab58074fc969e9b4cb804679832c8e",
"version" : "3.2.1"
}
},
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SnapKit/SnapKit",
"state" : {
"revision" : "f222cbdf325885926566172f6f5f06af95473158",
"version" : "5.6.0"
}
}
],
"version" : 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,53 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "630EBA4E-FFAD-4990-BD36-114517D24E93"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "midimittr/BLEAdvertViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
endingLineNumber = "16"
landmarkName = "viewWillAppear(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "522A1A3E-CB4F-4508-A975-07236FB7E6A6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "midimittr/BLEAdvertViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "17"
endingLineNumber = "17"
landmarkName = "viewWillAppear(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4E05D13A-8146-4DE2-A773-8F07AA78B710"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "midimittr/BLEAdvertViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "10"
endingLineNumber = "10"
landmarkName = "viewWillAppear(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
4 changes: 3 additions & 1 deletion midimittr/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import NotificationBannerSwift
import CoreAudioKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, PeerTalkConnectionProtocol {
Expand All @@ -12,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, PeerTalkConnectionProtoco
let appDefaults = [String: AnyObject]()

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
registerSettingsBundle()
appContext.peerTalkBridge.connectionViewDelegate = self
//swiftlint:disable:next force_cast
Expand All @@ -31,6 +32,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, PeerTalkConnectionProtoco
let root = self.window?.rootViewController as! NavController
//swiftlint:disable:next force_cast
let tabController = root.viewControllers[0] as! TabController
tabController.viewControllers![1] = CABTMIDILocalPeripheralViewController()
switch shortcutItem.type {
case "com.matt.midimittr.advertise":
tabController.selectedIndex = 1
Expand Down
15 changes: 7 additions & 8 deletions midimittr/BLEAdvertViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
import UIKit
import CoreAudioKit

class BLEAdvertViewController: UIViewController {
class BLEAdvertViewController: CABTMIDILocalPeripheralViewController {

private var bleVC = CABTMIDILocalPeripheralViewController()

override func viewDidLoad() {
super.viewDidLoad()
bleVC.view.frame = self.view.frame
view.addSubview(bleVC.view)
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// for subView in view.subviews {
// subView.removeFromSuperview()
// }
// var bleVC = CABTMIDILocalPeripheralViewController()
// bleVC.view.frame = self.view.frame
// view.addSubview(bleVC.view)
self.navigationController!.navigationBar.topItem?.title = "Bluetooth Advertising"
}
}
6 changes: 3 additions & 3 deletions midimittr/Base.lproj/MainNew.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="i92-3K-T0V">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="i92-3K-T0V">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -136,7 +136,7 @@
<!--Advertising-->
<scene sceneID="Q3q-2Y-tpF">
<objects>
<viewController title="Advertising" id="MGW-dE-Ylo" customClass="BLEAdvertViewController" customModule="midimittr" customModuleProvider="target" sceneMemberID="viewController">
<viewController title="Advertising" id="MGW-dE-Ylo" customClass="CABTMIDILocalPeripheralViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="RUh-Km-0aY"/>
<viewControllerLayoutGuide type="bottom" id="brl-cJ-ULG"/>
Expand Down
4 changes: 2 additions & 2 deletions midimittr/NavController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class NavController: UINavigationController {
//swiftlint:disable:next force_cast
let tabController = self.viewControllers[0] as! TabController
tabController.appContext = appContext
let attributeThin = [ NSAttributedStringKey.font: UIFont.systemFont(ofSize: 18, weight: .light) ]
let attributeBold = [ NSAttributedStringKey.font: UIFont.systemFont(ofSize: 18, weight: .bold) ]
let attributeThin = [ NSAttributedString.Key.font: UIFont.systemFont(ofSize: 18, weight: .light) ]
let attributeBold = [ NSAttributedString.Key.font: UIFont.systemFont(ofSize: 18, weight: .bold) ]
let midiStr = NSMutableAttributedString(string: "midi", attributes: attributeThin)
let mittrStr = NSAttributedString(string: "mittr", attributes: attributeBold)
midiStr.append(mittrStr)
Expand Down
2 changes: 2 additions & 0 deletions midimittr/NavControllerExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ extension UINavigationController {
if #available(iOS 12.0, *) {
let userInterfaceStyle = traitCollection.userInterfaceStyle
if userInterfaceStyle == .dark {
self.view.backgroundColor = UIColor.DarkColors.backgroundColor
self.navigationBar.tintColor = UIColor.DarkColors.tintColor
self.self.navigationBar.backgroundColor = UIColor.DarkColors.backgroundColor
}
if userInterfaceStyle == .light {
self.view.backgroundColor = UIColor.LightColors.backgroundColor
self.navigationBar.tintColor = UIColor.LightColors.tintColor
self.self.navigationBar.backgroundColor = UIColor.LightColors.backgroundColor
}
Expand Down
4 changes: 2 additions & 2 deletions midimittr/TabController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class TabController: UITabBarController {
}

@objc func openSettings() {
UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
}

@objc func openWebPage() {
let url = URL(string: "http://www.s-r-n.de/midimittr")!
let alert = UIAlertController(title: "midiMittr Website",
message: "Open midiMittr Website?", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) in
UIApplication.shared.openURL(url)
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
present(alert, animated: false, completion: nil)
Expand Down

0 comments on commit 7f9e45b

Please sign in to comment.