Skip to content

Commit 8409ff4

Browse files
authored
Merge pull request #107 from analogcode/dev
Update to Xcode 10 and Swift 4.2
2 parents 91eecf7 + a5751d0 commit 8409ff4

24 files changed

+213
-198
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Swift Radio
22

3-
Swift Radio is an open source radio station app with robust and professional features. This is a fully realized Radio App built entirely in Swift. **Master is now the Xcode 9 / Swift 4 branch**.
3+
Swift Radio is an open source radio station app with robust and professional features. This is a fully realized Radio App built entirely in Swift. **master is now the Xcode 10 / Swift 4.2 branch**.
44

55
There are over 80 different apps accepted to the app store using this code!
66

@@ -18,7 +18,7 @@ Give it a quick watch.
1818
- Ability to update Stations from server or locally. (Update stations anytime without resubmitting to app store!)
1919
- Displays Artist, Track & Album Art on Lock Screen
2020
- Custom views optimized for 5, 6 and 6+ for backwards compatibility
21-
- Compiles with Xcode 9 & Swift 4
21+
- Compiles with Xcode 10 & Swift 4.2
2222
- Parses JSON using Swift 4 Codable protocol
2323
- Background audio performance
2424
- Search Bar that can be turned on or off to search stations
@@ -33,6 +33,7 @@ Give it a quick watch.
3333
* Download and cache images using ImageLoader class
3434

3535
## Important Notes
36+
- 1.9.19: master branch migrated to Xcode 10/Swift 4.2 by [@fethica](https://github.com/fethica).
3637
- 1.21.18 Update: Swift Radio App gets a major update with **Version 2** by [@fethica](https://github.com/fethica) -- [Release Note](https://github.com/analogcode/Swift-Radio-Pro/releases/tag/2.0.0).
3738
- 10.6.17 Update: The AVPlayer branch migrated to Xcode 9/Swift 4 by [@joemcmahon](https://github.com/joemcmahon).
3839
Branch here: [AVPlayer Branch](https://github.com/swiftcodex/Swift-Radio-Pro/tree/xcode8)
@@ -63,7 +64,7 @@ Thanks to everyone! We couldn't do it without you!
6364

6465
## Requirements
6566

66-
- Xcode 9
67+
- Xcode 10
6768
- Know a little bit of how to program in Swift with the iOS SDK
6869

6970
Please note: I am unable to offer any free support or modifications. Thanks!
@@ -130,7 +131,8 @@ Q: The song names aren't appearing for my station?
130131
A: Check with your stream provider to make sure they are sending Metadata properly. If a station sends data in a unique way, you can modify the way the app parses the metadata, in the `RadioPlayer` class implement `FRadioPlayerDelegate` method: `radioPlayer(_ player: FRadioPlayer, metadataDidChange rawValue: String?)`.
131132

132133
## Single Station Code
133-
We can create a single station version of this code for you for a small fee. Send a friendly email to [Matthew](mailto:[email protected]) or [Fethi](https://fethica.com/en).
134+
We can create a single station version of this code for you for a small fee. Send a friendly email to [Matthew](mailto:[email protected]) or [Fethi](https://fethica.com/en).
135+
134136

135137
## RadioKit SDK Example
136138

SwiftRadio.xcodeproj/project.pbxproj

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
5F22BA551F72AD5A00CB5911 /* AutoTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F22BA3A1F72AD5800CB5911 /* AutoTextView.swift */; };
3737
5F22BA561F72AD5A00CB5911 /* DesignableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F22BA3B1F72AD5900CB5911 /* DesignableView.swift */; };
3838
5FDEE0221F72FF980064333C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5FDEE0211F72FF980064333C /* LaunchScreen.storyboard */; };
39+
81AD229B21646DEA002ADFDD /* FRadioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81AD229821646DEA002ADFDD /* FRadioPlayer.swift */; };
40+
81AD229C21646DEA002ADFDD /* FRadioAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81AD229921646DEA002ADFDD /* FRadioAPI.swift */; };
41+
81AD229D21646DEA002ADFDD /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81AD229A21646DEA002ADFDD /* Reachability.swift */; };
3942
9409E11C1ABF6FEA00312E2B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9409E11B1ABF6FEA00312E2B /* AppDelegate.swift */; };
4043
9409E1241ABF6FEA00312E2B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9409E1221ABF6FEA00312E2B /* Main.storyboard */; };
4144
9409E1261ABF6FEA00312E2B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9409E1251ABF6FEA00312E2B /* Images.xcassets */; };
@@ -54,9 +57,6 @@
5457
94D260981B45E8B800DE671C /* Track.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D260971B45E8B800DE671C /* Track.swift */; };
5558
94D30EA71AD07A880024FE96 /* StationTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D30EA61AD07A880024FE96 /* StationTableViewCell.swift */; };
5659
94E9761C1B1A8F3200F52B1E /* UIImage+DropShadow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E9761B1B1A8F3200F52B1E /* UIImage+DropShadow.swift */; };
57-
CA512B5B2043AB4B00D425A4 /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA512B5A2043AB4B00D425A4 /* Reachability.swift */; };
58-
CAA7C15D1FD77F3A003CABDF /* FRadioAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA7C15B1FD77F3A003CABDF /* FRadioAPI.swift */; };
59-
CAA7C15E1FD77F3A003CABDF /* FRadioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA7C15C1FD77F3A003CABDF /* FRadioPlayer.swift */; };
6060
CAA8FDB52000614600050F77 /* RadioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAA8FDB42000614600050F77 /* RadioPlayer.swift */; };
6161
/* End PBXBuildFile section */
6262

