ç§ã¯é·ãéã¢ãã¿ãŒç»é¢ãèŠãŠããŸããããæªç¥ã®ãã®ãžã®ææãç§ãæŒãã®ããŸããã ããã§ããç§ã¯ãã¶ã€ã³ãå³é¢ããã¯ã»ã©é ã人ã§ããããã®ãããžã§ã¯ãã®å šåãäžç®ã§ç解ããããšã¯ã§ããŸããã§ããã 圌ã¯ç§ãã¡ã®ãã¶ã€ããŒã«ãããªãšãããžã§ã¯ãã®ãŠã§ããµã€ããžã®ãªã³ã¯ãéãããããŠãä»ã圌ãã¯æ¬ç©ã®ããšãå§ããŸãïŒããšèããŸããã ãããã圌ãã®è¡šçŸã¯ç§ã®ãããªãã®ã§ããã ããã§ãã圌ãã¯ããããã¹ãŠã®è€éãªåŒãšå€æ°ãç解ã§ããŸããã§ãã...
PaintCodeã¯èå³æ·±ãã¢ããªã±ãŒã·ã§ã³ã§ããå¢çç¶æ ã«ãããšããçç±ã ãã§ãã¶ã€ããŒåãã®ããã«æããŸãããããã°ã©ããŒåãã§ããããŸã-PaintCode ãããã¯æ¬åœã«äœã§ããïŒ
èŠçŽ ãäœæããããã»ã¹ãååã«è©³çŽ°ãã€ç°¡åã«èª¬æããè±å¯ãªããã¥ã¡ã³ããšäŸããããŸããããã®è£œåã§ã®äœæ¥äžã«ç¹å®ãããã³ã¡ã³ãã®äžéšãææããã ãã§ãªããå°ãè±ç·ããããšæããŸãã
ãã€ã³ã
äžèŠãéåžžã«ã·ã³ãã«ãªã¢ããªã±ãŒã·ã§ã³ã ãã¶ã€ããŒãšããã°ã©ããŒã®äž¡æ¹ã«ãªãã¿ã®ããããšïŒ
- ããŒã«ããŒç»é¢ã®äžéš ã
- ãªããžã§ã¯ãã®å·ŠåŽã®ã©ã€ãã©ãªã
- äžå€®ã¯äœæ¥ãšãªã¢ã§ãã
- å³åŽã®ã€ã³ã¹ãã¯ã¿ãšãã©ãŠã¶ïŒäœæ¥é åã«ããã¢ã€ãã ãéžæããããïŒã
äžéšã§ã¯ãã¹ãŠãæ確ã§ãåçåŸã¯ãã€ã³ãã§ãã€ã³ããããåãæ£æ¹åœ¢ãããã¹ãã®æ¿å ¥ãã¢ã¹ã¿ãªã¹ã¯ã®æç»æ¹æ³ãç¥ã£ãŠããŸãã
å·Šã®éšåãåæããŠã¿ãŸãããã次ã®é ç®ã§æ§æãããŠããŸãã
- è² -ã¢ããªã±ãŒã·ã§ã³ã®è²ã®ã»ãããäœæããŸãã
- ã°ã©ããŒã·ã§ã³ -[è²]ã¢ã€ãã ã§äœæãããåºæ¬è²ããäœæã§ããã°ã©ããŒã·ã§ã³ã®ã»ãããäœæããŸãã
- 圱 -[è²]é ç®ã§äœæãããåºæ¬è²ããäœæã§ããäžé£ã®åœ±ãäœæããŸãã
- ç»å -3ã€ã®è§£å床1xã2xã3xã®ç»åãåå¥ã«è¿œå ãããŸããã
- å€æ° -æãèå³æ·±ãïŒ ããã€ãã®é°è¬ãæ®ããŸãããã
è²ã®äœæ
ã°ã©ããŒã·ã§ã³ãäœæãã
圱ã®äœæ
3ã€ã®è§£å床ã§ç»åãè¿œå ãã
å€æ°ã®äœæ
ããããå€æ°ã®è©³çŽ°ã«ã€ããŠã¯ã ããšãã°ãè²ãåŸæè§ãããã¹ããç¶æ ãã¿ã€ããå Žæããµã€ãºãå Žæãªã©ãã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ãšããåãããå€æ°ãè¿œå ããããšãã§ããŸãã
å€æ°ã®çš®é¡ïŒ
- åŒ -次ã®ãã¹ãŠãè¿ãããšãã§ããåŒã
- æ°å€ -æ°å€ãããšãã°èŠçŽ ã®ã¿ã€ãã
- ç«¯æ° -端æ°ãUIProgressViewã®progressããããã£ãšããŠã®0ãã1ãŸã§ã®æµ®åå°æ°ç¹æ°ã
- è§åºŠ -æ°å€ãšã¯ç°ãªããããã¯å®éã«ã¯è§åºŠã§ããã0ã360ã®å€ã§ãã
- ããã¹ã -ããã¹ããã£ãŒã«ãã«å²ãåœãŠãããšãã§ããããã¹ãã
- ããŒã«å€ -1/0ãYES / NOãã¯ã/ãããã奜ããªããã«ïŒããšãã°ããã¿ã³ãæŒãããŸãã¯èŠçŽ ãé ãïŒ;
- Point-ãã€ã³ãxããã³yã®åº§æšã
- ãµã€ãº -ãµã€ãºã®å¹ ãé«ãã
- é·æ¹åœ¢ -äœçœ®ïŒxãyïŒãšãµã€ãºïŒå¹ ãé«ãïŒã§æ§æãããé·æ¹åœ¢ã
ã©ã€ãã©ãªã®åèŠçŽ ã«å¯ŸããŠãäžæã®ååãšãã®ã¿ã€ããæå®ã§ããŸãïŒStyleKitãLocalãParameterïŒå€æ°ã«ã¯StyleKitã¿ã€ãã¯ãããŸããïŒïŒ
- StyleKit-ãªããžã§ã¯ãã¯äžè¬çãªã¹ã¿ã€ã«ã»ããã«è¿œå ãããŸãã詳现ã¯ä»¥äžãåç §ããŠãã ããã
- ããŒã«ã« -ãã®ã¿ã€ãã¯ãPaintCodeã§ã®ã¿è¡šç€ºãããããŒã«ã«ãªããžã§ã¯ãã§ããããšãæå³ããŸãã
- ãã©ã¡ãŒã¿ -ãã®ã¿ã€ãã¯ãPaintCodeã ãã§ãªããããã°ã©ãã衚瀺ã§ããå€éšãªããžã§ã¯ãã§ããããšãæå³ããŸãïŒããã°ã©ãã¯ãæåãã§å€æŽã§ããŸãïŒã
ã¹ã¿ã€ã«ããã
StyleKit PaintCodeã®å€éšã§äœ¿çšããããã«å¿ èŠãªèŠçŽ ã®ã»ãããå«ããã®ãããšãã°ãã¢ããªã±ãŒã·ã§ã³ãæ§æããè²ã®ã»ãããè¿œå ã§ããŸãã ããã°ã©ããŒã¯ååã§ã®ã¿è²ãåŒã³åºãããšãã§ããŸãïŒ
self.view.backgroundColor = [StyleKitHabrahabr backgroundLogo];
åæ§ã«ãã°ã©ããŒã·ã§ã³ãã·ã£ããŠãããã³äœæãããã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ãStyleKitã«è¿œå ãããŸãã ã€ãŸã éçºè ãUIãäœæããã®ã«ããã«åœ¹ç«ã€ã»ããã
äŸïŒ
ããè²ãäœæãããããå¥ã®è²ã®ããŒã¹ãšããŠäœ¿çšããŸãã
ããŒã¹ããè²ãäœæ
// habrastorage.org / files / 10a / ffd / a57 / 10affda57f1741fd8ebc50714579dc4a.png "/>ããã©ãã°ã¢ã³ãããããããã ãã§ããã£ã³ãã¹ã«é·æ¹åœ¢ãè¿œå ããè²ãå²ãåœãŠãŸããã
ããã¹ãããã¯ã¹ããã£ã³ãã¹ã«è¿œå ããæåãHããå°å·ããããã¹ããããžã§æ²ç·ã«å€æããçµæã®èŠçŽ ã«å°ã圱ãè¿œå ããŸããïŒæåã®è²ããäœæããè²ãã以åã«äœæïŒ
圱ãè¿œå
ãã¹ãŠãã·ã³ãã«ã§ãïŒ
以åã«äœæãããèŠçŽ ãç¶æ¿ããèŠçŽ ãäœæããå¯èœæ§ã¯å€§ããªãã©ã¹ã«ãªããšèããŠããŸããããšãã°ãããŒã¹ã«ã©ãŒããã·ã£ããŠãäœæãããšãããŒã¹ã«ã©ãŒãå€æŽãããšããã«ããã¹ãŠã®çžç¶äººãå€æŽãããã«åãå ¥ããŸãã é©åãªèšèšã§ãéåžžã«äŸ¿å©ãªããšã
PSDãã€ã³ããŒããããæ°ã«å ¥ãã®ãšãã£ã¿ãŒã§æç»ããŠãããžã§ã¯ãã«è»¢éããããšãã§ããŸãã æç»ã«é¢ããŠã¯ããã¶ã€ããŒã¯å€ãã®äœæ¥ãç解ããããšã¯ã§ããŸããã
äœæãããèŠçŽ ã¯ãã¬ãžããéžè±ããããšãªããããšã¯ã¹ããŒãããã¿ã³ãæŒãã ãã§ãå¿ èŠãªè§£å床ã«ã«ããã§ããŸãã
PNGããšã¯ã¹ããŒã
äœãã
ããã«å°ããªäœè«ããããŸãã
ãã§ã«æžããããã«ã PaintCodeã®æåã®ç¥ãåãã¯ããªãåã®ããšã§ãããã©ããããããéãéããŸããã ãããŠçªç¶ãã¢ããªã±ãŒã·ã§ã³ãå šé¢çã«åèšèšããæ©äŒããããä»åã¯æ±ºå¿ããŸããã PaintCodeã®å°å ¥ãå§ãŸããŸããããããã§ããã€ãã®åé¡ãçºçãããã¶ã€ããŒã¯äžäœã®éšåã®ã¿ãåŠç¿ããããšãã§ããŸããïŒ åœŒãã¯ä»äºãããŸããã£ãŠããŸãããå€æ°ãšé¢æ°ã®äœæã«é¢ããŠã¯ãæ··ä¹±ããããéçºè ã¯ãã®äœæ¥ãçµããªããã°ãªããŸããã§ããã
äœæ¥ãå ±æãããã¶ã€ããŒãè²ãšç»åèªäœãäœæããéçºè ãStyleKitããããžã§ã¯ãã«ãšã¯ã¹ããŒãããå¿ èŠãªå€æ°ãšé¢æ°ãäœæããããšã«ããŸããã ãããŠãéçºè ã¯æ¥ç¶ããŸã...
ã³ãŒã
ãã¶ã€ããŒã«ãã£ãŠäœæãããèŠçŽ ã¯ãç»é¢ã«è¡šç€ºããã ãã§ãããå Žåã«ãã£ãŠã¯äœããã®åœ¢ã§çãè¿ããŸãã
PaintCodeã䜿çšãããšãåçŽãªUIImageããã³UIVewã®åœ¢ã§ã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ãäœæã§ããŸãããããã¯ã移åãå転ãè²ã®å€æŽãé衚瀺ãªã©ãããæ£ç¢ºã«ã¯ãUIViewã®ã€ã³ã¹ã¿ã³ã¹ãæç»ããã¡ãœãããäœæããŸãã
ç°¡åãªãã®ããå§ããŸããããäœæããç»åããUIImageãååŸããã«ã¯ããã£ã³ãã¹ãéžæããStyleKitãå³åŽã®ã€ã³ã¹ãã¯ã¿ãŒã§è¿ãã¡ãœãããæå®ããå¿ èŠããããŸãã
æç»æ¹æ³ã®éžæ
ããããããŠã³ãªã¹ãã«ã¯ãã¡ãœããããæç»ãã¡ãœãããç»åããæç»ãããã³ç»åã¯ãããŸããã
ç»åçæãéžæãããšãStyliKitã«ã¡ãœããã衚瀺ãããŸããç§ã®å Žåã¯
//çæãããç»å
+ïŒUIImage *ïŒimageOfLogoHabrWithFrameïŒïŒCGRectïŒãã¬ãŒã ;
åŒã³åºããããšãçŸåšã®è§£å床ã®ç»åãäœæããã䜿çšã§ããç¶æ ã«ãªããŸãã
æç»ã¡ãœãããéžæãããšãã¡ãœãããäœæãããŸã
//æç»ã¡ãœãã
+ïŒvoidïŒdrawLogoHabrWithFrameïŒïŒCGRectïŒãã¬ãŒã ;
次ã«ãã¡ãœããã®UIViewäžäœã¯ã©ã¹ã«ãã£ãŠã¯ã©ã¹ã«è¿œå ãããŸã-ïŒvoidïŒdrawRectïŒïŒCGRectïŒrectïŒ
-ïŒvoidïŒdrawRectïŒïŒCGRectïŒrect {
//æç»ã³ãŒã
[StyleKit drawLogoHabrWithFrameïŒrect];
}
ããšãã°ããã¬ãŒã ãä»ã®ãã©ã¡ãŒã¿ãŒããŸãã¯ã¢ãã¡ãŒã·ã§ã³ãå€æŽãããšãã«ã€ã³ã¹ã¿ã³ã¹ãåæç»ããã«ã¯ãã€ã³ã¹ã¿ã³ã¹ã§ã¡ãœãããåŒã³åºãããŸãã
[self setNeedsDisplay];
äžè¬ã«ãåè·¯ã¯2x2ã®ããã«åçŽã§ãã
ãã®äŸã«ã¯ãPaintCodeãããžã§ã¯ããšXcodeã®äž¡æ¹ãå«ãŸããŠãããéåžžã«äŸ¿å©ã§ãã
StyleKitïŒå®éã«ã¯Obj-Cã®å Žåã¯.hããã³.mãã¡ã€ã«ã§ãïŒããšã¯ã¹ããŒãããã«ã¯ãFile- > Export ...
StyleKitããšã¯ã¹ããŒã
次ã«ããããžã§ã¯ãã«ãã¡ã€ã«ãè¿œå ããŠäœ¿çšããŸãã
PaintCodeã¯ãObjective-CãSwiftãCïŒXamarinã®iOSããã³Objective-CãSwiftã®Mac OSã®ã³ãŒããçæã§ããŸãã iOS 5以éãMac OS 10.7以éããµããŒãããŸãã
æŠããŠãéçºè ã¯å€æ° ã åŒã®èšèªãããã³åçãã©ãŒã ã®äœ¿çšãç¿åŸããå¿ èŠããããŸã ã ãããŠãããªãã®æ³ååã§ååã§ãã
ãŸãšã
PaintCodeã¯ãéåžžã«åŒ·åã§èå³æ·±ãããŒã«ã§ãã ããã«ãããçŸãããã©ã€ããã€ã³ã¿ãŒãã§ãŒã¹ãäœæããŠãã¢ããªã±ãŒã·ã§ã³ããä¿é²ãããããšãã§ããŸãã ãã¹ãŠã®ãã¹ã©ã€ã¹ããããåçãä¿åããå¿ èŠã¯ãããŸããã ãããã䜿çšããåã«ãã¹ãŠã®ééãéãå¿ èŠãããããããç§ãã¡ã決ãããã®ã§ãïŒ
é·æ
- æ°åã®ã¯ãªãã¯ã§ç®çã®è§£å床ã«ç»åããã«ãããããŸãã
- ãããžã§ã¯ãã«å€æ°ã®åçãä¿åããå¿ èŠããªããªããŸãã
- UIãã埩掻ããããŸã-è²ãåçã«å€æŽããã¢ãã¡ãŒã·ã§ã³ãè¿œå ãããµã€ãºãå€æŽããæ³ååã®ã¿ã«å¶éããŸãã
- ããçšåºŠãéçºããã»ã¹ãå éããŸãã
- ãããžã§ã¯ãã®åªããã¢ãŒããã¯ãã£ã䜿çšãããšãäžé£ã®èŠçŽ ïŒ Symbolã䜿çšããŠåãåºæ¬è²ã圱ïŒã®å€èŠ³ããã°ããå€æŽã§ããŸãã
- äžç®æã«ãã¹ãŠã®è²;
- èŠçŽ ãååã«ãã°ããæç»ããŸãã
- 5å以å ã«åçãã質åããã£ããšãã«ãææ¡ããŠãããŸããã
çæ
- ãããžã§ã¯ãã¯åäžã®ãã¡ã€ã«ã§æ§æãããŠãããããããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšãããšäžäŸ¿ã«ãªããŸãïŒGitã¯å€æŽãããŒãžã§ããŸãããé çªã«å€æŽããŸã!!!ïŒã
- 楜åšã®å¢çç·ã®ç¶æ ã¯ããã¶ã€ããŒãšéçºè ã®äž¡æ¹ã«ææãåŒã³èµ·ãããŸãã äžéšã®äººã¯ããžãã¯ãå°ç¡ãã«ããã®ã¯é£ãããä»ã®äººã¯æãã®ãé£ããã
- å€æ°ããµãã°ã«ãŒãã«åå²ãã䟿å©ãªæ¹æ³ã¯ãããŸããããã®åŸãåãã¢ã¯ã·ã§ã³ãæ åœããå€æ°ã衚瀺ãããŸãããããããã°ããããã²ãŒãããã«ã¯ãäœããã®ããªãããŒãªã·ã¹ãã ãèæ¡ãããããã¹ãŠã®äººã远跡ããå¿ èŠããããŸãã
- 1ã€ã®ãããžã§ã¯ãã§1ã€ã®StyleKitã䜿çšãããšãåŸè ã¯äœ¿çšãéåžžã«é£ãããå€æ°ããšåŒã§ãã£ã±ãã«ãªããŸãïŒäžèšã®æ®µèœãåç §ïŒã
- è€æ°ã®StyleKitã䜿çšããå Žåãã©ã®ç¹å®ã®èŠçŽ ãè²ã圱ãªã©ãé 眮ãããŠãããã远跡ããå¿ èŠããããŸããããã«ãããéçºäžã«æ··ä¹±ãçããçµæãšããŠãã³ããçºçããŸãã
- ãããžã§ã¯ãã¯ãã€ã³ã¹ããŒã«ãããŠããããŒãžã§ã³ã®PainCodeã®ååšã«äŸåããŸããããããªããšãPainCodeã§äœæãããèŠçŽ ããã°ããå€æŽã§ããŸããã
- èšèšè ã¯Gitãç¿åŸããå¿ èŠããããŸããã
- ã³ãŒãããšã¯ã¹ããŒãããŠã€ã¡ãŒãžãååŸããæ¹æ³ã¯ãããŸããã ããšãã°ãããå¥è·¡ã«ãã£ãŠãPaintCodeãããžã§ã¯ãã¯å€±ãããŸããããããã«ãã£ãŠçæãããã³ãŒãã¯æ®ã£ãŠãããããã³ãŒããããããžã§ã¯ãã埩å ã§ããŸããã
- åé¡ã解決ãããšããç¹ã«å°æ¥ã®èŠçŽ ãããµã€ãºå€æŽãããå¿ èŠããããšãïŒiOSã®å¶çŽã®ã«ããŽãªããã®äœãïŒã«åé¡ãšç解äžè¶³ãæã ãã
- çŸåšãiOSããã³Mac OSãé€ããäœæãããèŠçŽ ãAndroidã§è¡šç€ºãããã©ããã«ããããããäœæããèŠçŽ ã䜿çšããæ¹æ³ã¯ãããŸãã...
PS
éçºè ã®çŽæãå®ãã®ã¯éåžžã«ç°¡åã§ãããããã ãã®äŸ¡å€ãããå ŽåããããŸãïŒ ãããžã§ã¯ããAppStoreã«å ¥ããšããã«ãè³æãèšäºã«è¿œå ãããŸãã PaintCodeã¯ãå°ããªãããžã§ã¯ãã§ããå°ããªäŒç€Ÿã«ãšã£ãŠåªããããŒã«ã§ãã çŸããã競äºåã®ãããã¶ã€ã³ãã掻æ°ã®ãããUIããã®ä»ã®å°è±¡çãªãã®ãäœæããããã«ãããŒã«ãåŒãç¶ãéçºãããããšãé¡ã£ãŠããŸãã ãããããæçš¿å šäœãéããŠèŠããã§ããäž»ãªè³ªåã¯ãããããªããå°ãªããšããéã®ããã«äŸ¡å€ãããã®ã§ããããïŒãã§ãã ééããªã䟡å€ããããŸãïŒ ããªãã¯ãããææ¡ããå¿ èŠããããŸãïŒ
ãŸããçš®ã®ããã«ãç§ã®äŸã¯æ¬¡ã®ãšããã§ãã
äŸ1
<img src = " "alt ="ç»å "/>
äŸ2
äŸ3
ãããŠããããprofiã®ä»çµã¿ã§ãïŒ