Skip to content

Commit

Permalink
幫 tabbar 加上系統的 icon OwO
Browse files Browse the repository at this point in the history
  • Loading branch information
DaidoujiChen committed Jun 20, 2018
1 parent 2f715be commit e580e14
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
8 changes: 8 additions & 0 deletions Dai-Hentai.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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>
33 changes: 14 additions & 19 deletions Dai-Hentai/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sRn-zh-zZh">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="sRn-zh-zZh">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment version="2304" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="HelveticaNeue.ttc">
<string>HelveticaNeue-Bold</string>
</array>
</customFonts>
<scenes>
<!--Tab Bar Controller-->
<scene sceneID="RPj-P2-Cxo">
Expand Down Expand Up @@ -49,7 +44,7 @@
<tableViewSection headerTitle="App 狀態" id="Dfg-vD-Cux">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="EhListCheckCell" textLabel="mh4-n1-VoS" detailTextLabel="3Vi-Tb-1cu" style="IBUITableViewCellStyleValue1" id="LHB-qP-Ndb">
<rect key="frame" x="0.0" y="55.333333333333336" width="375" height="44"/>
<rect key="frame" x="0.0" y="55.333333333333343" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="LHB-qP-Ndb" id="ehD-05-zit">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/>
Expand Down Expand Up @@ -272,11 +267,11 @@
</objects>
<point key="canvasLocation" x="294" y="2322"/>
</scene>
<!--設定-->
<!--Navigation Controller-->
<scene sceneID="en3-rZ-TW5">
<objects>
<navigationController id="u6v-Sh-Y1v" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="設定" id="YR5-UU-4Aw"/>
<tabBarItem key="tabBarItem" systemItem="contacts" id="YR5-UU-4Aw"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="IiZ-34-Z8t">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand All @@ -289,11 +284,11 @@
</objects>
<point key="canvasLocation" x="-730" y="2323"/>
</scene>
<!--下載-->
<!--Navigation Controller-->
<scene sceneID="60n-Vv-q3G">
<objects>
<navigationController id="Zn6-pD-8g1" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="下載" id="yff-qe-7jA"/>
<tabBarItem key="tabBarItem" systemItem="downloads" id="yff-qe-7jA"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="KE0-Ug-70E">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -476,11 +471,11 @@
</objects>
<point key="canvasLocation" x="66" y="1674"/>
</scene>
<!--歷史-->
<!--Navigation Controller-->
<scene sceneID="ai7-XZ-UxE">
<objects>
<navigationController id="nff-1U-hH1" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="歷史" id="b0Q-ae-4aD"/>
<tabBarItem key="tabBarItem" systemItem="history" id="b0Q-ae-4aD"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Gvy-za-D7m">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand All @@ -493,11 +488,11 @@
</objects>
<point key="canvasLocation" x="-730" y="374"/>
</scene>
<!--列表-->
<!--Navigation Controller-->
<scene sceneID="ZxI-d1-yNR">
<objects>
<navigationController id="3VD-JS-Duy" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="列表" id="2vX-UH-pKV"/>
<tabBarItem key="tabBarItem" systemItem="mostViewed" id="2vX-UH-pKV"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="BfU-ZD-WIe">
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -881,7 +876,7 @@
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="RelatedCell" textLabel="Dko-8s-0OK" style="IBUITableViewCellStyleDefault" id="5ig-uj-O9t" customClass="SearchCategoryCell">
<rect key="frame" x="0.0" y="55.333333333333336" width="375" height="44"/>
<rect key="frame" x="0.0" y="55.333333333333343" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5ig-uj-O9t" id="Npm-ZP-NGP">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/>
Expand Down Expand Up @@ -936,7 +931,7 @@
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="SearchKeywordCell" id="AdL-n9-snb" customClass="SearchKeywordCell">
<rect key="frame" x="0.0" y="55.333333333333336" width="375" height="44"/>
<rect key="frame" x="0.0" y="55.333333333333343" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="AdL-n9-snb" id="ksK-qB-k9g">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666666666666664"/>
Expand Down Expand Up @@ -1120,6 +1115,6 @@
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="87c-oO-NHA"/>
<segue reference="sFK-aE-S2c"/>
</inferredMetricsTieBreakers>
</document>
2 changes: 1 addition & 1 deletion Dai-Hentai/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>3.2</string>
<key>CFBundleVersion</key>
<string>20180326</string>
<string>20180620</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
14 changes: 14 additions & 0 deletions Dai-Hentai/ViewControllers/TabBarController/TabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewCon
- (void)viewDidLoad {
[super viewDidLoad];
self.delegate = self;

__block NSMutableArray *titles = [NSMutableArray arrayWithObjects:@"列表", @"歷史", @"下載", @"設定", nil];
[self.tabBar.subviews enumerateObjectsUsingBlock: ^(UIView *v, NSUInteger tabBarIndex, BOOL *tabBarStop) {
if ([v isKindOfClass:NSClassFromString(@"UITabBarButton")] && v.subviews.count == 2) {
[v.subviews enumerateObjectsUsingBlock: ^(UIView *buttonSubView, NSUInteger buttonIndex, BOOL *buttonStop) {
if ([buttonSubView isKindOfClass:NSClassFromString(@"UITabBarButtonLabel")]) {
[buttonSubView performSelector:@selector(setText:) withObject:titles.firstObject];
[buttonSubView sizeToFit];
[titles removeObjectAtIndex:0];
*buttonStop = YES;
}
}];
}
}];
}

@end

0 comments on commit e580e14

Please sign in to comment.