Skip to content

Commit

Permalink
Modernize code to improve Swift interoperability
Browse files Browse the repository at this point in the history
- Add NS_ASSUME_NONNULL_BEGIN
- Add nullable
- Add types for generics
- Remove tvOS nonsense
  • Loading branch information
flambert committed Apr 3, 2018
1 parent 24b7cf4 commit f417d11
Show file tree
Hide file tree
Showing 65 changed files with 1,220 additions and 729 deletions.
157 changes: 103 additions & 54 deletions Example/MRGPagerController.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down Expand Up @@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down Expand Up @@ -59,6 +79,16 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
31 changes: 31 additions & 0 deletions Example/MRGPagerController/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="cmd-aN-zgE"/>
<viewControllerLayoutGuide type="bottom" id="rod-mQ-kRe"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
2 changes: 1 addition & 1 deletion Example/MRGPagerController/MRGAppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Example/MRGPagerController/MRGAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions Example/MRGPagerController/MRGDemoController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -30,4 +30,4 @@

@interface MRGDemoController : UIViewController
- (instancetype)initWithTitle:(NSString *)title text:(NSString *)text;
@end
@end
4 changes: 2 additions & 2 deletions Example/MRGPagerController/MRGDemoController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -53,4 +53,4 @@ - (void)loadView {
self.view = label;
}

@end
@end
2 changes: 1 addition & 1 deletion Example/MRGPagerController/MRGDemoTabStrip.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Example/MRGPagerController/MRGDemoTabStrip.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 2 additions & 0 deletions Example/MRGPagerController/MRGPagerController-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
2 changes: 1 addition & 1 deletion Example/MRGPagerController/MRGViewController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
31 changes: 16 additions & 15 deletions Example/MRGPagerController/MRGViewController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -42,7 +42,7 @@ @implementation MRGViewController
- (void)viewDidLoad
{
[super viewDidLoad];

self.pagerController = [[MRGPagerController alloc] initWithPagerStripClass:[MRGDemoTabStrip class]];

[self addChildViewController:self.pagerController];
Expand All @@ -55,19 +55,20 @@ - (void)viewDidLoad
}

- (void)configurePager {

NSArray *tabs = @[
[[MRGDemoController alloc] initWithTitle:@"1" text:@"1"],
[[MRGDemoController alloc] initWithTitle:@"2" text:@"2"],
[[MRGDemoController alloc] initWithTitle:@"3" text:@"3"],
[[MRGDemoController alloc] initWithTitle:@"4" text:@"4"],
[[MRGDemoController alloc] initWithTitle:@"5" text:@"5"],
[[MRGDemoController alloc] initWithTitle:@"6" text:@"6"],
[[MRGDemoController alloc] initWithTitle:@"7" text:@"7"],
[[MRGDemoController alloc] initWithTitle:@"8" text:@"8"],
[[MRGDemoController alloc] initWithTitle:@"9" text:@"9"]
];


NSArray<UIViewController *> *tabs =
@[
[[MRGDemoController alloc] initWithTitle:@"1" text:@"1"],
[[MRGDemoController alloc] initWithTitle:@"2" text:@"2"],
[[MRGDemoController alloc] initWithTitle:@"3" text:@"3"],
[[MRGDemoController alloc] initWithTitle:@"4" text:@"4"],
[[MRGDemoController alloc] initWithTitle:@"5" text:@"5"],
[[MRGDemoController alloc] initWithTitle:@"6" text:@"6"],
[[MRGDemoController alloc] initWithTitle:@"7" text:@"7"],
[[MRGDemoController alloc] initWithTitle:@"8" text:@"8"],
[[MRGDemoController alloc] initWithTitle:@"9" text:@"9"]
];

self.pagerController.viewControllers = tabs;
self.pagerController.currentViewController = tabs[7];
}
Expand Down
19 changes: 11 additions & 8 deletions Example/MRGPagerController/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9046" systemVersion="15A279b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9035"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="wQg-tq-qST">
<objects>
<viewController id="whP-gf-Uak" customClass="MRGViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
<viewControllerLayoutGuide type="top" id="i70-ws-5PU"/>
<viewControllerLayoutGuide type="bottom" id="cGu-1D-Ex0"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down
2 changes: 1 addition & 1 deletion Example/MRGPagerController/main.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2014-2017, Mirego
// Copyright (c) 2014-2018, Mirego
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down
15 changes: 7 additions & 8 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'MRGPagerController_Example', :exclusive => true do
pod "MRGPagerController", :path => "../"
end

target 'MRGPagerController_Tests', :exclusive => true do
pod "MRGPagerController", :path => "../"
target 'MRGPagerController_Example' do
pod 'MRGPagerController', :path => '../'


target 'MRGPagerController_Tests' do
inherit! :search_paths
end
end
10 changes: 6 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
PODS:
- MRGPagerController (1.0.9)
- MRGPagerController (1.1)

DEPENDENCIES:
- MRGPagerController (from `../`)

EXTERNAL SOURCES:
MRGPagerController:
:path: "../"
:path: ../

SPEC CHECKSUMS:
MRGPagerController: 5ba303b0df5d7523c85a19aa48e5a1f2deb8cd60
MRGPagerController: ec70b0866720042fa60de78e918434e97d77c09a

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 54ade33a80857e981cd8868bdb60abcb692be0fc

COCOAPODS: 1.4.0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 3 additions & 4 deletions Example/Pods/Local Podspecs/MRGPagerController.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f417d11

Please sign in to comment.