@@ -105,6 +105,9 @@
105105
5F22BA3A1F72AD5800CB5911 /* AutoTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTextView.swift; sourceTree = "<group>"; };
106106
5F22BA3B1F72AD5900CB5911 /* DesignableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DesignableView.swift; sourceTree = "<group>"; };
107107
5FDEE0211F72FF980064333C /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
108+
81AD229821646DEA002ADFDD /* FRadioPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FRadioPlayer.swift; sourceTree = "<group>"; };
109+
81AD229921646DEA002ADFDD /* FRadioAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FRadioAPI.swift; sourceTree = "<group>"; };
110+
81AD229A21646DEA002ADFDD /* Reachability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };
108111
9409E1161ABF6FEA00312E2B /* SwiftRadio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftRadio.app; sourceTree = BUILT_PRODUCTS_DIR; };
109112
9409E11A1ABF6FEA00312E2B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
110113
9409E11B1ABF6FEA00312E2B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -126,9 +129,6 @@
126129
94D30EA61AD07A880024FE96 /* StationTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StationTableViewCell.swift; sourceTree = "<group>"; };
127130
94E9761B1B1A8F3200F52B1E /* UIImage+DropShadow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+DropShadow.swift"; sourceTree = "<group>"; };
128131
B90086461BBE40AF00E5372C /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
129-
CA512B5A2043AB4B00D425A4 /* Reachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };
130-
CAA7C15B1FD77F3A003CABDF /* FRadioAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FRadioAPI.swift; sourceTree = "<group>"; };
131-
CAA7C15C1FD77F3A003CABDF /* FRadioPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FRadioPlayer.swift; sourceTree = "<group>"; };
132132
CAA8FDB42000614600050F77 /* RadioPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioPlayer.swift; sourceTree = "<group>"; };
133133
/* End PBXFileReference section */
134134

