Skip to content

Commit

Permalink
updates for iOS 11.3 and Xcode 9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
martinobonfiglioli committed Apr 16, 2018
1 parent 827e088 commit 41fc0ca
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
33 changes: 17 additions & 16 deletions MXMLyricsAction/MXMLyricsAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,23 @@ - (void)findLyricsForSong:(NSDictionary*)dict
[self setHostViewController:viewController];

if (showAlertBeforeAppStore) {
UIAlertView *storeAlert = [[UIAlertView alloc] initWithTitle:@"Musixmatch app is required"
message:@"To read the lyrics you need to install Musixmatch from the AppStore."
delegate:self
cancelButtonTitle:@"No, thanks"
otherButtonTitles:@"Get the app", nil];
[storeAlert show];
UIAlertController *storeAlert = [UIAlertController alertControllerWithTitle:@"Musixmatch app is required"
message:@"To read the lyrics you need to install Musixmatch from the AppStore."
preferredStyle:UIAlertControllerStyleAlert];

[storeAlert addAction:[UIAlertAction actionWithTitle:@"No, thanks"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
}]];
[storeAlert addAction:[UIAlertAction actionWithTitle:@"Get the app"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self openAppStore];
}]];
[viewController presentViewController:storeAlert
animated:YES
completion:nil];

}else {
[self openAppStore];
}
Expand Down Expand Up @@ -254,14 +265,4 @@ - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewContr
[viewController dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - UIAlertView Delegate

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {

if (buttonIndex==1) {
[self openAppStore];
}

}

@end
22 changes: 19 additions & 3 deletions MXMLyricsActionDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
61FAAD861A0108E10063206F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = musixmatch;
TargetAttributes = {
61FAAD8D1A0108E10063206F = {
Expand Down Expand Up @@ -334,14 +334,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -380,14 +388,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -459,7 +475,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer: Loreto Parisi (HFX54548Y7)";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
Expand Down Expand Up @@ -487,7 +503,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Distribution: MUSIXMATCH SPA";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
6 changes: 3 additions & 3 deletions MXMLyricsActionDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ - (IBAction)switchStyleChanged:(id)sender {
if (!swtch.isOn) {

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
titleTrack.textColor = artist.textColor = album.textColor = style.textColor = [UIColor blackColor];
self->titleTrack.textColor = self->artist.textColor = self->album.textColor = self->style.textColor = [UIColor blackColor];

[self.view setBackgroundColor:[UIColor whiteColor]];

}else {

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
titleTrack.textColor = artist.textColor = album.textColor = style.textColor = [UIColor whiteColor];
self->titleTrack.textColor = self->artist.textColor = self->album.textColor = self->style.textColor = [UIColor whiteColor];

[self.view setBackgroundColor:[UIColor colorWithWhite:0.1f alpha:1.0f]];

Expand Down Expand Up @@ -228,7 +228,7 @@ - (void)updateProgress:(NSTimer *)_timer {
NSTimeInterval progress = [[MPMusicPlayerController systemMusicPlayer] currentPlaybackTime];
NSTimeInterval duration = [[MPMusicPlayerController systemMusicPlayer] nowPlayingItem].playbackDuration;
if ( progress >=0.0 && duration>0.0) {
[trackProgress setValue: progress / duration animated:YES];
[self->trackProgress setValue: progress / duration animated:YES];
[self playerUpdateInfo];
}
});
Expand Down

0 comments on commit 41fc0ca

Please sign in to comment.