@@ -312,9 +312,9 @@
312312
CAA7C15A1FD77F3A003CABDF /* FRadioPlayer */ = {
313313
isa = PBXGroup;
314314
children = (
315-
CAA7C15B1FD77F3A003CABDF /* FRadioAPI.swift */,
316-
CAA7C15C1FD77F3A003CABDF /* FRadioPlayer.swift */,
317-
CA512B5A2043AB4B00D425A4 /* Reachability.swift */,
315+
81AD229921646DEA002ADFDD /* FRadioAPI.swift */,
316+
81AD229821646DEA002ADFDD /* FRadioPlayer.swift */,
317+
81AD229A21646DEA002ADFDD /* Reachability.swift */,
318318
);
319319
path = FRadioPlayer;
320320
sourceTree = "<group>";
@@ -365,7 +365,7 @@
365365
attributes = {
366366
LastSwiftMigration = 0700;
367367
LastSwiftUpdateCheck = 0710;
368-
LastUpgradeCheck = 0900;
368+
LastUpgradeCheck = 1000;
369369
ORGANIZATIONNAME = matthewfecher.com;
370370
TargetAttributes = {
371371
2C5545B91C1124DE00728469 = {
@@ -375,7 +375,7 @@
375375
};
376376
9409E1151ABF6FEA00312E2B = {
377377
CreatedOnToolsVersion = 6.2;
378-
DevelopmentTeam = G24WJ3XCZ3;
378+
DevelopmentTeam = G24WJ3XCZ3;
379379
LastSwiftMigration = 0900;
380380
SystemCapabilities = {
381381
com.apple.BackgroundModes = {
@@ -462,11 +462,10 @@
462462
5F22BA561F72AD5A00CB5911 /* DesignableView.swift in Sources */,
463463
5F22BA521F72AD5A00CB5911 /* UnwindSegue.swift in Sources */,
464464
94E9761C1B1A8F3200F52B1E /* UIImage+DropShadow.swift in Sources */,
465-
CA512B5B2043AB4B00D425A4 /* Reachability.swift in Sources */,
465+
81AD229D21646DEA002ADFDD /* Reachability.swift in Sources */,
466466
94452E551AD7086800BFE7A5 /* AboutViewController.swift in Sources */,
467467
5F22BA551F72AD5A00CB5911 /* AutoTextView.swift in Sources */,
468468
94D260981B45E8B800DE671C /* Track.swift in Sources */,
469-
CAA7C15E1FD77F3A003CABDF /* FRadioPlayer.swift in Sources */,
470469
5F22BA3F1F72AD5A00CB5911 /* LoadingView.swift in Sources */,
471470
CAA8FDB52000614600050F77 /* RadioPlayer.swift in Sources */,
472471
5F22BA4F1F72AD5A00CB5911 /* TransitionManager.swift in Sources */,
@@ -480,9 +479,10 @@
480479
94D260961B45E3FA00DE671C /* AnimationFrames.swift in Sources */,
481480
5F22BA461F72AD5A00CB5911 /* AsyncButton.swift in Sources */,
482481
942A3F371AE43DF80011396E /* StationsViewController.swift in Sources */,
482+
81AD229B21646DEA002ADFDD /* FRadioPlayer.swift in Sources */,
483483
5F22BA501F72AD5A00CB5911 /* Spring.swift in Sources */,
484+
81AD229C21646DEA002ADFDD /* FRadioAPI.swift in Sources */,
484485
94AC70AE1AD05C6200652982 /* RadioStation.swift in Sources */,
485-
CAA7C15D1FD77F3A003CABDF /* FRadioAPI.swift in Sources */,
486486
5F22BA481F72AD5A00CB5911 /* DesignableButton.swift in Sources */,
487487
);
488488
runOnlyForDeploymentPostprocessing = 0;
@@ -555,12 +555,14 @@
555555
CLANG_WARN_BOOL_CONVERSION = YES;
556556
CLANG_WARN_COMMA = YES;
557557
CLANG_WARN_CONSTANT_CONVERSION = YES;
558+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
558559
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
559560
CLANG_WARN_EMPTY_BODY = YES;
560561
CLANG_WARN_ENUM_CONVERSION = YES;
561562
CLANG_WARN_INFINITE_RECURSION = YES;
562563
CLANG_WARN_INT_CONVERSION = YES;
563564
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
565+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
564566
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
565567
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
566568
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -587,7 +589,7 @@
587589
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
588590
GCC_WARN_UNUSED_FUNCTION = YES;
589591
GCC_WARN_UNUSED_VARIABLE = YES;
590-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
592+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
591593
MTL_ENABLE_DEBUG_INFO = YES;
592594
ONLY_ACTIVE_ARCH = YES;
593595
SDKROOT = iphoneos;
@@ -607,12 +609,14 @@
607609
CLANG_WARN_BOOL_CONVERSION = YES;
608610
CLANG_WARN_COMMA = YES;
609611
CLANG_WARN_CONSTANT_CONVERSION = YES;
612+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
610613
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
611614
CLANG_WARN_EMPTY_BODY = YES;
612615
CLANG_WARN_ENUM_CONVERSION = YES;
613616
CLANG_WARN_INFINITE_RECURSION = YES;
614617
CLANG_WARN_INT_CONVERSION = YES;
615618
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
619+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
616620
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
617621
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
618622
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -632,7 +636,7 @@
632636
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
633637
GCC_WARN_UNUSED_FUNCTION = YES;
634638
GCC_WARN_UNUSED_VARIABLE = YES;
635-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
639+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
636640
MTL_ENABLE_DEBUG_INFO = NO;
637641
SDKROOT = iphoneos;
638642
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -652,14 +656,14 @@
652656
"$(PROJECT_DIR)/SwiftRadio",
653657
);
654658
INFOPLIST_FILE = SwiftRadio/Info.plist;
655-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
659+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
656660
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
657661
PRODUCT_BUNDLE_IDENTIFIER = com.matthewfecher.SwiftRadio;
658662
PRODUCT_NAME = SwiftRadio;
659663
PROVISIONING_PROFILE = "";
660664
SWIFT_INSTALL_OBJC_HEADER = NO;
661665
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
662-
SWIFT_VERSION = 4.0;
666+
SWIFT_VERSION = 4.2;
663667
};
664668
name = Debug;
665669
};
@@ -675,14 +679,14 @@
675679
"$(PROJECT_DIR)/SwiftRadio",
676680
);
677681
INFOPLIST_FILE = SwiftRadio/Info.plist;
678-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
682+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
679683
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
680684
PRODUCT_BUNDLE_IDENTIFIER = com.matthewfecher.SwiftRadio;
681685
PRODUCT_NAME = SwiftRadio;
682686
PROVISIONING_PROFILE = "";
683687
SWIFT_INSTALL_OBJC_HEADER = NO;
684688
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
685-
SWIFT_VERSION = 4.0;
689+
SWIFT_VERSION = 4.2;
686690
};
687691
name = Release;
688692
};

SwiftRadio.xcodeproj/xcshareddata/xcschemes/SwiftRadio.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

SwiftRadio/AboutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AboutViewController: UIViewController {
4242
@IBAction func websiteButtonDidTouch(_ sender: UIButton) {
4343
// Use your own website here
4444
guard let url = URL(string: "http://matthewfecher.com") else { return }
45-
UIApplication.shared.openURL(url)
45+
UIApplication.shared.open(url, options: [:], completionHandler: nil)
4646
}
4747

4848
}

SwiftRadio/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515
weak var stationsViewController: StationsViewController?
1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818

1919
// MPNowPlayingInfoCenter
2020
UIApplication.shared.beginReceivingRemoteControlEvents()
@@ -72,7 +72,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7272
override func remoteControlReceived(with event: UIEvent?) {
7373
super.remoteControlReceived(with: event)
7474

75-
guard let event = event, event.type == UIEventType.remoteControl else { return }
75+
guard let event = event, event.type == .remoteControl else { return }
7676

7777
switch event.subtype {
7878
case .remoteControlPlay:

0 commit comments

Comments
 (0)